Skip to content

Repository files navigation

The AI Operating System

A five-part research series on functional design patterns for intelligent agent infrastructure, with Elixir/OTP reference implementations.

An AI Operating System manages models, agents, knowledge, and tasks — the same way a traditional OS manages processes, memory, files, and hardware. We design each subsystem using functional programming principles and implement them in Elixir/OTP.

Linux OS → manages hardware + programs
AI OS → manages models + agents + knowledge + tasks

Authors

Matthew Long The YonedaAI Collaboration · YonedaAI Research Collective Chicago, IL matthew@yonedaai.com · https://yonedaai.com

Architecture

 AI Operating System
┌─────────────────────────────────────────┐
│ IV. Planner Engine │
│ Market Clearing · Escrow · Reputation │
│ Order Book · DAG Decomposition │
└───────────────────┬─────────────────────┘
│
┌───────────────────┴─────────────────────┐
│ I. Agent Scheduler │
│ GenServer Lifecycle · Pipeline |> │
│ Supervision · Priority · Streaming │
└───────────────────┬─────────────────────┘
│
┌─────────────────────────┼─────────────────────────┐
│ │ │
┌───────┴────────┐ ┌──────────┴──────────┐ ┌─────────┴────────┐
│ II. Tools │ │ III. Memory Layer │ │ Model Runtime │
│ 3-Tier Registry│ │ Typed Schemas │ │ (LLM Inference) │
│ Capabilities │ │ ETS · Mnesia · Graph│ │ GPU Orchestrate │
│ MCP Protocol │ │ Versioned · 24 Types│ │ │
└────────────────┘ └─────────────────────┘ └──────────────────┘

Papers

PartTitleDesign FocusReadPDF
IAgent Scheduler: Composable Orchestration as Process ManagementGenServer lifecycle, pipelines, supervisionHTMLPDF
IITool Interface Layer: Capability Security and Composable Invocation3-tier registry, HMAC tokens, sandboxingHTMLPDF
IIIMemory Layer: Typed Filesystem for Persistent Agent CognitionETS/Mnesia storage, versioning, graphHTMLPDF
IVPlanner Engine: Market Clearing and Order Book DynamicsEscrow, reputation, task decompositionHTMLPDF
VSynthesis: Composing Four Subsystems into an AI OSUmbrella app, pairwise composition, lifecycleHTMLPDF

Design Mapping

ResourceTraditional OSAI OSElixir/OTP Pattern
ComputeCPU processesAgentsGenServer + DynamicSupervisor
OperationsSystem callsTools (MCP, sandboxed)Higher-order functions + closures
StateRAM + filesystemTyped memory Mem[S]ETS (working) + Mnesia (persistent)
CoordinationSchedulerPlanner (order book)GenServer state + Mnesia transactions
CompositionPipes / IPCAgent pipeline busPipe operator `
Fault toleranceProcess restartOTP supervisionone_for_one / rest_for_one strategies

Why Elixir/OTP

The BEAM VM was designed as a telecom operating system — its primitives map directly to AI OS requirements:

  • Supervision trees → Agent fault tolerance ("let it crash")
  • Lightweight processes → Massive agent concurrency (millions per node)
  • ETS + Mnesia → Working memory + persistent knowledge
  • Pattern matching → Type-safe message dispatch and state transitions
  • Pipe operator → Composable execution pipelines
  • Hot code reload → Zero-downtime agent updates
  • Distribution → Multi-node agent clustering
  • Message passing → Inter-agent communication without shared state

Quick Start

cd src/agent_os
mix deps.get
mix compile
iex -S mix
# Start the AI Operating SystemAgentOS.start()# Check system statusAgentOS.status()

Project Structure

agent-os/
├── papers/
│ └── latex/ # Source .tex + compiled PDFs
├── src/
│ ├── agent_scheduler/ # Part I: GenServer lifecycle + pipeline composition
│ ├── tool_interface/ # Part II: 3-tier registry + capability tokens
│ ├── memory_layer/ # Part III: Typed memory with ETS/Mnesia
│ ├── planner_engine/ # Part IV: Order book + escrow + reputation
│ └── agent_os/ # Unified umbrella application
├── scripts/ # LaTeX→HTML conversion tools
├── reviews/ # Gemini peer review feedback
├── docs/ # GitHub Pages site
│ ├── index.html # Landing page
│ ├── og-image.png # Open Graph social image
│ └── papers/ # Readable HTML versions
└── .github/workflows/ # GitHub Pages deployment

Built on Production Systems

This research is grounded in real, deployed systems:

  • Agent-Hero — AI agent marketplace with bidding, escrow, and multi-provider execution
  • Agent Testing Framework — 5-phase streaming pipeline for automated web testing
  • ContextFS — Typed memory filesystem with versioning, graph lineage, and MCP integration

Website

https://agentherowork.github.io/agent-os/

License

MIT

About

Functional design patterns for intelligent agent infrastructure — 5-part research series with Elixir/OTP reference implementations

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages