# the-school-of-ai/arcturus architecture

> Architecture diagram of the GitHub repository the-school-of-ai/arcturus, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-05-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/the-school-of-ai/arcturus
- Repository: https://github.com/the-school-of-ai/arcturus

## Overview

1. This is a monorepo for a local-first AI desktop platform. The main product is a desktop shell built with Electron + React/Vite (`platform-frontend/`) talking to a Python backend (`api.py`, `routers/`, `core/`). The repo also contains supporting services for mobile, voice, channel bridges, SDKs, and a public gateway API.

2. The primary user-facing boundary is the desktop client. `platform-frontend/` owns the UX for Explorer, Forge, Apps, Runs, Graph, RAG, Echo, Scheduler, Admin/Watchtower, IDE, and Swarm. It renders the product surfaces and calls backend APIs, while some features also use Electron-specific bridges for local OS capabilities.

3. The backend application is organized around FastAPI route modules in `routers/`. Each router corresponds to a major feature area: chat, agents, canvas, studio, apps, graph, rag, voice, marketplace, sync, metrics, settings, admin, tests, and more. The routers are thin HTTP/SSE boundaries over the core services.

4. `core/` is the orchestration and service layer. It contains the agent loop, registry, model selection, sandbox execution, prompt/tool schemas, query optimization, reasoning, persistence, profile loading, event bus, metrics aggregation, and preview generation. This is where most cross-cutting behavior lives and where route handlers delegate work.

5. Memory is a major subsystem with its own internal architecture. `memory/` handles episodic memory, entity extraction, fact normalization, knowledge graph storage, retrieval, sync/merge policy, user identity, and backend adapters for vector stores and graph stores. The product’s “RemMe” and memory-aware planning features flow through this layer.

6. Retrieval and grounding are split from general memory. `content/` provides page generation and section agents for structured research/content assembly, while `core/gateway_services/search_service.py` and related adapters connect the app to search, embeddings, and external oracle-like services. RAG is therefore not just a UI feature; it is a dedicated data pipeline with document ingestion, indexing, and source-backed answering.

7. Forge and Studio form the structured artifact pipeline. `core/studio/` contains generators, validators, exporters, editors, and revision logic for documents, slides, and sheets. `routers/studio.py` and the frontend Forge workspace expose this as a preview/edit/export flow, turning model output into finished artifacts such as HTML/PDF/DOCX/XLSX decks and reports.

8. Apps and canvas provide a second materialization path: generated interactive UIs. `apps/` stores many generated app definitions as `ui.json`, while `core/ui_generator.py`, `core/schemas/`, `core/previews.py`, and canvas-related modules create and validate UI schemas, runtime sandboxes, and websocket-driven previews. This is the “build tools inside the product” boundary.

9. Voice is a distinct runtime path. `voice/` contains wake-word detection, STT, TTS, intent gating, dictation, and orchestration, with bridges to local audio models and services. The voice flow routes spoken input into the same agent/backend system rather than bypassing it, so Echo is a front door into the same orchestration layer.

10. External communication channels are abstracted under `channels/` and bridge projects like `signal_bridge/` and `whatsapp_bridge/`. These connect the platform to Slack, Teams, Telegram, WhatsApp, Discord, Matrix, Google Chat, iMessage, Signal, and web chat, feeding messages into the agent/message bus path and returning responses through channel-specific adapters.

11. Marketplace and skills add extensibility and supply-chain controls. `marketplace/` handles skill packaging, installation, registry, trust, signing, moderation, integrity, and sandboxing, while `core/skills/library/` contains the built-in skill catalog used by agents. The Bazaar flow is intentionally gated so skills can be published, inspected, and installed with policy checks.

12. Observability and governance are first-class. `ops/` implements tracing, health checks, alerts, throttling, audit logs, semantic cache, and cost accounting. `gateway_api/` exposes a separate public integration surface with auth, idempotency, rate limiting, usage governance, webhooks, connectors, and SDKs, making it the external API boundary distinct from the local desktop backend.

13. Persistence is mostly local and file-backed, with additional services where needed. The repo includes `storage/`, `data/`, `memory/session_summaries_index/`, `data/conversation_history/`, and Alembic migrations for relational state. Docker compose files and config under `config/` indicate optional local infrastructure such as Qdrant and MongoDB.

