|
1 | 1 | # System Architecture |
2 | 2 |
|
3 | | -AgentOS is organized into 26 domain-specific modules. This page covers the high-level layout, request lifecycle, and how the major subsystems connect. |
| 3 | +The shape of an agent runtime tells you what its authors thought the hard problems were. Most agent SDKs are organized around a turn loop: take a prompt, call a model, parse for tool calls, execute, loop. The hard problems they expect you to have are about retries, structured output, and connector configuration. Their internal modules are named accordingly. |
| 4 | + |
| 5 | +AgentOS is organized differently. The hard problems it expects you to have are about state — about what an agent knows across hours and conversations, about which version of itself is talking to which user, about whether a tool call should run, about what the agent should remember tomorrow that it learned today. The 26 top-level modules below are mostly subsystems for managing that state. The turn loop is in there, but it's a small piece in the middle. |
| 6 | + |
| 7 | +This page is the map. For the *what* of any subsystem — what each piece is, who owns its lifecycle, where the source lives — read on. For deep-dives into individual concerns, jump out from the table of contents below. |
4 | 8 |
|
5 | 9 | For specific subsystem deep-dives, see: |
6 | 10 | - [Sandbox & Security](./sandbox-security.md) |
@@ -165,13 +169,14 @@ src/ |
165 | 169 | │ 4-tier memory · 8 core cognitive mechanisms + optional drift │ |
166 | 170 | │ 7 vector backends · HyDE · GraphRAG · hybrid retrieval │ |
167 | 171 | ├─────────────────────────────────────────────────────────────┤ |
168 | | -│ LLM Providers (21) │ |
169 | | -│ OpenAI · Anthropic · Gemini · Ollama · Groq · OpenRouter │ |
| 172 | +│ LLM Providers (11 direct + OpenRouter fan-out) │ |
| 173 | +│ OpenAI · Anthropic · Gemini · Ollama · Groq · Mistral │ |
| 174 | +│ Together · xAI · OpenRouter · Claude Code CLI · Gemini CLI │ |
170 | 175 | │ + automatic fallback chains │ |
171 | 176 | ├─────────────────────────────────────────────────────────────┤ |
172 | 177 | │ Perception │ |
173 | 178 | │ Vision (OCR) · Hearing (STT/VAD) · Speech (TTS) │ |
174 | | -│ 37 channel adapters · telephony (Twilio/Telnyx/Plivo) │ |
| 179 | +│ 12 messaging adapters · telephony (Twilio/Telnyx/Plivo) │ |
175 | 180 | └─────────────────────────────────────────────────────────────┘ |
176 | 181 | ``` |
177 | 182 |
|
@@ -472,13 +477,14 @@ Each guardrail service can also configure timeouts via `config.timeoutMs`. If a |
472 | 477 |
|
473 | 478 | ### Built-in Guardrail Packs |
474 | 479 |
|
475 | | -Five built-in packs ship directly from `@framers/agentos/extensions/packs/*`: |
| 480 | +Six built-in packs ship from `packages/agentos-extensions/registry/curated/safety/`: |
476 | 481 |
|
477 | | -- `pii-redaction` |
478 | | -- `ml-classifiers` |
479 | | -- `topicality` |
480 | | -- `code-safety` |
481 | | -- `grounding-guard` |
| 482 | +- `pii-redaction` — sanitizer; redacts personally identifiable information before tokens leave the runtime |
| 483 | +- `ml-classifiers` — toxicity / hate-speech / harm classification via on-device ONNX models |
| 484 | +- `topicality` — LLM-as-judge classifier that rejects off-topic / out-of-scope prompts |
| 485 | +- `code-safety` — static + heuristic detection of dangerous code patterns in agent-emitted snippets |
| 486 | +- `grounding-guard` — verifies output claims against retrieved RAG sources (citation faithfulness) |
| 487 | +- `content-policy-rewriter` — sanitizer; rewrites policy-violating output in-place rather than blocking |
482 | 488 |
|
483 | 489 | For details on writing custom guardrails, see [Creating Guardrails](../safety/CREATING_GUARDRAILS.md) and [Guardrails Usage](../safety/GUARDRAILS_USAGE.md). |
484 | 490 |
|
@@ -856,14 +862,22 @@ For configuration details, see [RAG Memory Configuration](../memory/RAG_MEMORY_C |
856 | 862 |
|
857 | 863 | ### Agency System |
858 | 864 |
|
859 | | -The agency system enables multi-agent coordination through two strategies: |
| 865 | +The agency system enables multi-agent coordination across six strategies (defined in `AgencyStrategy` in `src/api/types.ts`): |
| 866 | + |
| 867 | +| Strategy | Behavior | |
| 868 | +|---|---| |
| 869 | +| `sequential` | Each agent runs after the previous one completes; output of one feeds the next | |
| 870 | +| `parallel` | All agents run concurrently against the same input; results are aggregated | |
| 871 | +| `debate` | Agents critique and refine each other's outputs across multiple rounds | |
| 872 | +| `review-loop` | One agent produces, another reviews; loop continues until reviewer accepts or `maxRounds` | |
| 873 | +| `hierarchical` | A coordinator agent delegates to sub-agents and synthesizes their results | |
| 874 | +| `graph` | Explicit DAG via `dependsOn` on each sub-agent; runs roots first, then dependents | |
860 | 875 |
|
861 | | -| Strategy | Description | Coordinator | Use Case | |
862 | | -|----------|-------------|-------------|----------| |
863 | | -| **Emergent** | LLM-backed planner decomposes goals, assigns roles, spawns as needed | `EmergentAgencyCoordinator` | Open-ended tasks, creative collaboration | |
864 | | -| **Static** | Predefined roles and tasks execute in topological order | `StaticAgencyCoordinator` | Deterministic pipelines, compliance workflows | |
| 876 | +Coordination state lives in three classes under `src/agents/agency/`: |
865 | 877 |
|
866 | | -`MultiGMIAgencyExecutor` orchestrates parallel GMI instance spawning (one per role), handles retry logic with exponential backoff, and aggregates costs across seats. |
| 878 | +- [`AgencyRegistry`](https://github.com/framersai/agentos/blob/master/src/agents/agency/AgencyRegistry.ts) — tracks active agencies and the GMIs they contain |
| 879 | +- [`AgencyMemoryManager`](https://github.com/framersai/agentos/blob/master/src/agents/agency/AgencyMemoryManager.ts) — shared memory across the agency's GMIs (separate from each GMI's private cognitive memory) |
| 880 | +- [`AgentCommunicationBus`](https://github.com/framersai/agentos/blob/master/src/agents/agency/AgentCommunicationBus.ts) — the message channel GMIs use to coordinate |
867 | 881 |
|
868 | 882 | ### Workflow DAG |
869 | 883 |
|
@@ -1144,27 +1158,27 @@ For details, see [Voice Pipeline](../features/VOICE_PIPELINE.md) and [Speech Pro |
1144 | 1158 |
|
1145 | 1159 | ## Channels |
1146 | 1160 |
|
1147 | | -37 channel adapters provide platform connectivity. Each adapter implements the `IChannelAdapter` interface and is typically packaged as an `ExtensionPack`. |
| 1161 | +Twelve messaging adapters live in `src/channels/adapters/`, plus four telephony providers in `src/channels/telephony/providers/` (Twilio, Telnyx, Plivo, plus a mock for tests). Additional social-platform adapters ship as separate extension packs in [`packages/agentos-extensions/registry/curated/channels/`](https://github.com/framersai/agentos-extensions/tree/master/registry/curated/channels). Each adapter implements the `IChannelAdapter` interface and is loaded as an `ExtensionPack`. |
1148 | 1162 |
|
1149 | 1163 | ### Platform Table |
1150 | 1164 |
|
1151 | | -| Platform | Adapter | Tools | Category | |
1152 | | -|----------|---------|-------|----------| |
1153 | | -| Discord | `DiscordChannelAdapter` | 8 slash commands | Messaging | |
1154 | | -| Slack | `SlackChannelAdapter` | 8 | Messaging | |
1155 | | -| Telegram | `TelegramChannelAdapter` | 8 | Messaging | |
1156 | | -| WhatsApp | `WhatsAppChannelAdapter` | 4 | Messaging | |
1157 | | -| Twitter/X | `TwitterChannelAdapter` | 6 | Social | |
1158 | | -| LinkedIn | LinkedIn adapter | 8 | Social | |
1159 | | -| Facebook | Facebook adapter | 8 | Social | |
1160 | | -| Threads | Threads adapter | 6 | Social | |
1161 | | -| Bluesky | Bluesky adapter | 8 | Social | |
1162 | | -| Mastodon | Mastodon adapter | 8 | Social | |
1163 | | -| WebChat | `WebChatChannelAdapter` | - | Web | |
1164 | | -| Teams | `TeamsChannelAdapter` | - | Enterprise | |
1165 | | -| Google Chat | `GoogleChatChannelAdapter` | - | Enterprise | |
1166 | | - |
1167 | | -Additional adapters: Signal, IRC, Reddit, Instagram, Pinterest, TikTok, YouTube, Farcaster, Lemmy, Google Business, Dev.to, Hashnode, Medium, WordPress, and telephony providers (Twilio, Telnyx, Plivo, Vonage). |
| 1165 | +In-tree messaging adapters (`src/channels/adapters/`): |
| 1166 | + |
| 1167 | +| Platform | Adapter | Category | |
| 1168 | +|----------|---------|----------| |
| 1169 | +| Discord | `DiscordChannelAdapter` | Messaging | |
| 1170 | +| Slack | `SlackChannelAdapter` | Messaging | |
| 1171 | +| Telegram | `TelegramChannelAdapter` | Messaging | |
| 1172 | +| WhatsApp | `WhatsAppChannelAdapter` | Messaging | |
| 1173 | +| Twitter/X | `TwitterChannelAdapter` | Social | |
| 1174 | +| Reddit | `RedditChannelAdapter` | Social | |
| 1175 | +| Signal | `SignalChannelAdapter` | Messaging | |
| 1176 | +| IRC | `IRCChannelAdapter` | Messaging | |
| 1177 | +| WebChat | `WebChatChannelAdapter` | Web | |
| 1178 | +| Teams | `TeamsChannelAdapter` | Enterprise | |
| 1179 | +| Google Chat | `GoogleChatChannelAdapter` | Enterprise | |
| 1180 | + |
| 1181 | +Telephony (`src/channels/telephony/providers/`): Twilio, Telnyx, Plivo. Additional social-platform adapters (LinkedIn, Bluesky, Mastodon, Threads, etc.) ship as extension packs in [`packages/agentos-extensions/registry/curated/channels/`](https://github.com/framersai/agentos-extensions/tree/master/registry/curated/channels) rather than in-tree. |
1168 | 1182 |
|
1169 | 1183 | ### Channel Routing |
1170 | 1184 |
|
|
0 commit comments