# agiresearch/aios architecture

> Architecture diagram of the GitHub repository agiresearch/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/agiresearch/aios
- Repository: https://github.com/agiresearch/aios

## Overview

AIOS is an agent operating-system kernel: an agent submits work, the kernel represents it as syscalls, schedules and dispatches those requests to resource managers, and returns results. The principal resource stages are LLM inference, memory, storage, and tools; context injection and configuration support those stages. The README also describes a computer-use extension with a VM controller and MCP server. Several links reflect documented architecture or SOURCE INDEX references; unsampled implementations are not asserted in detail.

Main entry points: [`aios/scheduler/fifo_scheduler.py`](https://github.com/agiresearch/aios/blob/main/aios/scheduler/fifo_scheduler.py) (Request scheduler), [`aios/memory/manager.py`](https://github.com/agiresearch/aios/blob/main/aios/memory/manager.py) (Memory manager), [`aios/llm_core/adapter.py`](https://github.com/agiresearch/aios/blob/main/aios/llm_core/adapter.py) (LLM adapter), [`aios/hooks/modules`](https://github.com/agiresearch/aios/tree/main/aios/hooks/modules) (Resource hooks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_kernel["Kernel orchestration"]
  node_syscall["Syscall executor<br/>[syscall.py]"]
  node_scheduler["Request scheduler<br/>[fifo_scheduler.py]"]
  node_hooks["Resource hooks"]
  node_config["Configuration<br/>[config_manager.py]"]
  node_terminal["Terminal interface<br/>[intent_router.py]"]
end

subgraph group_llm["LLM and context"]
  node_context["Context manager<br/>[simple_context.py]"]
  node_llm_adapter["LLM adapter<br/>[adapter.py]"]
  node_llm_router["Model routing<br/>[routing.py]"]
end

subgraph group_memory["Memory management"]
  node_memory_manager["Memory manager<br/>[manager.py]"]
  node_memory_injector["Context injection"]
  node_memory_barrier["Write barrier<br/>[write_barrier.py]"]
  node_memory_notes["Memory notes<br/>[note.py]"]
end

subgraph group_resources["Storage and tools"]
  node_storage_manager["Storage manager<br/>[storage.py]"]
  node_filesystem[("Semantic filesystem<br/>[lsfs.py]")]
  node_tool_manager["Tool manager<br/>[manager.py]"]
end

subgraph group_computer["Computer use"]
  node_mcp_server["MCP server<br/>[mcp_server.py]"]
  node_vm_controller["VM controller"]
  node_vm_providers["VM providers<br/>[base.py]"]
  node_computer_env["Desktop environment<br/>[desktop_env.py]"]
end

node_agent(("Agent client"))

node_agent -->|"submits requests"| node_syscall
node_syscall -->|"schedules syscalls"| node_scheduler
node_scheduler -->|"dispatches requests"| node_hooks
node_hooks -->|"routes memory"| node_memory_manager
node_hooks -->|"routes storage"| node_storage_manager
node_hooks -->|"routes LLM"| node_llm_adapter
node_scheduler -->|"dispatches inference"| node_llm_adapter
node_scheduler -->|"dispatches memory"| node_memory_manager
node_scheduler -->|"dispatches storage"| node_storage_manager
node_scheduler -->|"dispatches tools"| node_tool_manager
node_llm_adapter -->|"selects model"| node_llm_router
node_llm_adapter -->|"uses context"| node_context
node_memory_injector -->|"retrieves memories"| node_memory_manager
node_memory_manager -->|"coordinates writes"| node_memory_barrier
node_memory_manager -->|"handles notes"| node_memory_notes
node_storage_manager -->|"delegates requests"| node_filesystem
node_tool_manager -->|"loads server path"| node_config
node_tool_manager -->|"starts process"| node_mcp_server
node_vm_controller -.->|"uses providers"| node_vm_providers
node_vm_controller -.->|"controls desktop"| node_computer_env
node_tool_manager -.->|"computer-use extension"| node_vm_controller
node_terminal -.->|"submits work"| node_syscall
node_config -->|"configures models"| node_llm_adapter
node_config -->|"configures providers"| node_memory_manager

click node_syscall "https://github.com/agiresearch/aios/blob/main/aios/syscall/syscall.py"
click node_scheduler "https://github.com/agiresearch/aios/blob/main/aios/scheduler/fifo_scheduler.py"
click node_hooks "https://github.com/agiresearch/aios/tree/main/aios/hooks/modules"
click node_config "https://github.com/agiresearch/aios/blob/main/aios/config/config_manager.py"
click node_context "https://github.com/agiresearch/aios/blob/main/aios/context/simple_context.py"
click node_llm_adapter "https://github.com/agiresearch/aios/blob/main/aios/llm_core/adapter.py"
click node_llm_router "https://github.com/agiresearch/aios/blob/main/aios/llm_core/routing.py"
click node_memory_manager "https://github.com/agiresearch/aios/blob/main/aios/memory/manager.py"
click node_memory_injector "https://github.com/agiresearch/aios/blob/main/aios/memory/context_injector.py"
click node_memory_barrier "https://github.com/agiresearch/aios/blob/main/aios/memory/write_barrier.py"
click node_memory_notes "https://github.com/agiresearch/aios/blob/main/aios/memory/note.py"
click node_storage_manager "https://github.com/agiresearch/aios/blob/main/aios/storage/storage.py"
click node_filesystem "https://github.com/agiresearch/aios/blob/main/aios/storage/filesystem/lsfs.py"
click node_tool_manager "https://github.com/agiresearch/aios/blob/main/aios/tool/manager.py"
click node_mcp_server "https://github.com/agiresearch/aios/blob/main/aios/tool/mcp_server.py"
click node_vm_controller "https://github.com/agiresearch/aios/tree/main/aios/tool/virtual_env/controllers"
click node_vm_providers "https://github.com/agiresearch/aios/blob/main/aios/tool/virtual_env/providers/base.py"
click node_computer_env "https://github.com/agiresearch/aios/blob/main/aios/tool/virtual_env/desktop_env.py"
click node_terminal "https://github.com/agiresearch/aios/blob/main/aios/terminal/intent_router.py"

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_syscall,node_scheduler,node_hooks,node_config,node_terminal,node_agent toneBlue
class node_context,node_llm_adapter,node_llm_router toneAmber
class node_memory_manager,node_memory_injector,node_memory_barrier,node_memory_notes toneMint
class node_storage_manager,node_filesystem,node_tool_manager toneRose
class node_mcp_server,node_vm_controller,node_vm_providers,node_computer_env toneIndigo
```

## Components

### Kernel orchestration

- [Syscall executor](https://github.com/agiresearch/aios/blob/main/aios/syscall/syscall.py): `aios/syscall/syscall.py`
- [Request scheduler](https://github.com/agiresearch/aios/blob/main/aios/scheduler/fifo_scheduler.py): `aios/scheduler/fifo_scheduler.py`
- [Resource hooks](https://github.com/agiresearch/aios/tree/main/aios/hooks/modules): `aios/hooks/modules`
- [Configuration](https://github.com/agiresearch/aios/blob/main/aios/config/config_manager.py): `aios/config/config_manager.py`
- [Terminal interface](https://github.com/agiresearch/aios/blob/main/aios/terminal/intent_router.py): `aios/terminal/intent_router.py`

### LLM and context

- [Context manager](https://github.com/agiresearch/aios/blob/main/aios/context/simple_context.py): `aios/context/simple_context.py`
- [LLM adapter](https://github.com/agiresearch/aios/blob/main/aios/llm_core/adapter.py): `aios/llm_core/adapter.py`
- [Model routing](https://github.com/agiresearch/aios/blob/main/aios/llm_core/routing.py): `aios/llm_core/routing.py`

### Memory management

- [Memory manager](https://github.com/agiresearch/aios/blob/main/aios/memory/manager.py): `aios/memory/manager.py`
- [Context injection](https://github.com/agiresearch/aios/blob/main/aios/memory/context_injector.py): `aios/memory/context_injector.py`
- [Write barrier](https://github.com/agiresearch/aios/blob/main/aios/memory/write_barrier.py): `aios/memory/write_barrier.py`
- [Memory notes](https://github.com/agiresearch/aios/blob/main/aios/memory/note.py): `aios/memory/note.py`

### Storage and tools

- [Storage manager](https://github.com/agiresearch/aios/blob/main/aios/storage/storage.py): `aios/storage/storage.py`
- [Semantic filesystem](https://github.com/agiresearch/aios/blob/main/aios/storage/filesystem/lsfs.py): `aios/storage/filesystem/lsfs.py`
- [Tool manager](https://github.com/agiresearch/aios/blob/main/aios/tool/manager.py): `aios/tool/manager.py`

### Computer use

- [MCP server](https://github.com/agiresearch/aios/blob/main/aios/tool/mcp_server.py): `aios/tool/mcp_server.py`
- [VM controller](https://github.com/agiresearch/aios/tree/main/aios/tool/virtual_env/controllers): `aios/tool/virtual_env/controllers`
- [VM providers](https://github.com/agiresearch/aios/blob/main/aios/tool/virtual_env/providers/base.py): `aios/tool/virtual_env/providers/base.py`
- [Desktop environment](https://github.com/agiresearch/aios/blob/main/aios/tool/virtual_env/desktop_env.py): `aios/tool/virtual_env/desktop_env.py`

### Other components

- **Agent client**

## Connections

- Agent client → Syscall executor: submits requests (evidence: `README.md`)
- Syscall executor → Request scheduler: schedules syscalls (evidence: `README.md`)
- Request scheduler → Resource hooks: dispatches requests (evidence: `aios/scheduler/fifo_scheduler.py`)
- Resource hooks → Memory manager: routes memory (evidence: `aios/hooks/modules/memory.py`)
- Resource hooks → Storage manager: routes storage (evidence: `aios/hooks/modules/storage.py`)
- Resource hooks → LLM adapter: routes LLM (evidence: `aios/hooks/modules/llm.py`)
- Request scheduler → LLM adapter: dispatches inference (evidence: `aios/scheduler/fifo_scheduler.py`)
- Request scheduler → Memory manager: dispatches memory (evidence: `aios/scheduler/fifo_scheduler.py`)
- Request scheduler → Storage manager: dispatches storage (evidence: `aios/scheduler/fifo_scheduler.py`)
- Request scheduler → Tool manager: dispatches tools (evidence: `aios/scheduler/fifo_scheduler.py`)
- LLM adapter → Model routing: selects model (evidence: `aios/llm_core/adapter.py`)
- LLM adapter → Context manager: uses context (evidence: `aios/llm_core/adapter.py`)
- Context injection → Memory manager: retrieves memories (evidence: `aios/memory/context_injector.py`)
- Memory manager → Write barrier: coordinates writes (evidence: `aios/memory/manager.py`)
- Memory manager → Memory notes: handles notes (evidence: `aios/memory/manager.py`)
- Storage manager → Semantic filesystem: delegates requests (evidence: `aios/storage/storage.py`)
- Tool manager → Configuration: loads server path (evidence: `aios/tool/manager.py`)
- Tool manager → MCP server: starts process (evidence: `aios/tool/manager.py`)
- VM controller → VM providers: uses providers
- VM controller → Desktop environment: controls desktop
- Tool manager → VM controller: computer-use extension (evidence: `README.md`)
- Terminal interface → Syscall executor: submits work
- Configuration → LLM adapter: configures models (evidence: `aios/llm_core/adapter.py`)
- Configuration → Memory manager: configures providers (evidence: `aios/memory/manager.py`)