14. The repository is heavily test-driven and release-gated. `tests/` spans unit, integration, API, acceptance, automation, stress, SDK, and manual flows; GitHub Actions and `ci/` enforce project gates. That means the architecture is not only feature-based but also operationally segmented by verifiable boundaries: product flows, public API contracts, memory sync, marketplace security, and observability.

Main entry points: [`core/loop.py`](https://github.com/the-school-of-ai/arcturus/blob/master/core/loop.py) (Core loop), [`routers`](https://github.com/the-school-of-ai/arcturus/tree/master/routers) (HTTP routers), [`core`](https://github.com/the-school-of-ai/arcturus/tree/master/core) (Core services), [`tests`](https://github.com/the-school-of-ai/arcturus/tree/master/tests) (Verification)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop platform"]
  node_frontend_shell["Desktop shell<br/>Electron + React UI"]
  node_electron_bridge["Electron bridge<br/>OS bridge"]
  node_frontend_features["Feature surfaces<br/>Product modules"]
end

subgraph group_backend["Backend core"]
  node_api_entry["API app<br/>FastAPI entrypoint<br/>[api.py]"]
  node_routers["HTTP routers<br/>Feature routes"]
  node_core_loop["Core loop<br/>Agent orchestration<br/>[loop.py]"]
  node_core_services["Core services<br/>Shared services"]
  node_canvas_runtime["Canvas runtime<br/>UI schema runtime"]
  node_voice_runtime["Voice runtime<br/>Speech orchestration"]
end

subgraph group_data["Knowledge systems"]
  node_studio_pipeline["Studio pipeline<br/>Artifact generation"]
  node_apps_catalog["Apps catalog<br/>Generated UIs"]
  node_memory_stack[("Memory stack<br/>Episodic + graph memory")]
  node_remme_layer[("RemMe layer<br/>Identity memory")]
  node_rag_pipeline["RAG pipeline<br/>Retrieval pipeline"]
end

subgraph group_ext["External surfaces"]
  node_channels_layer["Channels<br/>Message adapters"]
  node_mobile_client["Mobile client<br/>Expo app"]
  node_gateway_api["Public gateway<br/>External API"]
end

subgraph group_ops["Ops and governance"]
  node_marketplace["Bazaar<br/>Skills marketplace"]
  node_ops_layer["Ops layer<br/>Observability + safety"]
  node_tests["Verification<br/>Test suites"]
end

node_frontend_shell -->|"uses"| node_electron_bridge
node_frontend_shell -->|"renders"| node_frontend_features
node_frontend_features -->|"calls"| node_routers
node_api_entry -->|"mounts"| node_routers
node_routers -->|"delegates"| node_core_loop
node_routers -->|"delegates"| node_core_services
node_core_loop -->|"loads skills"| node_marketplace
node_core_loop -->|"reads/writes"| node_memory_stack
node_core_loop -->|"uses"| node_remme_layer
node_core_services -->|"orchestrates"| node_studio_pipeline
node_core_services -->|"materializes"| node_canvas_runtime
node_core_services -->|"grounds"| node_rag_pipeline
node_rag_pipeline -->|"retrieves"| node_memory_stack
node_voice_runtime -->|"routes to"| node_core_loop
node_channels_layer -->|"feeds"| node_core_loop
node_mobile_client -->|"syncs with"| node_routers
node_gateway_api -->|"adapts"| node_core_services
node_gateway_api -->|"enforces"| node_ops_layer
node_marketplace -->|"governed by"| node_ops_layer
node_tests -.->|"covers"| node_frontend_shell
node_tests -.->|"covers"| node_routers
node_tests -.->|"covers"| node_memory_stack
node_tests -.->|"covers"| node_gateway_api

click node_frontend_shell "https://github.com/the-school-of-ai/arcturus/tree/master/platform-frontend"
click node_electron_bridge "https://github.com/the-school-of-ai/arcturus/tree/master/platform-frontend/electron"
click node_frontend_features "https://github.com/the-school-of-ai/arcturus/tree/master/platform-frontend/src/features"
click node_api_entry "https://github.com/the-school-of-ai/arcturus/blob/master/api.py"
click node_routers "https://github.com/the-school-of-ai/arcturus/tree/master/routers"
click node_core_loop "https://github.com/the-school-of-ai/arcturus/blob/master/core/loop.py"
click node_core_services "https://github.com/the-school-of-ai/arcturus/tree/master/core"
click node_studio_pipeline "https://github.com/the-school-of-ai/arcturus/tree/master/core/studio"
click node_canvas_runtime "https://github.com/the-school-of-ai/arcturus/tree/master/canvas"
click node_apps_catalog "https://github.com/the-school-of-ai/arcturus/tree/master/apps"
click node_memory_stack "https://github.com/the-school-of-ai/arcturus/tree/master/memory"
click node_remme_layer "https://github.com/the-school-of-ai/arcturus/tree/master/remme"
click node_rag_pipeline "https://github.com/the-school-of-ai/arcturus/tree/master/content"
click node_voice_runtime "https://github.com/the-school-of-ai/arcturus/tree/master/voice"
click node_channels_layer "https://github.com/the-school-of-ai/arcturus/tree/master/channels"
click node_mobile_client "https://github.com/the-school-of-ai/arcturus/tree/master/mobile"
click node_gateway_api "https://github.com/the-school-of-ai/arcturus/tree/master/gateway_api"
click node_marketplace "https://github.com/the-school-of-ai/arcturus/tree/master/marketplace"
click node_ops_layer "https://github.com/the-school-of-ai/arcturus/tree/master/ops"
click node_tests "https://github.com/the-school-of-ai/arcturus/tree/master/tests"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_frontend_shell,node_electron_bridge,node_frontend_features toneBlue
class node_api_entry,node_routers,node_core_loop,node_core_services,node_canvas_runtime,node_voice_runtime toneAmber
class node_studio_pipeline,node_apps_catalog,node_memory_stack,node_remme_layer,node_rag_pipeline toneMint
class node_channels_layer,node_mobile_client,node_gateway_api toneRose
class node_marketplace,node_ops_layer,node_tests toneIndigo
```

## Components

### Desktop platform

Electron + React user-facing product shell and local OS bridges.

- [Desktop shell](https://github.com/the-school-of-ai/arcturus/tree/master/platform-frontend): Electron + React UI · Main local-first desktop client and feature workspace boundary. · `platform-frontend`
- [Electron bridge](https://github.com/the-school-of-ai/arcturus/tree/master/platform-frontend/electron): OS bridge · Preload/main-process bridge for local capabilities and process integration. · `platform-frontend/electron`
- [Feature surfaces](https://github.com/the-school-of-ai/arcturus/tree/master/platform-frontend/src/features): Product modules · Explorer, Forge, Apps, Runs, Graph, RAG, Echo, Scheduler, Admin, IDE, Swarm. · `platform-frontend/src/features`

### Backend core

FastAPI app, orchestration, and feature routers.

- [API app](https://github.com/the-school-of-ai/arcturus/blob/master/api.py): FastAPI entrypoint · Top-level Python application entrypoint wiring routes and shared services. · `api.py`
- [HTTP routers](https://github.com/the-school-of-ai/arcturus/tree/master/routers): Feature routes · Thin FastAPI boundaries for chat, agents, canvas, studio, apps, graph, rag, voice, admin, and more. · `routers`
- [Core loop](https://github.com/the-school-of-ai/arcturus/blob/master/core/loop.py): Agent orchestration · Main agent execution loop, registry, model selection, reasoning, and tool coordination. · `core/loop.py`
- [Core services](https://github.com/the-school-of-ai/arcturus/tree/master/core): Shared services · Persistence, event bus, profiles, metrics, sandboxing, scheduling, query optimization, and previews. · `core`
- [Canvas runtime](https://github.com/the-school-of-ai/arcturus/tree/master/canvas): UI schema runtime · Schema validation, sandbox execution, websocket previews, and generated UI materialization. · `canvas`
- [Voice runtime](https://github.com/the-school-of-ai/arcturus/tree/master/voice): Speech orchestration · Wake-word, STT, intent gating, dictation, TTS, and spoken-agent routing. · `voice`

### Knowledge systems

Memory, RAG, content assembly, and persistence layers.

- [Studio pipeline](https://github.com/the-school-of-ai/arcturus/tree/master/core/studio): Artifact generation · Structured document, slide, and sheet generation, validation, editing, revision, and export. · `core/studio`
- [Apps catalog](https://github.com/the-school-of-ai/arcturus/tree/master/apps): Generated UIs · Stored app definitions and generated interactive UI artifacts. · `apps`
- [Memory stack](https://github.com/the-school-of-ai/arcturus/tree/master/memory): Episodic + graph memory · Episodic memory, entities, facts, normalization, sync/merge policy, and graph stores. · `memory`
- [RemMe layer](https://github.com/the-school-of-ai/arcturus/tree/master/remme): Identity memory · Soft identity, preferences, operating context, evidence logs, and belief updates. · `remme`
- [RAG pipeline](https://github.com/the-school-of-ai/arcturus/tree/master/content): Retrieval pipeline · Search, embeddings, oracle/search adapters, document ingestion, indexing, and grounded answering. · `content`

### External surfaces

Channels, mobile, public gateway API, and SDKs.

- [Channels](https://github.com/the-school-of-ai/arcturus/tree/master/channels): Message adapters · Slack, Teams, Telegram, Discord, Matrix, Google Chat, iMessage, Signal, WhatsApp, and web chat adapters. · `channels`
- [Mobile client](https://github.com/the-school-of-ai/arcturus/tree/master/mobile): Expo app · Cross-platform mobile experience that syncs with the same backend and voice flows. · `mobile`
- [Public gateway](https://github.com/the-school-of-ai/arcturus/tree/master/gateway_api): External API · Separate integration surface with auth, idempotency, rate limiting, usage governance, connectors, and webhooks. · `gateway_api`

### Ops and governance

Observability, safety, and marketplace controls.

- [Bazaar](https://github.com/the-school-of-ai/arcturus/tree/master/marketplace): Skills marketplace · Skill packaging, installation, trust, signing, integrity, moderation, sandboxing, and registry. · `marketplace`
- [Ops layer](https://github.com/the-school-of-ai/arcturus/tree/master/ops): Observability + safety · Tracing, health checks, alerts, audit logs, throttling, semantic cache, and cost accounting. · `ops`
- [Verification](https://github.com/the-school-of-ai/arcturus/tree/master/tests): Test suites · Unit, integration, acceptance, SDK, automation, stress, and manual coverage for major flows. · `tests`

## Connections

- Desktop shell → Electron bridge: uses · Desktop UI delegates local OS and process capabilities through Electron bridges.
- Desktop shell → Feature surfaces: renders · Feature modules implement the product surfaces shown in the desktop shell.
- Feature surfaces → HTTP routers: calls · UI surfaces drive backend actions through HTTP/SSE route handlers.
- API app → HTTP routers: mounts · Application entrypoint wires feature routers into the API.
- HTTP routers → Core loop: delegates · Execution-heavy requests flow from route handlers into orchestration.
- HTTP routers → Core services: delegates · Route modules rely on shared services for persistence, metrics, and previews.
- Core loop → Bazaar: loads skills · Agent execution can resolve and run marketplace or built-in skills.
- Core loop → Memory stack: reads/writes · Agent planning and response generation consult and update memory.
- Core loop → RemMe layer: uses · Identity and preference context shapes planning and behavior.
- Core services → Studio pipeline: orchestrates · Shared services invoke studio generation, revision, and export flows.
- Core services → Canvas runtime: materializes · Shared helpers create and preview generated UI schemas.
- Core services → RAG pipeline: grounds · Search and retrieval services feed source-backed answering and research.
- RAG pipeline → Memory stack: retrieves · RAG can draw from stored memories and indexed conversation history.
- Voice runtime → Core loop: routes to · Spoken commands enter the same agent/backend orchestration path.
- Channels → Core loop: feeds · External messages are normalized into the agent/message bus path.
- Mobile client → HTTP routers: syncs with · Mobile experience shares backend APIs and state synchronization.
- Public gateway → Core services: adapts · Public integration endpoints reuse core services for search, memory, studio, and usage.
- Public gateway → Ops layer: enforces · External API applies auth, rate limits, metering, and governance.
- Bazaar → Ops layer: governed by · Skill install and execution are constrained by trust and safety policy.
- Verification → Desktop shell: covers · Acceptance and UI tests exercise the desktop product surface.
- Verification → HTTP routers: covers · API and integration tests verify route contracts and flows.
- Verification → Memory stack: covers · Memory unit and integration tests validate extraction, sync, and retrieval.
- Verification → Public gateway: covers · Gateway contract tests verify the public integration boundary.
