# ai-operatingsystem293/aios architecture

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

- Interactive diagram: https://gitdiagram.com/ai-operatingsystem293/aios
- Repository: https://github.com/ai-operatingsystem293/aios

## Overview

AIOS is a Rust-based operating system for coordinating independent AI agents. Its documented user workflow runs from an interactive command through the Master Agent, planning and task-graph scheduling, concurrent workers, capability-based agent selection, then recovery, verification, aggregation and a response. The graph also includes plugin loading, the external SDK, agent-generation tools and kernel event/service infrastructure. Workflow links follow the README; source excerpts confirm selected registry, plugin, planning, recovery and verification behavior. Several runtime stages were not excerpted, so their links rely on README documentation.

Main entry points: [`src/kernel/kernel.rs`](https://github.com/ai-operatingsystem293/aios/blob/main/src/kernel/kernel.rs) (AIOS Kernel), [`src/runtime/pool.rs`](https://github.com/ai-operatingsystem293/aios/blob/main/src/runtime/pool.rs) (Worker Pool), [`src/master/master.rs`](https://github.com/ai-operatingsystem293/aios/blob/main/src/master/master.rs) (Master Agent), [`src/kernel/registry.rs`](https://github.com/ai-operatingsystem293/aios/blob/main/src/kernel/registry.rs) (Agent Registry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User Interface"]
  node_cli["Interactive CLI<br/>[shell.rs]"]
  node_dispatcher["Command Dispatcher<br/>[dispatcher.rs]"]
end

subgraph group_orchestration["Orchestration"]
  node_master["Master Agent<br/>[master.rs]"]
  node_planner["Goal Planning"]
  node_taskgraph["Task Graph<br/>[graph.rs]"]
  node_scheduler["Task Scheduler<br/>[scheduler.rs]"]
  node_recovery["Recovery Engine<br/>[engine.rs]"]
  node_verification["Verification Engine<br/>[engine.rs]"]
  node_aggregator["Result Aggregator<br/>[aggregator.rs]"]
end

subgraph group_execution["Agent Execution"]
  node_workers["Worker Pool<br/>[pool.rs]"]
  node_registry["Agent Registry<br/>[registry.rs]"]
  node_capabilities["Capability Providers<br/>[provider.rs]"]
  node_agents["Built-in Agents<br/>[math.rs]"]
end

subgraph group_extensions["Agent Extensions"]
  node_plugins["Dynamic Plugin Manager<br/>[manager.rs]"]
  node_sdk["External Agent SDK<br/>[agent.rs]"]
  node_devtools["Agent Generator<br/>[generator.rs]"]
end

subgraph group_kernel["Kernel Services"]
  node_kernel["AIOS Kernel<br/>[kernel.rs]"]
  node_eventbus["Event Bus<br/>[bus.rs]"]
  node_memory["Memory Service<br/>[memory.rs]"]
  node_services["Service Manager<br/>[manager.rs]"]
end

node_user(("User"))

node_user -->|"enters commands"| node_cli
node_cli -->|"forwards commands"| node_dispatcher
node_dispatcher -->|"dispatches requests"| node_kernel
node_kernel -->|"executes goals"| node_master
node_master -->|"analyzes goals"| node_planner
node_planner -->|"builds dependencies"| node_taskgraph
node_taskgraph -->|"supplies ready tasks"| node_scheduler
node_scheduler -->|"dispatches tasks"| node_workers
node_workers -->|"finds agents"| node_registry
node_registry -->|"registers providers"| node_capabilities
node_registry -->|"registers and executes"| node_agents
node_capabilities -->|"informs plan selection"| node_planner
node_workers -->|"recovers failures"| node_recovery
node_workers -->|"submits outputs"| node_verification
node_verification -->|"validates results"| node_aggregator
node_aggregator -->|"returns combined results"| node_master
node_master -->|"returns response"| node_cli
node_kernel -->|"loads dynamic agents"| node_plugins
node_plugins -->|"registers loaded agents"| node_registry
node_sdk -.->|"defines agent interface"| node_agents
node_devtools -.->|"generates agent templates"| node_sdk
node_kernel -->|"initializes event listeners"| node_eventbus
node_kernel -->|"provides memory service"| node_memory
node_kernel -->|"registers services"| node_services

click node_cli "https://github.com/ai-operatingsystem293/aios/blob/main/src/cli/shell.rs"
click node_dispatcher "https://github.com/ai-operatingsystem293/aios/blob/main/src/command/dispatcher.rs"
click node_kernel "https://github.com/ai-operatingsystem293/aios/blob/main/src/kernel/kernel.rs"
click node_master "https://github.com/ai-operatingsystem293/aios/blob/main/src/master/master.rs"
click node_planner "https://github.com/ai-operatingsystem293/aios/tree/main/src/planner"
click node_taskgraph "https://github.com/ai-operatingsystem293/aios/blob/main/src/task/graph.rs"
click node_scheduler "https://github.com/ai-operatingsystem293/aios/blob/main/src/task/scheduler.rs"
click node_workers "https://github.com/ai-operatingsystem293/aios/blob/main/src/runtime/pool.rs"
click node_registry "https://github.com/ai-operatingsystem293/aios/blob/main/src/kernel/registry.rs"
click node_capabilities "https://github.com/ai-operatingsystem293/aios/blob/main/src/capability/provider.rs"
click node_agents "https://github.com/ai-operatingsystem293/aios/blob/main/src/agents/math.rs"
click node_recovery "https://github.com/ai-operatingsystem293/aios/blob/main/src/recovery/engine.rs"
click node_verification "https://github.com/ai-operatingsystem293/aios/blob/main/src/verification/engine.rs"
click node_aggregator "https://github.com/ai-operatingsystem293/aios/blob/main/src/aggregator/aggregator.rs"
click node_plugins "https://github.com/ai-operatingsystem293/aios/blob/main/src/plugin/manager.rs"
click node_sdk "https://github.com/ai-operatingsystem293/aios/blob/main/sdk/src/agent.rs"
click node_devtools "https://github.com/ai-operatingsystem293/aios/blob/main/src/devtools/generator.rs"
click node_eventbus "https://github.com/ai-operatingsystem293/aios/blob/main/src/event/bus.rs"
click node_memory "https://github.com/ai-operatingsystem293/aios/blob/main/src/memory/memory.rs"
click node_services "https://github.com/ai-operatingsystem293/aios/blob/main/src/service/manager.rs"

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_cli,node_dispatcher,node_user toneBlue
class node_master,node_planner,node_taskgraph,node_scheduler,node_recovery,node_verification,node_aggregator toneAmber
class node_workers,node_registry,node_capabilities,node_agents toneMint
class node_plugins,node_sdk,node_devtools toneRose
class node_kernel,node_eventbus,node_memory,node_services toneIndigo
```

## Components

### User Interface

- [Interactive CLI](https://github.com/ai-operatingsystem293/aios/blob/main/src/cli/shell.rs): `src/cli/shell.rs`
- [Command Dispatcher](https://github.com/ai-operatingsystem293/aios/blob/main/src/command/dispatcher.rs): `src/command/dispatcher.rs`

### Orchestration

- [Master Agent](https://github.com/ai-operatingsystem293/aios/blob/main/src/master/master.rs): `src/master/master.rs`
- [Goal Planning](https://github.com/ai-operatingsystem293/aios/tree/main/src/planner): `src/planner`
- [Task Graph](https://github.com/ai-operatingsystem293/aios/blob/main/src/task/graph.rs): `src/task/graph.rs`
- [Task Scheduler](https://github.com/ai-operatingsystem293/aios/blob/main/src/task/scheduler.rs): `src/task/scheduler.rs`
- [Recovery Engine](https://github.com/ai-operatingsystem293/aios/blob/main/src/recovery/engine.rs): `src/recovery/engine.rs`
- [Verification Engine](https://github.com/ai-operatingsystem293/aios/blob/main/src/verification/engine.rs): `src/verification/engine.rs`
- [Result Aggregator](https://github.com/ai-operatingsystem293/aios/blob/main/src/aggregator/aggregator.rs): `src/aggregator/aggregator.rs`

### Agent Execution

- [Worker Pool](https://github.com/ai-operatingsystem293/aios/blob/main/src/runtime/pool.rs): `src/runtime/pool.rs`
- [Agent Registry](https://github.com/ai-operatingsystem293/aios/blob/main/src/kernel/registry.rs): `src/kernel/registry.rs`
- [Capability Providers](https://github.com/ai-operatingsystem293/aios/blob/main/src/capability/provider.rs): `src/capability/provider.rs`
- [Built-in Agents](https://github.com/ai-operatingsystem293/aios/blob/main/src/agents/math.rs): `src/agents/math.rs`

### Agent Extensions

- [Dynamic Plugin Manager](https://github.com/ai-operatingsystem293/aios/blob/main/src/plugin/manager.rs): `src/plugin/manager.rs`
- [External Agent SDK](https://github.com/ai-operatingsystem293/aios/blob/main/sdk/src/agent.rs): `sdk/src/agent.rs`
- [Agent Generator](https://github.com/ai-operatingsystem293/aios/blob/main/src/devtools/generator.rs): `src/devtools/generator.rs`

### Kernel Services

- [AIOS Kernel](https://github.com/ai-operatingsystem293/aios/blob/main/src/kernel/kernel.rs): `src/kernel/kernel.rs`
- [Event Bus](https://github.com/ai-operatingsystem293/aios/blob/main/src/event/bus.rs): `src/event/bus.rs`
- [Memory Service](https://github.com/ai-operatingsystem293/aios/blob/main/src/memory/memory.rs): `src/memory/memory.rs`
- [Service Manager](https://github.com/ai-operatingsystem293/aios/blob/main/src/service/manager.rs): `src/service/manager.rs`

### Other components

- **User**

## Connections

- User → Interactive CLI: enters commands (evidence: `README.md`)
- Interactive CLI → Command Dispatcher: forwards commands (evidence: `README.md`)
- Command Dispatcher → AIOS Kernel: dispatches requests (evidence: `src/command/dispatcher.rs`)
- AIOS Kernel → Master Agent: executes goals (evidence: `src/kernel/kernel.rs`)
- Master Agent → Goal Planning: analyzes goals (evidence: `README.md`)
- Goal Planning → Task Graph: builds dependencies (evidence: `README.md`)
- Task Graph → Task Scheduler: supplies ready tasks (evidence: `README.md`)
- Task Scheduler → Worker Pool: dispatches tasks (evidence: `README.md`)
- Worker Pool → Agent Registry: finds agents (evidence: `README.md`)
- Agent Registry → Capability Providers: registers providers (evidence: `src/kernel/registry.rs`)
- Agent Registry → Built-in Agents: registers and executes (evidence: `src/kernel/registry.rs`)
- Capability Providers → Goal Planning: informs plan selection (evidence: `src/planner/engine.rs`)
- Worker Pool → Recovery Engine: recovers failures (evidence: `README.md`)
- Worker Pool → Verification Engine: submits outputs (evidence: `README.md`)
- Verification Engine → Result Aggregator: validates results (evidence: `README.md`)
- Result Aggregator → Master Agent: returns combined results (evidence: `README.md`)
- Master Agent → Interactive CLI: returns response (evidence: `README.md`)
- AIOS Kernel → Dynamic Plugin Manager: loads dynamic agents (evidence: `src/kernel/kernel.rs`)
- Dynamic Plugin Manager → Agent Registry: registers loaded agents (evidence: `src/plugin/manager.rs`)
- External Agent SDK → Built-in Agents: defines agent interface (evidence: `README.md`)
- Agent Generator → External Agent SDK: generates agent templates (evidence: `README.md`)
- AIOS Kernel → Event Bus: initializes event listeners (evidence: `src/kernel/kernel.rs`)
- AIOS Kernel → Memory Service: provides memory service (evidence: `src/kernel/kernel.rs`)
- AIOS Kernel → Service Manager: registers services (evidence: `src/kernel/kernel.rs`)
