Skip to main content

Multi-agent routing

Carina routes inbound traffic to the correct workspace, profile, and agent instance based on channel bindings and workspace rules.

flowchart TD
Msg[Inbound message] --> Bind{Channel binding}
Bind --> WS[Workspace id]
WS --> Prof[Active profile]
Prof --> Route{Agent routing rules}
Route --> Main[Primary CarinaAgent]
Route --> Sub[Sub-agent / delegate]

Routing inputs

InputSource
Channel idTelegram chat id, Discord guild, web session cookie, etc.
Workspaceworkspaces/ config and hosted tenant mapping
Profileprofiles/manager.ts active profile per workspace
Tool policyScout + workspace toolsets

Hosted vs self-hosted

  • Self-hosted: bindings live in ~/.carina/ and gateway config.
  • Carina Cloud: workspace id comes from auth; core proxy may forward tool calls to a dedicated core instance.

Configuration

Set default workspace and channel maps in .env and workspace JSON under ~/.carina/workspaces/.

CLI: carina channels list, carina workspace commands (see CLI overview).

Source references

  • workspaces/agent-routing.ts
  • gateway/router.ts
  • gateway/channel-docking.ts (linked identities across channels)