Skip to main content

Agent-OS 🤖

An operating-system kernel for LLM agents.
Scheduling · IPC · Memory · Supervisor · Deadlock Detection · Persistence

Agent-OS treats LLM agents as first-class OS processes — each agent gets a PID, priority, resource quota, and lifecycle managed by a real scheduler and supervisor, just like threads in an operating system.


Features

OS Concept Agent-OS Implementation
Process Management Spawn, list, pause, resume, cancel, terminate agents
Priority Scheduling Preemptive priority queue with starvation prevention via aging
IPC Per-PID message queues, point-to-point routing, and deduplication
Memory / Context Context pages, swap-in/swap-out, LRU eviction
Supervisor Auto-restart on failure with configurable policies (ONCE, N_TIMES, EXPONENTIAL_BACKOFF)
Deadlock Detection Cycle detection on resource wait graphs with automatic kernel resolution
Resource Quotas Hard kernel limits: token, step, LLM-call, and wall-time quotas
Persistence Layer Async SQLite storage via SQLAlchemy for processes, states, checkpoints, and events
Event System Full audit log of every kernel transition and state change
REST API FastAPI server with interactive Swagger documentation at /docs
React Dashboard Real-time UI: 6 live panels, one-click ▶ Run Demo, adaptive polling

Installation & Quick Start

1. From PyPI / Wheel

# Core kernel + SDK
pip install RRSSM-agent-os

# With SQLite persistence support
pip install "RRSSM-agent-os[persistence]"

# Or full dev environment
pip install "RRSSM-agent-os[all,dev]"

2. From Source

# Clone repository
git clone https://github.com/Rutika4521/Agent_OS.git
cd Agent_OS

# Install in editable mode
pip install -e ".[all,dev]"

3. Run the CLI / API Server

# Start the API server via CLI
agent-os server --host 0.0.0.0 --port 8000

# Or using the run script
python run.py server
# Interactive Swagger UI available at: http://localhost:8000/docs

4. Start the React UI Dashboard

cd frontend
npm install
npm run dev
# Dashboard available at: http://localhost:3000

Click ▶ Run Demo on the top bar to trigger the multi-agent pipeline and watch live process transitions, scheduler ordering, IPC messages, and resource meters in real time!


SDK — 10-line Quickstart

import agent_os
import asyncio

@agent_os.register(priority=8, name="Researcher", steps=[
    {"args": ["quantum computing"]},
    {"args": ["neural networks"]},
])
class ResearchAgent:
    async def run(self, topic: str) -> str:
        return f"Findings on {topic}"

@agent_os.register(priority=6, name="Writer")
class WriterAgent:
    async def run(self) -> str:
        return "Report compiled."

async def main():
    kernel = agent_os.Kernel()
    await kernel.boot()
    await kernel.spawn_registered()
    await kernel.run()

asyncio.run(main())

Using Agent-OS With an Existing Multi-Agent Codebase

Already have agents written? You don't need to rewrite anything. Agent-OS plugs in with just 2 changes.

Change 1 — Add the decorator to your existing agent classes

import agent_os

# BEFORE (your existing code)
class ResearchAgent:
    async def run(self, topic):
        # your existing logic — completely untouched
        return result

# AFTER — just add one line on top
@agent_os.register(priority=8, name="Researcher", steps=[{"args": ["topic"]}])
class ResearchAgent:
    async def run(self, topic):
        # your existing logic — still zero changes
        return result

AutoWrapper also handles agents that use execute() or __call__() instead of run().

Change 2 — Replace your custom runner loop with the kernel

# BEFORE (your existing orchestration)
agent1 = ResearchAgent()
agent2 = AnalystAgent()
result1 = await agent1.run("topic")
result2 = await agent2.run(result1)

# AFTER — kernel handles ordering, retries, IPC
kernel = agent_os.Kernel()
await kernel.boot()
await kernel.spawn_registered()
await kernel.run()

What you get for free (zero extra code)

Feature Without Agent-OS With Agent-OS
Execution order Manual await chain Priority-based scheduler
Crash recovery try/except everywhere restart_policy=RestartPolicy.N_TIMES
Agent communication Pass return values manually Built-in IPC message queues
Pause / Resume Not possible REST API: POST /processes/{pid}/pause
Audit trail Print statements Full event log at GET /events
Deadlock detection Manual Automatic cycle detection

The only conceptual shift: instead of you deciding when each agent runs, you assign each agent a priority and let the kernel decide the order.


Showcase Application — Autonomous Incident Response

A standalone enterprise incident response system demonstrating every Agent-OS capability:

