Configurator
Central configuration service: what it manages, how it is built, and where to find the full API reference
Updated 2026-11-03
Verified 2026-11-03
The Configurator (cosmos-configurator-v3) is the central configuration service of the Cosmos platform. Built on Django and Django REST Framework, it provides APIs for every configurable resource: tools, agents, apps, analyzers, collections, graphs, data sources, skills, templates, guardrails, connectors, evaluations, organization settings, and the library. It is the source of truth for platform configuration; other services read a cached or synced copy of what Configurator owns.
Why It Matters
Nothing in Cosmos runs without Configurator. MCP syncs tools from it, ADK loads agents, apps, skills, and BYOT model credentials from it, and every deploy is a Configurator write that fans out to those services over Kafka. If a resource misbehaves at runtime, Configurator shows what is actually deployed.
Architecture
- Framework: Django 5.2.18 and DRF 3.18.2, using the ViewSet, service layer, and model pattern. The web server runs under uWSGI.
- Multi-tenancy: every resource is scoped by
org_idthrough theget_current_user()thread-local middleware. - Project scope: when a request sends
X-Project-Id, agents, apps, collections, graphs, and analyzers are filtered to resources enabled in that project, and detail routes return404for resources that are not enabled. Newly created agents and apps are bound to the project. Enablement is cached locally from the User Serviceuser-project-enablementKafka events. - Domain apps:
tool,agent,app,analyzer,collection,graph,data_source,skill,template,business_event,org_settings,org,library,guardrails,connector,evaluation,project_enablement, andcore. - Kafka producer: configuration changes emit events to the
configuratortopic, using the@register_event_serializerpattern. Versioned configurations emit<model>.configuration.added,<model>.configuration.updated,<model>.configuration.deployed, and<model>.deleted(for exampleagent.configuration.deployedorapi_tool.configuration.added). Changes also publish Recent Activity envelopes to the activity topic (KAFKA_ACTIVITY_TOPIC). - Consumer process: the standalone
consumer.pyboots Django and dispatches Kafka messages byevent_type; it runs as theconfigurator-consumercontainer. - Observability: the web server and consumer run under
opentelemetry-instrumentand export to Azure Monitor throughAPPLICATIONINSIGHTS_CONNECTION_STRING. The image installs dependencies into/app/.venv.
Configurator event sync
SourceLoading diagram...
Key Capabilities
- Tools, agents, apps: polymorphic tool types (
api,db,custom, dispatched throughTOOL_TYPE_MAP) and versioned agent and app configurations. Deploys publish Kafka events. Tools can require approval before ADK runs them (requires_approval). See the Tools API, Agents API, and Apps API. - Agent settings for ADK: agents carry the runtime settings ADK enforces, including
context_window_tokens, compaction settings,prompt_caching,prompt_caching_history,dynamic_thinking_enabled,headroom_compression_enabled, thinking mode, and reasoning effort. Workflow agents usetype: workflowwithworkflow_kind(sequential,parallel,loop, orgraph). - Analyzers: versioned analyzers (
/api/v1/analyzers/) attach to agent versions throughanalyzer_idandanalyzer_version. They replace agent-level business events, which are read-only on agents. - Knowledge Base (Collections): RAG document sets backed by
cosmos-ragflow-v3, with lifecycle status (pending,indexing,ready, orfailed), BYOT-configurable embeddings, and deletion protection while an agent references them. - Graphs: knowledge graphs built from DMS files through RAGflow, with entity and relationship extraction and the same deletion protection as collections.
- Evals: datasets, metric templates, experiments, and online evaluation policies under
/api/v1/evals/. ADK runs experiments and writes results back. - Business Events: structured domain events with categories, versioned and deployable like other resources.
- Library: prompt, tool, and agent catalogs (
/api/v1/prompt-library/,/api/v1/tool-library/,/api/v1/agent-library/) that organization users can browse and clone into their organization. - Skills and Templates: agentskills.io-spec skills (L1 name and description, L2 instructions, L3 resources and scripts) and placeholder-based templates, both versioned and deployable.
- Guardrails: the schema source of truth for app-level (PII and content filter) and agent-level (content filter) guardrails, validated centrally and consumed by ADK when it builds an agent.
- Organization settings: BYOT model credentials (
/api/v1/byot/,/api/v1/byot/schema/), chat configuration, default guardrails, and cost controls.GET /api/v1/cost-control-config/mine/returns the caller's effectivesession,weekly, andmonthlylimits (enabled,limit_usd,is_custom). Administrators manage per-user overrides and limit-increase requests.
API Overview
| Method | Endpoint | Description |
|---|---|---|
| GET, POST | /api/v1/tools/ | List or create tools (type required) |
| GET, PUT, DELETE | /api/v1/tools/{id}/ | Read, update, or delete a tool |
| POST | /api/v1/tools/{id}/deploy/ | Deploy the latest tool draft |
| GET | /api/v1/tools/bulk-fetch/, /api/v1/tools/mcp-list/ | Bulk and MCP-facing tool reads |
| GET, POST | /api/v1/agents/ | List or create agents |
| GET, PUT, DELETE | /api/v1/agents/{id}/ | Read, update, or delete an agent |
| POST | /api/v1/agents/{id}/deploy/ | Deploy the latest agent draft |
| GET | /api/v1/agents/{id}/versions/ | Agent versions |
| GET | /api/v1/agents/bulk-fetch/, /api/v1/agents/{id}/tree/ | Bulk reads and agent trees |
| GET, POST | /api/v1/apps/ | List or create apps |
| GET, PUT, DELETE | /api/v1/apps/{id}/ | Read, update, or delete an app |
| POST | /api/v1/apps/{id}/deploy/ | Deploy the latest app draft |
| GET | /api/v1/apps/bulk-fetch/ | Bulk app reads |
Other resources live under /api/v1/analyzers/, /api/v1/collections/, /api/v1/graphs/, /api/v1/data-sources/, /api/v1/skills/, /api/v1/templates/, /api/v1/business-events/, /api/v1/guardrails/, /api/v1/connectors/, /api/v1/evals/, /api/v1/org/, the organization settings routes (/api/v1/byot/, /api/v1/chat-config/, /api/v1/guardrails-config/, /api/v1/cost-control-config/, /api/v1/limit-increase-requests/), and the library catalogs. GET /health/ is unauthenticated.
→ Full API reference: Configurator API
Configuration
| Variable | Purpose |
|---|---|
COSMOS_SERVICE_CLIENT_ID, COSMOS_SERVICE_CLIENT_SECRET | Service OAuth client credentials |
USER_SERVICE_URL, JWKS_URL | User Service and token validation |
MCP_SERVICE_URL, RAGFLOW_BASE_URL, STORAGE_BASE_URL, OBSERVER_BASE_URL | Downstream services |
KAFKA_BOOTSTRAP_SERVER, LOCAL_KAFKA, LOCAL_KAFKA_BOOTSTRAP_SERVER | Kafka connection (kafka:9092 inside Docker, not localhost:9092) |
KAFKA_TOPIC_PRODUCER, KAFKA_CONSUMER_GROUP, KAFKA_ACTIVITY_TOPIC, ACTIVITY_EMISSION_ENABLED | Topics and Recent Activity emission |
POSTGRES_HOST, POSTGRES_PORT, POSTGRES_DB_NAME, POSTGRES_USER, POSTGRESPASSWORD | Main database |
POSTGRES_DB_NAME_TOOLS, POSTGRES_USER_TOOLS, POSTGRESPASSWORDTOOLS | Tools database |
REDIS_HOST, REDIS_PORT, REDISPASSWORD | Redis |
HYPERSCALER | local, azure, or gcp |
STORAGE_ACCOUNT_NAME, AZURE_BLOB_ENDPOINT, KNOWLEDGE_BASE_CONTAINER, ORG_CONFIG_FILES_CONTAINER | Blob storage |
INGRESS_PATH_PREFIX | Path prefix used when building pagination links for external gateway hosts |
SESSION_COST_PLATFORM_MAX_USD | Platform ceiling for session cost limits |
Permissions are granular per action and resource (for example HasCanCreateToolPermission, HasCanUpdateAgentPermission, HasCanViewAppPermission) and are always organization-scoped. Sharing a resource with the whole organization requires an organization administrator.
Data Model
Soft delete is supported through a base model mixin (deleted_at timestamp; records are retained). Tools, agents, apps, analyzers, skills, templates, and business events keep versioned configuration rows. Updating a resource edits the current draft, or creates a new draft version when the latest version is already deployed (agents and apps move to the next minor or major version depending on what changed). Deploying marks the latest draft as deployed; deployed versions are never edited in place.
Integration Points
| Service | Integration |
|---|---|
| User Service | Organization and user validation, PDP authorization, project enablement events |
| Kafka | Produces configurator topic events and Recent Activity events; consumes project enablement and graph events |
| MCP | Syncs tools to Redis from Configurator events and mcp-list |
| ADK | Loads agents, apps, skills, BYOT credentials, and cost limits |
| RAGflow | Collection and graph indexing |
| Blob Storage | Azure Blob or GCP Cloud Storage for file uploads |
Troubleshooting
- "Organization not found": verify
COSMOS_SERVICE_CLIENT_IDandCOSMOS_SERVICE_CLIENT_SECRET, run./manage.sh <env> verify-tokens, and if needed./manage.sh <env> setup-tokens && ./manage.sh <env> restart configurator-web. - Kafka events not produced: check
docker logs cosmos-dev-configurator-web, confirm Kafka connectivity, and make sure the bootstrap server iskafka:9092inside Docker. - Resource missing with
X-Project-Id: the resource is not enabled in that project. Retry without the header to confirm, then enable it in the project. - Migrations: run inside the container with
docker exec cosmos-dev-configurator-web python manage.py migrate. Deployed environments run migrations as a Helm hook job before the web server rolls out.
Changelog
See Configurator Changelog for verified documentation and service-surface changes.