Metadata-Version: 2.4
Name: nexus-agentos
Version: 1.0.0
Summary: 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
Author: AgentOS Team
License: MIT
Project-URL: Homepage, https://github.com/agentos/agentos
Project-URL: Documentation, https://docs.agentos.dev
Project-URL: Repository, https://github.com/agentos/agentos.git
Keywords: agent,llm,ai,framework,multi-agent
Classifier: Development Status :: 6 - Mature
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: openai>=1.0.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: pydantic>=2.0
Requires-Dist: aiosqlite>=0.20.0
Requires-Dist: langsmith>=0.1.0
Requires-Dist: fastapi>=0.110.0
Requires-Dist: uvicorn[standard]>=0.29.0
Requires-Dist: numpy>=1.26.0
Provides-Extra: full
Requires-Dist: faiss-cpu>=1.8.0; extra == "full"
Requires-Dist: chromadb>=0.5.0; extra == "full"
Requires-Dist: sentence-transformers>=3.0.0; extra == "full"
Requires-Dist: opentelemetry-api>=1.20.0; extra == "full"
Requires-Dist: docker>=7.0.0; extra == "full"
Requires-Dist: mcp>=1.0.0; extra == "full"
Provides-Extra: test
Requires-Dist: pytest>=8.0; extra == "test"
Requires-Dist: pytest-asyncio>=0.23.0; extra == "test"

# 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

```bash
pip install agentos

# Create a new project
agentos init my-agent

# Start the API server
agentos serve --preset production
```

```python
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

```python
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

```python
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

```python
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
