Skip to main content
AgentFlow supports multi-tenant deployments where each tenant gets isolated resources.

What’s Isolated

ResourceIsolation Level
DatabaseSeparate schema or database per tenant
Tool registryPer-tenant tool assignments and state
LLM configPer-tenant model, temperature, token limits
Knowledge basesTenant-scoped documents and embeddings
ConversationsTenant-scoped history

How It Works

Tenant context is extracted from the authenticated request (via Auth0 JWT) and propagated through the execution context:
@dataclass
class ExecutionContext:
    tenant_id: str | None
    user_id: str | None
    # ... other fields
All database queries, tool lookups, and knowledge base searches are automatically filtered by tenant_id.

Tenant Provisioning

When a new tenant is first seen, AgentFlow automatically:
  1. Creates the tenant’s database schema
  2. Runs migrations
  3. Syncs the global tool registry to the tenant’s tool state
  4. Initializes default agent configurations

Per-Tenant LLM Configuration

Each tenant can override default LLM settings:
PATCH /settings/llm
{
  "default_model": "anthropic/claude-sonnet-4-20250514",
  "default_temperature": 0.8,
  "default_max_tokens": 8192
}
This affects all agents for that tenant unless an agent has its own explicit llm_config.