Skip to content

Agentic Operating System Design

Building a better agentic OS requires understanding both the academic architecture proposals and the production systems that have shipped. This section covers the OS-level design patterns, the kernel abstractions, and detailed analyses of OpenCode and Hermes Agent as reference implementations.

FieldValue
TitleAIOS: LLM Agent Operating System
AuthorsKai Mei, Zelong Li, Shuyuan Xu, Ruosong Ye, Yingqiang Ge, Yongfeng Zhang
InstitutionNanjing University / UCLA
VenueNeurIPS 2024
ArXiv2403.16971

AIOS first systematically proposed embedding LLMs into the OS kernel, treating the LLM as the central cognitive engine. The kernel contains six modules:

ModuleFunctionDesign Insight
Agent SchedulerFIFO/RR algorithms for LLM resource utilizationAgents are processes, need scheduling
Context ManagerSnapshot + interrupt/resumeContext is state, needs persistence
Memory ManagerShort-term memory with TTLWorking memory for active tasks
Storage ManagerLong-term persistent memoryEpisodic knowledge base
Tool ManagerExternal API orchestrationTools are OS services
Access ManagerPermission-group access controlSecurity boundaries between agents

Results: 2.1× throughput improvement in multi-agent concurrency; 60-70% context switching latency reduction; 3× efficiency at 2,000 concurrent agents.

Architecture diagram:

┌─────────────────────────────────────────────┐
│ AIOS Kernel │
│ ┌─────────┐ ┌──────────┐ ┌──────────────┐ │
│ │Scheduler│ │ Context │ │ Memory │ │
│ │ │ │ Manager │ │ Manager │ │
│ └─────────┘ └──────────┘ └──────────────┘ │
│ ┌─────────┐ ┌──────────┐ ┌──────────────┐ │
│ │ Tool │ │ Storage │ │ Access │ │
│ │ Manager │ │ Manager │ │ Manager │ │
│ └─────────┘ └──────────┘ └──────────────┘ │
│ LLM Core │
└─────────────────────────────────────────────┘

FieldValue
TitleAgent Centric Operating System – a Comprehensive Review and Outlook
AuthorsShian Jia, Xinbo Wang, Mingli Song, Gang Chen
InstitutionZhejiang University
ArXiv2411.17710

ACOS proposes that every OS component should be abstracted as an agent, creating a modular, adaptable, cross-platform architecture. Key differentiators from traditional OS:

DimensionTraditional OSAgent OS
Resource granularityProcess-levelAgent-level
Task schedulingDeterministicProbabilistic-deterministic hybrid
IPC mechanismSignals, pipes, socketsAgent-to-agent protocols
Resource managementCPU, memory, I/OLLM context, tool access, memory

Key contribution: First academic paper to establish a complete “technology framework” for Agent OS, defining the “LLM → Agent → Resource Management” collaboration logic.


FieldValue
TitleArchitecting AgentOS: From Token-Level Context to Emergent System-Level Intelligence
AuthorsChengYou Li, XiaoDong Liu, XiangBao Meng, XinYu Zhao
ArXiv2602.20934

Maps classical OS abstractions (memory paging, interrupt handling, process scheduling) onto LLM-native constructs:

  • Deep Context Management: Context window redefined as an “addressable semantic space” rather than a passive buffer
  • Semantic Slicing: Time-aligned context partitioning to mitigate cognitive drift in multi-agent collaboration
  • Interrupt Model: OS-style interrupts for agent preemption and resumption

Why it matters: This is the frontier — bridging classical OS theory with LLM-native system design.


2. OpenCode — Event-Driven Terminal Agent

Section titled “2. OpenCode — Event-Driven Terminal Agent”

Repository: github.com/anomalyco/opencode Language: TypeScript (Bun) | License: MIT | Stars: 133k+

OpenCode is an event-driven, multi-provider terminal coding agent. Its architecture reveals key design decisions for agentic OS builders:

Core Design Principles:

  1. 75+ provider support, zero lock-in — abstract LLM as a swappable backend
  2. Global pub/sub event bus — decouples logic execution from terminal rendering
  3. ReAct cycle — standardized Thought→Action→Observation processing
  4. 18 built-in tools + TS custom tools + plugin tools — extensible tool ecosystem
  5. SQLite-backed layered storage — session persistence, shareable transcripts

Architecture:

┌──────────────────────────────────────────────────┐
│ OpenCode CLI │
│ ┌─────────┐ ┌──────────┐ ┌─────────────────┐ │
│ │ Prompt │→│ Agent │→│ Event Bus │ │
│ │ Parser │ │ Loop │ │ (pub/sub) │ │
│ └─────────┘ └──────────┘ └─────────────────┘ │
│ ↑ ↓ │
│ ┌─────────┐ ┌──────────┐ ┌─────────────────┐ │
│ │ Providers│ │ Tools │ │ Renderer │ │
│ │ (75+) │ │ (18+) │ │ (Terminal/Web) │ │
│ └─────────┘ └──────────┘ └─────────────────┘ │
│ SQLite Store │
└──────────────────────────────────────────────────┘

Key Design Decisions:

  • Three internal agents (build, plan, general) with shared event bus — configuration templates, not true multi-agent
  • Event bus decouples I/O from processing — the terminal is just one subscriber
  • Tool execution through MCP server with permission gates

What to learn:

  • Event-driven architecture for agent systems
  • Provider abstraction layer design
  • Multi-client rendering (terminal + web) from shared core

