Agent Operating System — Production-ready multi-model agent framework with TokenCounter, SemanticMemoryRetriever, ConfigPresets, ToolRegistry, WorkflowTemplate, ResponseCache, AgentGraph, StreamingAgent, ConversationMemory, AsyncAgentLoop, SwarmPatterns, CI/CD pipeline, and 30+ production modules
Project description
AgentOS v0.99
Agent Operating System — Production-ready multi-model agent framework.
Overview
AgentOS is a modular, twelve-layered framework for building, orchestrating, and deploying AI agents. It supports OpenAI, Anthropic, Google Gemini, and open-source models through a unified routing layer.
Quick Start
pip install agentos
# Create a new project
agentos init my-agent
# Start the API server
agentos serve --preset production
from agentos import AgentLoop, LoopConfig, ModelRouter
loop = AgentLoop(
config=LoopConfig(model="gpt-4o", max_iterations=10),
router=ModelRouter(),
)
result = loop.run("Summarize the key features of AgentOS.")
print(result.output)
Architecture
agentos/
├── agents/ Agent marketplace & skill registry
├── api/ REST API server, middleware, streaming, versioning
├── benchmarks/ Benchmarking & performance testing
├── cache/ LLM cache, response cache, embedding cache
├── cli/ CLI scaffolding & serve commands
├── comm/ Inter-agent communication (blackboard, event bus)
├── config/ Configuration loader, validator, presets
├── core/ Agent loop, state machine, async loop, streaming
├── cost/ Cost tracking, token counting
├── deployment/ Docker & Kubernetes deployment
├── docs/ API documentation generator
├── errors/ Error formatting & handling
├── evaluation/ Scoring & evaluation metrics
├── experiments/ A/B experiment runner
├── feedback/ User feedback collection & learning
├── health/ Health checks & monitoring
├── logging/ Structured logging
├── memory/ Short-term, long-term, working memory, summarizer, retriever
├── models/ Model router, resilience, backends (Gemini)
├── monitoring/ Alerting & metrics
├── multimodal/ Image, audio, document processing
├── observability/ Cost analytics, metrics, tracing
├── orchestration/ DAG orchestrator, agent graph execution
├── plugins/ Plugin system & lifecycle
├── prompts/ Prompt registry & templates
├── protocols/ Agent contracts & MCP
├── queue/ Task queue & rate limiter
├── security/ Guardrails, auditor, sandbox
├── server/ MCP server
├── storage/ Storage backend abstraction
├── subagent/ Sub-agent management
├── swarm/ Swarm coordination & patterns
├── testing/ Test fixtures & mocks
├── tools/ Tool registry, function calling, orchestrator, generator
├── vectorstore/ Vector database abstraction
└── workflows/ Workflow engine & templates
Key Features
v0.99 New
| Module | Description |
|---|---|
TokenCounter |
Model-aware token counting + cost estimation for OpenAI/Anthropic/Gemini/Llama |
SemanticMemoryRetriever |
Hybrid memory search (semantic + BM25 keyword) across conversation & long-term memory |
ConfigPresets |
8 ready-to-use config profiles: development, production, testing, budget, creative, deep_research, gemini_fast, gemini_pro |
Core Features (v0.95 - v0.98)
| Module | Description |
|---|---|
ToolRegistry |
Function calling pipeline with JSON Schema validation & batch execution |
WorkflowTemplate |
Declarative workflow templates (YAML/JSON) with 6 step types |
ResponseCache |
TTL cache with LRU eviction & 3 key strategies |
AgentGraph |
DAG execution engine with Mermaid export |
StreamingAgent |
SSE real-time streaming with session management |
ConversationMemory |
4 window strategies: Sliding, TokenAware, Importance, Hybrid |
AsyncAgentLoop |
Async concurrent execution with p50/p95/p99 latency stats |
SwarmPatterns |
5 collaboration topologies: Broadcast, Pipeline, Hierarchical, Consensus, RoundRobin |
Infrastructure (v0.50 - v0.95)
- Model Router: Unified routing across OpenAI, Anthropic, Gemini, Llama
- Guardrails: Content safety, PII sanitization, content hashing
- Rate Limiter: Token bucket, sliding window, concurrency limiter
- Circuit Breaker: Resilience patterns with configurable retry
- Cost Analytics: Budget alerts, cost breakdown, session tracking
- Health Checks: OpenAI connectivity, vector store, disk space, memory
- Security Auditor: Full security audit with severity-based findings
- Docker/K8s: Auto-generate Dockerfile + docker-compose
- CI/CD: GitHub Actions with multi-OS, 3 Python versions, lint, bandit security scan
Config Presets
from agentos import get_preset, list_presets
# List all presets
for name in list_presets():
p = get_preset(name)
print(f"{p.name}: {p.model} (T={p.temperature})")
# Apply a preset
config = {"max_iterations": 15}
from agentos import apply_preset
apply_preset("production", config) # Overrides with prod defaults
| Preset | Model | Temp | Use Case |
|---|---|---|---|
development |
gpt-4o-mini | 0.8 | Local dev, fast iteration |
production |
gpt-4o | 0.3 | Deployed services |
testing |
gpt-4o-mini | 0.0 | CI/CD tests |
budget |
gpt-4o-mini | 0.5 | Cost-sensitive |
creative |
claude-3.5-sonnet | 0.95 | Creative writing |
deep_research |
claude-3-opus | 0.4 | Research & analysis |
gemini_fast |
gemini-2.0-flash | 0.7 | High throughput |
gemini_pro |
gemini-1.5-pro | 0.5 | 2M context window |
Token Counting
from agentos import TokenCounter
counter = TokenCounter()
tokens = counter.count("Hello, agent world!", model="gpt-4o")
print(f"Tokens: {counter.format_tokens(tokens)}")
messages = [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Explain quantum computing in 3 sentences."},
]
total = counter.count_messages(messages, model="gpt-4o")
cost = counter.estimate_cost(total)
print(f"Cost: {counter.format_cost(cost)}")
Memory Retrieval
from agentos import SemanticMemoryRetriever, RetrievalStrategy, MemoryEntry
retriever = SemanticMemoryRetriever()
# Index memories
retriever.index([
MemoryEntry(id="1", content="Deployed to production at 3pm UTC", source="long_term"),
MemoryEntry(id="2", content="User asked about GDPR compliance", source="conversation"),
MemoryEntry(id="3", content="Database migration scheduled for Friday", source="conversation"),
])
# Hybrid search (semantic + keyword)
results = retriever.retrieve("When is the next deployment?")
for r in results:
print(f"[{r.score:.2f}] {r.entry.content}")
Requirements
- Python >= 3.11
- openai >= 1.0.0
- httpx >= 0.27.0
- pyyaml >= 6.0
- pydantic >= 2.0
- fastapi >= 0.110.0 (optional, for API server)
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nexus_agentos-1.1.2.tar.gz.
File metadata
- Download URL: nexus_agentos-1.1.2.tar.gz
- Upload date:
- Size: 170.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6969de413c13e20390dcdbbfe448a5d680b00080ebc8849d6bb2a25657226934
|
|
| MD5 |
2e1c9348ee9f95adfaba177fb73c9dbc
|
|
| BLAKE2b-256 |
462be7b4188b0a8751380aefb89c5962699cdb46f71d5c7933ee6d7e8389d17d
|
File details
Details for the file nexus_agentos-1.1.2-py3-none-any.whl.
File metadata
- Download URL: nexus_agentos-1.1.2-py3-none-any.whl
- Upload date:
- Size: 207.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
472fee8d5b736a816653778fcbff728e0bf980fa775e74af88fdaa037ca6b608
|
|
| MD5 |
de5a5815778384dc4d78f9d3ca3050e4
|
|
| BLAKE2b-256 |
00667d7c3b288f700f82432658bfd02d766ce8608a493b079f328fd316748169
|