Skip to content

Commit 37a600e

Browse files
committed
docs: narrative voice + accuracy pass on architecture + cognitive memory
ARCHITECTURE.md - Open with the why-this-shape framing rather than '26 modules' - Fix LLM provider count: 21 -> 11 direct provider implementations (plus OpenRouter fan-out). Real list: OpenAI, Anthropic, Gemini, Ollama, Groq, Mistral, Together, xAI, OpenRouter, Claude Code CLI, Gemini CLI. - Fix in-tree channel adapter count: 37 -> 12 messaging adapters (the rest ship as extension packs) - Fix built-in guardrail pack count: 5 -> 6, with brief gloss for each - Replace fictional MultiGMIAgencyExecutor with the real coordination classes (AgencyRegistry, AgencyMemoryManager, AgentCommunicationBus) - Replace 'Emergent vs Static' two-strategy table with the real AgencyStrategy enum (sequential, parallel, debate, review-loop, hierarchical, graph) - Trim the social-platform table to in-tree adapters; point at the curated extensions registry for the rest COGNITIVE_MEMORY.md - Rewrite opening with narrative framing and Lewis Carroll anchor quote ('It's a poor sort of memory that only works backwards') - Rewrite the cognitive-science foundations table to include real paper references with arXiv / classic-paper links: Ebbinghaus 1885, Yerkes-Dodson 1908, Brown & Kulik 1977, Atkinson-Shiffrin 1968, Baddeley & Hitch 1974, Tulving 1972, Bower 1981, Anderson 1983 (ACT-R), Hebb 1949, Ashton & Lee 2007 (HEXACO), Johnson et al. 1993 (source monitoring), Gao et al. 2022 (HyDE), Microsoft 2024 (GraphRAG), Park et al. 2023 (Generative Agents), Sumers et al. 2023 (CoALA) - Add LongMemEval paper citation (Wu et al., ICLR 2025) inline
1 parent 1059cf5 commit 37a600e

2 files changed

Lines changed: 92 additions & 63 deletions

File tree

docs/architecture/ARCHITECTURE.md

Lines changed: 48 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# System Architecture
22

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.
48

59
For specific subsystem deep-dives, see:
610
- [Sandbox & Security](./sandbox-security.md)
@@ -165,13 +169,14 @@ src/
165169
│ 4-tier memory · 8 core cognitive mechanisms + optional drift │
166170
│ 7 vector backends · HyDE · GraphRAG · hybrid retrieval │
167171
├─────────────────────────────────────────────────────────────┤
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 │
170175
│ + automatic fallback chains │
171176
├─────────────────────────────────────────────────────────────┤
172177
│ Perception │
173178
│ Vision (OCR) · Hearing (STT/VAD) · Speech (TTS) │
174-
37 channel adapters · telephony (Twilio/Telnyx/Plivo)
179+
12 messaging adapters · telephony (Twilio/Telnyx/Plivo) │
175180
└─────────────────────────────────────────────────────────────┘
176181
```
177182

@@ -472,13 +477,14 @@ Each guardrail service can also configure timeouts via `config.timeoutMs`. If a
472477

473478
### Built-in Guardrail Packs
474479

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/`:
476481

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
482488

483489
For details on writing custom guardrails, see [Creating Guardrails](../safety/CREATING_GUARDRAILS.md) and [Guardrails Usage](../safety/GUARDRAILS_USAGE.md).
484490

@@ -856,14 +862,22 @@ For configuration details, see [RAG Memory Configuration](../memory/RAG_MEMORY_C
856862

857863
### Agency System
858864

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 |
860875

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/`:
865877

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
867881

868882
### Workflow DAG
869883

@@ -1144,27 +1158,27 @@ For details, see [Voice Pipeline](../features/VOICE_PIPELINE.md) and [Speech Pro
11441158

11451159
## Channels
11461160

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`.
11481162

11491163
### Platform Table
11501164

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.
11681182

11691183
### Channel Routing
11701184

0 commit comments

Comments
 (0)