3. Hermes Agent — Self-Evolving Python Agent

Section titled “3. Hermes Agent — Self-Evolving Python Agent”

Repository: github.com/NousResearch/hermes-agent Language: Python (~369k lines) | License: MIT | Stars: 70k+

Hermes is a “persistently online digital employee” — not a Q&A window but a colleague with memory, self-evolving skills, and multi-platform presence.

Core Systems:

The most architecturally distinctive feature. GEPA (no public paper, but documented in code) optimizes agent prompts through a backpropagation-like mechanism:

  • 100–500 evaluations per iteration (vs. traditional RL requiring 10,000+)
  • Policy iteration without gradient descent
  • Prompt optimization emerges from iterative evaluation + mutation

Architectural significance: This treats the agent’s personality/behavior as an optimizable artifact, not a static prompt. The engine can adjust tool selection heuristics, response style, and task decomposition strategies.

┌─────────────────────────────────────────┐
│ Memory System │
│ ┌───────────┐ ┌────────────────────┐ │
│ │ MEMORY.md │ │ USER.md │ │
│ │ (Facts, │ │ (Preferences, │ │
│ │ Lessons) │ │ Patterns) │ │
│ └───────────┘ └────────────────────┘ │
│ ┌───────────────────────────────────┐ │
│ │ SQLite FTS5 + LLM Summaries │ │
│ └───────────────────────────────────┘ │
└─────────────────────────────────────────┘
  • MEMORY.md: Environmental facts, lessons learned, task outcomes — grows with usage
  • USER.md: User preferences, communication style, constraints
  • SQLite FTS5: Full-text search with LLM-generated summaries for retrieval

15+ messaging platforms from a single gateway process:

  • Western: Telegram, Discord, Slack, WhatsApp, Signal, Matrix
  • Chinese: 飞书 (Feishu), 钉钉 (DingTalk), 企业微信 (WeCom), 微信 (WeChat)
  • Other: Email, SMS, Mattermost, Webhooks

Each adapter translates channel-native events into the shared agent kernel.

  • Instruction-level approval for dangerous operations
  • Dangerous mode blocking with configurable thresholds
  • Docker sandbox isolation for code execution
  • Path traversal protection
  • SSRF mitigation
  • Zero CVE record (as of documentation)

Key insight: Security is layered — prompt-level filtering, runtime approval gates, and OS-level sandboxing work together.


Based on analysis of AIOS, ACOS, OpenCode, Hermes, and the broader literature, an agentic OS should decompose into these layers:

┌──────────────────────────────────────────────┐
│ User Interface Layer │
│ ┌─────────┐ ┌──────────┐ ┌───────────────┐ │
│ │ TUI │ │ Web │ │ Chat Apps │ │
│ └─────────┘ └──────────┘ └───────────────┘ │
├──────────────────────────────────────────────┤
│ Orchestration Layer │
│ ┌─────────┐ ┌──────────┐ ┌───────────────┐ │
│ │ReAct │ │ Subagent│ │ Task │ │
│ │Loop │ │ Manager │ │ Decomposer │ │
│ └─────────┘ └──────────┘ └───────────────┘ │
├──────────────────────────────────────────────┤
│ Kernel Layer │
│ ┌─────────┐ ┌──────────┐ ┌───────────────┐ │
│ │Provider │ │ Context │ │ Memory │ │
│ │Router │ │ Manager │ │ Manager │ │
│ └─────────┘ └──────────┘ └───────────────┘ │
│ ┌─────────┐ ┌──────────┐ ┌───────────────┐ │
│ │ Tool │ │ Session │ │ Safety │ │
│ │ Registry│ │ Manager │ │ Guard │ │
│ └─────────┘ └──────────┘ └───────────────┘ │
├──────────────────────────────────────────────┤
│ Infrastructure Layer │
│ ┌───────────────┐ ┌─────────────────────┐ │
│ │ SQLite/DB │ │ Sandbox Runtime │ │
│ └───────────────┘ └─────────────────────┘ │
└──────────────────────────────────────────────┘
LayerGormes ComponentHermes EquivalentOpenCode Equivalent
UITUI + Web Dashboard + GatewayTUI + Web + GatewayTerminal CLI
OrchestrationReAct loop + subagent spawnGEPA engineAgent loop + 3 agents
KernelProvider router, Goncho memoryProvider routing, MEMORY.mdProvider + SQLite
InfrastructureSQLite, Go sandboxDocker, SQLiteSQLite, Bun runtime

From analysis of these systems, key principles emerge:

Don’t bolt agents onto an existing OS. Design the OS around agents as first-class citizens.

  • AIOS: LLM is the kernel
  • ACOS: Everything is an agent

Agents are reactive. Polling loops are anti-patterns.

  • OpenCode: Global pub/sub event bus
  • Hermes: Channel adapters publish to shared kernel

5.3 Memory is a First-Class Kernel Service

Section titled “5.3 Memory is a First-Class Kernel Service”

Not an add-on vector DB. The kernel must manage memory lifecycle.

  • Hermes: MEMORY.md + USER.md as kernel-maintained files
  • Gormes: Goncho as in-binary SQLite memory

Static prompts are brittle. The OS should improve with use.

  • Hermes GEPA: Prompt optimization through iterative evaluation
  • Voyager: Skill library grows with experience

Prompt-level filters → Runtime approval gates → OS-level isolation.

  • Hermes: Three-layer security model
  • Agent-C: Formal temporal guarantees