This reference architecture shows how phone and web requests move between CYOO components.
| From | Direction | To |
|---|---|---|
| Phone PSTN / SIP | → | Phone center / Routing |
| Web Voice / Chat | → | Session management / Scheduling |
| Merchant console / Agent Desk | → | Control plane |
| Phone center / Routing | → | Session management / Scheduling |
| Agent / Business lines / Versions | → | Session management / Scheduling |
| Tool catalog / Knowledge / Customer memory | → | LLM routing / Workflow / Tool Executor |
| Tenant / RBAC | → | Agent / Business lines / Versions |
| Session management / Scheduling | → | Audio streams / Pipecat |
| Audio streams / Pipecat | → | LLM routing / Workflow / Tool Executor |
| Audio streams / Pipecat | ↔ | STT |
| LLM routing / Workflow / Tool Executor | ↔ | LLM |
| Audio streams / Pipecat | ↔ | TTS |
| Audio streams / Pipecat | → | Call Trace / Dispositions |
| Call Trace / Dispositions | → | Event bus / Triggers |
| Call Trace / Dispositions | → | Usage / Accounting / Analytics |
| Call Trace / Dispositions | → | Conversation testbed |
| Agent engineer / MCP | → | Agent / Business lines / Versions |
| Agent engineer / MCP | → | Agent evaluation |
| Agent evaluation | → | Versions / Releases / Canaries |
| Versions / Releases / Canaries | → | Agent / Business lines / Versions |
View Mermaid diagram source
flowchart TB
subgraph Interfaces[Business entry points]
Phone[Phone PSTN / SIP]
Web[Web Voice / Chat]
Portal[Merchant console / Agent Desk]
end
subgraph Control[Control plane]
Tenant[Tenant / RBAC]
Agent[Agent / Business lines / Versions]
Resources[Tool catalog / Knowledge / Customer memory]
PhoneCenter[Phone center / Routing]
end
subgraph Runtime[Real-time voice runtime]
Session[Session management / Scheduling]
Pipeline[Audio streams / Pipecat]
Execution[LLM routing / Workflow / Tool Executor]
end
subgraph Models[External model providers]
STT[STT]
LLM[LLM]
TTS[TTS]
end
subgraph Engineering[Quality engineering]
Testbed[Conversation testbed]
Evaluation[Agent evaluation]
Release[Versions / Releases / Canaries]
Engineer[Agent engineer / MCP]
end
subgraph Operations[Data operations]
Trace[Call Trace / Dispositions]
Event[Event bus / Triggers]
Billing[Usage / Accounting / Analytics]
end
Phone --> PhoneCenter
Web --> Session
Portal --> Control
PhoneCenter --> Session
Agent --> Session
Resources --> Execution
Tenant --> Agent
Session --> Pipeline
Pipeline --> Execution
Pipeline <--> STT
Execution <--> LLM
Pipeline <--> TTS
Pipeline --> Trace
Trace --> Event
Trace --> Billing
Trace --> Testbed
Engineer --> Agent
Engineer --> Evaluation
Evaluation --> Release
Release --> Agent
Business execution constraints
Caller → Gateway → Tenant/Phone Routing → Frozen Agent Version → Session → STT/LLM/TTS → Tool Authorization → Business Result → Response → Call Trace
- Isolate the performance requirements of real-time communications from database and event processing.
- Track AgentVersion, RuntimeVersion, ToolVersion and KnowledgeVersion independently.
- Verify customer identity and tenant authorization on trusted servers. Confirm business success through the authoritative API.
- Use durable queues and idempotent processing for background work outside the per-frame audio path.
Suggested logical project layout
cyoo/
├── apps/ # Website, merchant console, admin console, human agent desk
├── services/
│ ├── control-plane/ # Agents, business lines, tenants, versions, tools, knowledge
│ ├── communications/ # Phone center, SIP, Twilio, routing
│ ├── voice-runtime/ # Sessions, Pipecat, model adapters, interruption
│ ├── operations/ # Events, dispositions, analytics, billing
│ └── agent-engineering/ # Testbed, evaluations, MCP, releases
├── packages/ # Event, tool and agent configuration contracts
├── templates/ # Restaurant, clinic and other industry business-line templates
├── infrastructure/ # Terraform, Docker, AWS
└── docs/ # ADRs, operations, permissions, APIs
FIIDA