System Design

Architecture & Orchestration Flow

How a conversation turn moves through the main agent, its sub-agents and the live session.

Browse docs Architecture & Orchestration Flow

How a turn is handled

When a visitor sends a message or finishes speaking, the main agent decides whether it can answer from its instructions or needs help. Each sub-agent you attached is available to it as a tool. The main agent calls the ones it needs — knowledge search, a datastore write, a connected-app action — and writes its reply from what they return.

Built-in tools

Besides sub-agents, an agent can use a few built-in tools you switch on per agent: checking the current time, saving the visitor's contact details, and requesting a human.

Live sessions

Website chat connects to the agent over a WebSocket and the reply streams in as it is written. Browser voice streams audio over its own connection: speech is transcribed live, the reply is spoken back, and the visitor can interrupt. Telegram messages arrive through the bot's webhook.

Durable Objects for live state

Each live conversation runs in a Cloudflare Durable Object that holds the session, buffers turns and carries handoff between the agent and your team. When the session ends, or goes quiet, the full transcript is saved to your organisation's database and the post-conversation review runs.

Per-organisation data boundary

Knowledge, conversations, datastore records and agent settings live in your organisation's own database. Secrets such as provider keys and channel tokens are encrypted before they are stored.

Need help implementing? Check our FAQ Hub Start building
Free plan · paid plans free for 7 days

Build your first customer agent.

No credit card. Questions? Write to support@embage.com.