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 agent-os-kernel
# With SQLite persistence support
pip install "agent-os-kernel[persistence]"
# Or full dev environment
pip install "agent-os-kernel[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())
Showcase Application — Autonomous Incident Response
A standalone enterprise incident response system demonstrating every Agent-OS capability:
# Run standalone terminal demo
cd showcase
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
License
MIT — see LICENSE
Metadata
Release files for RRSSM-agent-os 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rrssm_agent_os-0.1.0.tar.gz | 69.8 kB | Without provenance | Details for rrssm_agent_os-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rrssm_agent_os-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for rrssm_agent_os-0.1.0-py3-none-any.whl |
Total release size: 142.2 kB
Release files / rrssm_agent_os-0.1.0.tar.gz
| Download URL | rrssm_agent_os-0.1.0.tar.gz |
|---|---|
| Size | 69.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7bffaf31cdc2d7f9c099c04f01d2f19ceea305c05b2867ab5c788e414980a431
|
|
BLAKE2b-256 checksum How to use checksums |
be2d5f99b307c3ac958101523f6efd38138b74c61e6f9e880655f3cb39af1705
|
| 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.0-py3-none-any.whl
| Download URL | rrssm_agent_os-0.1.0-py3-none-any.whl |
|---|---|
| Size | 72.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
24ede056fe624e59fb9e9727e59819df6ef6dc0eddfa8a15d6672fb10e767b9e
|
|
BLAKE2b-256 checksum How to use checksums |
ac30a0cf080c115df02a1b0bda120064160bfc415be41898436f4fa74b641db0
|
| 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.0
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.