Quick Start
How It Works
| Method | Returns |
|---|---|
get_workspace_context(workspace_id) | Workspace instructions string, or None |
get_agent_config(workspace_id, agent_id) | Config dict with system_prompt, model, tools, max_concurrent_tasks |
Configuration Options
| Protocol field | Type | Description |
|---|---|---|
get_workspace_context | async (workspace_id) → str | None | Workspace-level instructions |
get_agent_config | async (workspace_id, agent_id) → dict | None | Per-agent runtime settings |
system_prompt, model, tools, max_concurrent_tasks.
Best Practices
Always scope agent queries
Always scope agent queries
Filter by both
agent_id and workspace_id — never fetch agents globally.Return None for missing resources
Return None for missing resources
Missing workspace or agent records should return
None, not raise.Inject database sessions
Inject database sessions
Pass
AsyncSession via constructor — do not create sessions inside the context provider.Keep return values JSON-serialisable
Keep return values JSON-serialisable
Convert UUIDs and datetimes to strings before returning config dicts.
Related
Platform Auth Configuration
Authentication and authorisation setup
Platform Agents
Register and manage platform-hosted agents

