Skip to main content
Scalekit is an auth and connected accounts platform that manages OAuth token lifecycle and tool access on behalf of your users. This integration covers how to combine Scalekit’s per-user identity with VectorAI DB’s per-user collection pattern so that an agent’s memory is scoped to the authenticated user. Scalekit controls what the agent can do, VectorAI DB controls what it remembers, and the same user identifier links both.

Installation

scalekit-sdk-python and actian-vectorai-client pin overlapping dependencies, so install both from a requirements.txt to let pip resolve them together instead of installing separately. Create a requirements.txt with:
Then install:

Requirements

Before using this integration, make sure your environment meets the following prerequisites:
  • Python 3.10 or later
  • A running Actian VectorAI DB instance (default endpoint: localhost:6574). See Docker installation for setup instructions.
  • A Scalekit account with at least one connected account configured in the Scalekit dashboard.

Connect user identity to memory

VectorAI DB has no native multi-tenancy. Isolation is enforced at the application layer using one collection per user, named after the Scalekit user identifier. The following function creates a collection for a user if one does not already exist and returns the collection name. The user_id argument must be the same string Scalekit uses as the identifier for the connected account. This is the only source of truth for linking auth scope and memory scope.
Using the Scalekit identifier directly as the collection name prefix ensures that Scalekit’s auth scope and VectorAI DB’s memory scope always agree on who the current user is. Do not introduce a separate user ID mapping, as it will diverge.

Tool access

Scalekit exposes tools through two paths. Use the MCP path when the required environment variables are present. Fall back to the direct LangChain path when they are not. The MCP path mints a short-lived per-user bearer token (60-minute default) and discovers tools dynamically from the MCP server. It requires SCALEKIT_MCP_CONFIG_ID and SCALEKIT_MCP_SERVER_URL. Before using this path, create an MCP configuration once:
To mint a session token at runtime:

Direct LangChain path (fallback)

Use this path when the MCP environment variables are absent:
See LangChain for vector store setup using the LangChain adapter.

Graceful degradation

If Scalekit credentials are not configured, or the user has not completed OAuth, the agent should fall back to memory-only mode. In this mode the agent can still read and write VectorAI DB collections, but has no external tools. This makes local development possible without Scalekit credentials.
When actions is None, skip the tool-access section of your agent loop and proceed with VectorAI DB operations only.

Environment variables

The following table lists all environment variables used by this integration.

Known issues

ScalekitClient.actions attribute
On some Python versions, ScalekitClient.actions is not reliably set as an attribute. Use the defensive access pattern shown in Graceful degradation to construct ActionClient directly when the attribute is missing.

Next steps

  • LangChain: Use VectorAI DB as a vector store for tool outputs and RAG pipelines.
  • Collections: Understand how collections organize per-user vector data.
  • Access tokens: Secure your VectorAI DB instance before deploying to production.
  • Troubleshooting: Diagnose connection and persistence issues.