Metadata-Version: 2.4
Name: pyagentos
Version: 0.1.0
Summary: The Operating System for AI Workers — build, deploy, and manage AI agents.
Home-page: https://github.com/agentos-ai/agentos
Author: AgentOS Contributors
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastapi>=0.109.0
Requires-Dist: uvicorn>=0.25.0
Requires-Dist: pydantic>=2.0.0
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-asyncio; extra == "dev"
Requires-Dist: httpx; extra == "dev"
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# 🤖 AgentOS — The Operating System for AI Workers

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
[![Python](https://img.shields.io/badge/Python-3.10%2B-blue)](https://python.org)

**Build, deploy, and manage AI agents with 5 lines of code.**

AgentOS is an open-source framework that makes it dead simple to create AI agents that can use tools, remember context, and work together in swarms. Think of it as the operating system for your AI workforce.

```python
from agentos import Agent, tool

@tool
def search_web(query: str) -> str:
    """Search the web."""
    return f"Results for: {query}"

agent = Agent(
    name="Researcher",
    instructions="You are a helpful research assistant.",
    tools=[search_web],
)

result = agent.run("What's the latest in AI?")
print(result)
```

## ✨ Why AgentOS?

| Feature | AgentOS | LangChain | CrewAI |
|---------|---------|-----------|--------|
| Lines of code for a simple agent | **5** | 30+ | 20+ |
| Built-in tools | ✅ 7 tools | ❌ | ✅ |
| Multi-agent swarms | ✅ Sequential + Parallel | ❌ | ✅ |
| Memory management | ✅ Built-in | Manual | ✅ |
| API server | ✅ FastAPI | ❌ | ❌ |
| CLI | ✅ | ❌ | ❌ |
| Open source | ✅ Apache 2.0 | ✅ MIT | ✅ MIT |

## 🚀 Quick Start

### Installation

```bash
pip install agentos
```

Set your API key:

```bash
export OPENAI_API_KEY="sk-..."
```

### Your First Agent

```python
from agentos import Agent

agent = Agent(
    name="Helper",
    instructions="You are a helpful assistant. Be concise.",
)

result = agent.run("Explain AI agents in one sentence.")
print(result)
```

### Agent with Tools

```python
from agentos import Agent, tool

@tool
def get_weather(city: str) -> str:
    """Get current weather for a city."""
    return f"Sunny, 72°F in {city}"

agent = Agent(
    name="WeatherBot",
    instructions="You help people check the weather.",
    tools=[get_weather],
)

result = agent.run("What's the weather in Tokyo?")
```

### Multi-Agent Swarm

```python
from agentos import Agent, Swarm

researcher = Agent(name="Researcher", instructions="Research topics thoroughly.",
                   tools=[web_search])
writer = Agent(name="Writer", instructions="Write clear reports.")

swarm = Swarm(agents=[researcher, writer])
outputs = swarm.run_sequential([
    ("Researcher", "Research AI trends in 2026"),
    ("Writer", "Write a report based on: {Researcher_output}"),
])
```

### CLI

```bash
# Run a one-shot task
agentos run "What is 2+2?"

# Start interactive chat
agentos chat

# Run a multi-agent swarm
agentos swarm "Research and write a report" -c swarm_config.json

# Start the API server
agentos serve
```

### API Server

```bash
agentos serve -p 8520
```

Then call the API:

```bash
curl -X POST http://localhost:8520/api/agents/run \
  -H "Content-Type: application/json" \
  -d '{"task": "Explain quantum computing in 2 sentences"}'
```

## 🛠️ Built-in Tools

AgentOS comes with 7 production-ready tools:

| Tool | Description |
|------|-------------|
| `read_file` | Read file contents |
| `write_file` | Write content to files |
| `list_directory` | List directory contents |
| `run_shell` | Execute shell commands |
| `web_fetch` | Fetch web page content |
| `calculate` | Evaluate math expressions |
| `current_time` | Get current date/time |

## 🏗️ Architecture

```
┌─────────────────────────────────────┐
│            AgentOS Platform          │
├─────────────────────────────────────┤
│  CLI  │  Python SDK  │  REST API    │
├─────────────────────────────────────┤
│          Core Engine                 │
│  ┌─────────┐  ┌──────────────────┐  │
│  │  Agent  │  │   Orchestrator   │  │
│  │  (LLM)  │  │   (Swarm)        │  │
│  └─────────┘  └──────────────────┘  │
│  ┌─────────┐  ┌──────────────────┐  │
│  │  Tools  │  │    Memory        │  │
│  └─────────┘  └──────────────────┘  │
├─────────────────────────────────────┤
│  OpenAI │ Anthropic │ Local Models  │
└─────────────────────────────────────┘
```

## 🗺️ Roadmap

- [x] Core Agent engine with tool calling
- [x] Multi-agent orchestration (Swarm)
- [x] CLI + REST API server
- [x] Built-in tools library
- [ ] Web Dashboard (agent monitoring)
- [ ] Memory persistence (SQLite/Postgres)
- [ ] Streaming responses
- [ ] Anthropic Claude support
- [ ] Local model support (Ollama)
- [ ] Agent marketplace
- [ ] Enterprise SSO & RBAC

## 🤝 Contributing

AgentOS is Apache 2.0 licensed. We welcome contributions!

```bash
git clone https://github.com/agentos-ai/agentos.git
cd agentos
pip install -e ".[dev]"
pytest
```

## 📄 License

Apache 2.0 — free for personal, academic, and commercial use.

---

**Built with ❤️ by the AgentOS team.**
*The OS for your AI workforce.*