# Run standalone terminal demo
cd showcase_full
python main.py
# Or start the showcase live server
python run_server.py
# (Open http://localhost:3000 and click ▶ Run Demo)
Agent Priority OS Feature Demonstrated
IncidentCommanderAgent 10 Preemptive Priority Scheduling (always scheduled first)
SecurityAuditorAgent 8 Resource Quotas (token burn) & IPC report dispatch
BugFixerAgent 7 WAITING state & decoupled IPC receipt
ContendedWorkerA / B 6 Circular lock dependency & Deadlock Detection
FlakyTestRunnerAgent 5 FAILED state & Supervisor auto-restart (N_TIMES)
TelemetryAgent 2 Starvation prevention via dynamic Priority Aging

Architecture

agent-os/
├── src/agent_os/          # Core OS Kernel
│   ├── kernel/            #   Process table, state machine, process manager
│   ├── scheduler/         #   Priority scheduler with aging
│   ├── ipc/               #   Message queues, routing, deduplication
│   ├── memory/            #   Context manager, checkpointing, LRU eviction
│   ├── resources/         #   Hard quota enforcement (tokens, steps, wall-time)
│   ├── supervisor/        #   Failure detection & auto-restart manager
│   ├── deadlock/          #   Resource wait graph cycle detection
│   ├── persistence/       #   Async SQLite database, models, and repositories
│   ├── metrics/           #   Event manager & metrics collector
│   ├── api/               #   FastAPI REST server & demo endpoints
│   └── cli.py             #   CLI entrypoint (`agent-os`)
├── sdk/                   # Developer SDK
│   ├── __init__.py        #   Public API exports
│   ├── kernel.py          #   Kernel bootstrap class
│   ├── registry.py        #   @agent_os.register() decorator
│   ├── wrapper.py         #   AutoWrapper (run/execute/__call__ → step)
│   └── agent.py           #   Agent protocol & AgentContext
├── frontend/              # React Dashboard (Vite, Recharts, Lucide)
├── examples/              # Research pipeline demo & SDK examples
├── showcase/              # Standalone 7-agent showcase application
└── tests/                 # 340+ unit and integration tests

Process States

CREATED → READY → RUNNING → COMPLETED → TERMINATED
                    ↓  ↑
                 WAITING / BLOCKED
                    ↓
                 CANCELLING → CANCELLED → TERMINATED
                    ↓
                  FAILED → RESTARTING → READY

REST API Endpoints

Method Endpoint Description
GET /processes List all processes in the system
POST /processes Spawn an agent process
GET /processes/{pid} Inspect state and resource usage for PID
POST /processes/{pid}/pause Pause process execution
POST /processes/{pid}/resume Resume paused process
POST /processes/{pid}/cancel Gracefully cancel a process
POST /processes/{pid}/terminate Force terminate a process
POST /ipc/send Send an IPC message between two PIDs
GET /ipc/receive/{pid} Retrieve queued message for a PID
GET /events Query audit trail of kernel events
GET /metrics Aggregated CPU/tokens/state metrics
GET /health System health check and status
POST /demo/run Trigger multi-agent pipeline in background
GET /demo/status Current status of running pipeline
POST /demo/reset Clear process table and reset demo state

Running Tests

# Run complete test suite (340+ tests)
python run_tests.py

# Or via pytest directly
pytest tests/ -v

# Run with test coverage
pytest tests/ --cov=agent_os

Metadata

Release files for RRSSM-agent-os 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for RRSSM-agent-os 0.1.1
File Size Uploaded Provenance Actions
rrssm_agent_os-0.1.1.tar.gz 71.6 kB Without provenance Details for rrssm_agent_os-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for RRSSM-agent-os 0.1.1
File Interpreter ABI Platform Actions
rrssm_agent_os-0.1.1-py3-none-any.whl Python 3 none any Details for rrssm_agent_os-0.1.1-py3-none-any.whl

Total release size: 144.7 kB

Release files / rrssm_agent_os-0.1.1.tar.gz

Download URL rrssm_agent_os-0.1.1.tar.gz
Size 71.6 kB
Tags Source
SHA-256 checksum
How to use checksums
bee31663111cd7891fb782dc1f7abef7c6e200c5a98556a4fc161d12fd0c974d
BLAKE2b-256 checksum
How to use checksums
33c2862856c10de75baf0ac41959947937ca00eeabcb5ef51d7e6f9b1797dfb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.8

Release files / rrssm_agent_os-0.1.1-py3-none-any.whl

Download URL rrssm_agent_os-0.1.1-py3-none-any.whl
Size 73.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a48673ce8383e0e16c8e95f003bebe29012b51eee1c1bdc6e9788843c3aa86ba
BLAKE2b-256 checksum
How to use checksums
4bc51846502b63ff17f6912e9083cff5345e717ffc9573882c49c0aef7e4b5e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.8

Security for RRSSM-agent-os 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page