Metadata-Version: 2.4
Name: agentwatch-core
Version: 0.1.0
Summary: Open-source observability, cost tracking, and governance for AI agents
Project-URL: Homepage, https://github.com/mukktinaadh/AgentWatch
Project-URL: Documentation, https://github.com/mukktinaadh/AgentWatch/docs
Project-URL: Repository, https://github.com/mukktinaadh/AgentWatch
Project-URL: Issues, https://github.com/mukktinaadh/AgentWatch/issues
Author-email: MukktiNaadh Raghavarapu <mukktinaadh@gmail.com>
License: MIT
License-File: LICENSE
Keywords: agents,ai,llm,monitoring,observability,opentelemetry
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Requires-Dist: requests>=2.28.0
Provides-Extra: all
Requires-Dist: anthropic>=0.20.0; extra == 'all'
Requires-Dist: langchain>=0.1.0; extra == 'all'
Requires-Dist: openai>=1.0.0; extra == 'all'
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.20.0; extra == 'anthropic'
Provides-Extra: langchain
Requires-Dist: langchain>=0.1.0; extra == 'langchain'
Provides-Extra: openai
Requires-Dist: openai>=1.0.0; extra == 'openai'
Description-Content-Type: text/markdown

<div align="center">

# 🔭 AgentWatch

### Open-source observability, cost tracking, and governance for AI agents

[![PyPI](https://img.shields.io/pypi/v/agentwatch-core?color=blue&label=PyPI)](https://pypi.org/project/agentwatch-core/)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
[![Python](https://img.shields.io/pypi/pyversions/agentwatch-core)](https://pypi.org/project/agentwatch-core/)
[![Status](https://img.shields.io/badge/status-alpha-orange)](https://github.com/mukktinaadh/AgentWatch)

**OpenAI** · **Anthropic** · **LangChain** · **CrewAI** · **AutoGen** · **LlamaIndex**

[Quickstart](#-quickstart) · [Self-Hosting](#-self-hosting) · [Dashboard](#-dashboard) · [Docs](docs/) · [Contributing](CONTRIBUTING.md)

</div>

> ⚠️ **Alpha:** Core SDK and self-hosting work. Human approval workflows and full 
> dashboard are in active development. See the [roadmap](#roadmap).

---

## Why AgentWatch?

Organizations deploy AI agents in production every day — customer support, code generation, document processing, and more. But once deployed, nobody can answer: *What did the agent do? How much did it cost? Did it get approval before taking action?*

**AgentWatch** is the missing observability layer. Unlike closed-source alternatives:

- 🏠 **Fully self-hostable** — the entire stack (SDK + API + dashboard) runs on your infra. Not just the SDK — everything.
- 📡 **OpenTelemetry-native** — no proprietary event format. Your data stays portable.
- ⚖️ **MIT licensed** — no AGPL copyleft triggers. Enterprise-friendly from day one.
- 🛡️ **Human approval workflows** — built into the core, not gated behind an Enterprise tier.
- 🔌 **Framework-agnostic** — one SDK works with OpenAI, Anthropic, LangChain, CrewAI, AutoGen, and LlamaIndex.

---

## ⚡ Quickstart

```bash
pip install agentwatch
```

### OpenAI
```python
import agentwatch
import openai

agentwatch.init(api_key="aw_your_key")  # That's it. All OpenAI calls are now traced.

client = openai.OpenAI()
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello!"}]
)
```

### LangChain
```python
import agentwatch
agentwatch.init(api_key="aw_your_key")

from langchain_openai import ChatOpenAI
llm = ChatOpenAI(model="gpt-4o")
result = llm.invoke("Explain quantum computing")
```

### CrewAI
```python
import agentwatch
agentwatch.init(api_key="aw_your_key")

from crewai import Crew, Agent, Task
crew = Crew(agents=[...], tasks=[...])
result = crew.kickoff()  # Automatically traced
```

### Custom Instrumentation
```python
@agentwatch.session
def my_agent_pipeline():
    result = research()
    return summarize(result)

@agentwatch.tool
def research():
    return search_web("latest AI news")
```

---

## 🏠 Self-Hosting

Deploy the entire AgentWatch stack in under 5 minutes:

```bash
git clone https://github.com/mukktinaadh/agentwatch
cd agentwatch
cp .env.example .env    # Edit with your secrets
docker compose up -d    # That's it.
```

Dashboard: `http://localhost` · API: `http://localhost:8000/docs`

Point your SDK to your self-hosted instance:
```python
agentwatch.init(
    api_key="aw_your_key",
    endpoint_url="http://your-server:8000"
)
```

---

## 📊 Dashboard

AgentWatch ships with a production-ready dashboard:

- **Sessions View** — All agent runs with status, cost, duration, error count
- **Trace Waterfall** — OTel-style span visualization with timing bars
- **Cost Analytics** — Spend by day, model, and agent with trend charts
- **Alerts** — Configure cost overrun and failure threshold alerts
- **Approvals** — Human-in-the-loop approval workflows with real-time polling
- **Settings** — API key management and self-hosting configuration

---

## 🏗️ Architecture

```
┌─────────────────┐     OTel Spans      ┌──────────────────┐
│   Your Agent    │ ──────────────────▶ │  AgentWatch API  │
│  + SDK (pip)    │                     │   (FastAPI)      │
└─────────────────┘                     └────────┬─────────┘
                                                 │
                                    ┌────────────┼────────────┐
                                    ▼            ▼            ▼
                              ┌──────────┐ ┌──────────┐ ┌──────────┐
                              │ PostgreSQL│ │  Redis   │ │ Dashboard│
                              │  (data)  │ │ (buffer) │ │  (React) │
                              └──────────┘ └──────────┘ └──────────┘

Approval Flow:
  Agent ──▶ SDK blocks ──▶ API ──▶ Dashboard (human review) ──▶ Agent resumes
```

---

## 🆚 Comparison

| Feature | AgentWatch | AgentOps.ai | Langfuse | LangSmith |
|---------|:---------:|:-----------:|:--------:|:---------:|
| Fully self-hostable (entire stack) | ✅ | ❌ | ✅ | ❌ |
| Open source (MIT) | ✅ | ⚠️ SDK only | ✅ | ❌ |
| OpenTelemetry-native | ✅ | ❌ | ⚠️ | ❌ |
| Human approval workflows | ✅ | ❌ | ❌ | ❌ |
| Cost analytics | ✅ | ✅ | ⚠️ | ⚠️ |
| Framework-agnostic | ✅ | ✅ | ✅ | ❌ |
| Compliance in open tier | ✅ | ❌ | ✅ | ❌ |

---

## 🗺️ Roadmap

See our [GitHub Projects board](https://github.com/mukktinaadh/agentwatch/projects) for the full roadmap.

**Phase 1 (MVP):** ✅ OTel traces · ✅ Cost analytics · ✅ Self-hosting · ✅ Dashboard
**Phase 2:** ✅ Human approval workflows · Cross-run analysis · Alert webhooks (Slack)
**Phase 3:** Compliance reporting · Memory management · Enterprise SSO/RBAC · AgentWatch Cloud

---

## 🤝 Contributing

We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for details.

```bash
# Local development
make dev                    # Start Postgres + Redis
cd api && uvicorn agentwatch_api.main:app --reload
cd dashboard && npm run dev
```

---

## 📄 License

MIT — see [LICENSE](LICENSE). Use it however you want. No AGPL, no copyleft triggers.

---

<div align="center">

**Built by [MukktiNaadh Raghavarapu](https://github.com/mukktinaadh)** · Star ⭐ if this is useful

</div>
