Agent runtime
The satellite that hosts the 'agent builder' surface. One Durable Object per (agent id, conversation id). Each instance drives its own inference loop, dispatches tool calls (built-in, unified-connector, custom MCP), and persists state across turns.
Overview
- Worker
ultron-agent-runtime- Durable Object
AgentInstance- DO key
- (agent_id, conversation_id)
- D1
ultron-agent-builder-db(agent defs, integrations, deployments)- R2
- Artifacts (uploaded files for RAG, deployment bundles)
- Cron
* * * * *(every minute)- Model traffic
- Routed through an AI Gateway slug for cache, logs, rate limits
- Vectorize indices
- Per-agent
agent-rag-<agent_id>, created on demand
Where the chat-v2 route in the app is the user-facing inference loop, the agent runtime is the satellite that the "build your own agent" feature delegates to. The two run on different schemas, with different integration projects, so a misbehaving experimental agent can never touch the production app state.
Worker shape
AgentInstance DO
One DO instance per (agent, conversation) pair.
Tool surfaces
What an agent built in the runtime can reach for.
| Surface | What it gives |
|---|---|
| Built-in primitives | Brain read, web search, calculator, document generation. Same shape as chat v2's native tools but scoped to the agent's policy. |
| Unified connector (per-agent) | OAuth surfaces under the siloed agent-builder integration project. Gmail, Slack, Notion, Google Workspace, etc. Each agent has its own connected accounts. |
| Custom MCP servers | Agent owner can register an MCP endpoint with credentials; the runtime connects, lists tools, exposes them to the model. |
| Workspace skills | Skills registered to the agent's owning workspace appear as callable tools in the loop. |
Per-agent scheduling
How an agent fires itself on a schedule.
Each agent definition row in AGENT_DB can carry a cron expression plus a cron_next_run_at timestamp. The worker's 1-minute scheduled handler scans for agents whose cron_next_run_at <= now() and enqueues a turn for each, then advances cron_next_run_at.
Per-agent RAG
Vector indices are created per agent on demand.
When the agent owner toggles RAG on, the runtime calls the platform's vector-index management API to create a new index named agent-rag-<agent_id>. Uploaded files in AGENT_ASSETS are chunked + embedded and inserted into that index. Inference-time, the inference loop queries the index for relevant chunks before each model call.