Metadata-Version: 2.4
Name: agentgrid-sdk
Version: 0.1.0
Summary: git for AI agents — registry, version control, and governance for autonomous agent fleets
Project-URL: Homepage, https://agentgrid.dev
Project-URL: Repository, https://github.com/nath-abhishek/agentgrid-sdk
Project-URL: Documentation, https://docs.agentgrid.dev
Author-email: AgentGrid <abhi@agentgrid.dev>
License: MIT
Keywords: agents,ai,governance,mlops,registry
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.11
Requires-Dist: httpx>=0.27.0
Requires-Dist: opentelemetry-exporter-otlp>=1.24.0
Requires-Dist: opentelemetry-sdk>=1.24.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: rich>=13.0.0
Requires-Dist: typer>=0.12.0
Provides-Extra: dev
Requires-Dist: mypy>=1.9.0; extra == 'dev'
Requires-Dist: pip-licenses>=4.4.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
Requires-Dist: pytest-benchmark>=4.0.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: ruff>=0.4.0; extra == 'dev'
Description-Content-Type: text/markdown

# AgentGrid — git for AI agents

Registry, version control, and observability for autonomous agent fleets.

```bash
pip install agentgrid
```

---

## Quickstart

```python
from agentgrid import AgentGrid

ag = AgentGrid(api_key="ag_sk_...")  # or set AGENTGRID_API_KEY

ag.register(
    name="email-triage-agent",
    framework="crewai",
    model="claude-haiku-4-5-20251001",
)
```

That's it. Your agent is in the registry with a version, a diff history, and an audit trail.

---

## CLI

```bash
# Register or update an agent
agentgrid register \
  --name email-triage-agent \
  --framework crewai \
  --model claude-haiku-4-5-20251001 \
  --version-tag v1.1 \
  --message "Tightened prompt — reduce hallucination rate"

# View version history
agentgrid versions --agent email-triage-agent

# Diff two versions
agentgrid diff --agent email-triage-agent --from v1.0 --to v1.1

# Rollback
agentgrid rollback --agent email-triage-agent --to v1.0 --reason "regression in v1.1"

# Deploy to staging
agentgrid deploy --agent email-triage-agent --env staging

# Latency + cost metrics
agentgrid metrics --agent email-triage-agent --last 24h

# Auth
agentgrid login
agentgrid whoami
```

---

## Python SDK

```python
from agentgrid import AgentGrid

ag = AgentGrid(api_key="ag_sk_...")

# Register
agent = ag.register(
    name="email-triage-agent",
    framework="crewai",
    model="claude-haiku-4-5-20251001",
    version_tag="v1.1",
    deploy_message="Tightened prompt",
    environment="production",
)

# Fetch
agent = ag.get_agent("email-triage-agent")

# Version history
versions = ag.get_versions("email-triage-agent")

# Diff
diff = ag.get_diff("email-triage-agent", from_tag="v1.0", to_tag="v1.1")

# Rollback
ag.rollback("email-triage-agent", to_version="v1.0", reason="regression in v1.1")
```

---

## GitHub Action

```yaml
# .github/workflows/deploy.yml
- uses: nath-abhishek/agentgrid-sdk/.github/actions/agentgrid@main
  with:
    api-key: ${{ secrets.AGENTGRID_API_KEY }}
    agents-dir: ./agents
    environment: production
    deploy-message: ${{ github.event.head_commit.message }}
```

Each subdirectory of `agents-dir` that contains an `agentgrid.yaml` file will be registered on every push.

---

## What This SDK Does NOT Do

The SDK has zero business logic. It is a thin HTTP client and CLI that calls the AgentGrid cloud API.

- **No policy evaluation** — all governance runs server-side in agentgrid-cloud
- **No audit storage** — events are emitted async to the cloud; no local DB
- **No agent runtime** — the SDK never invokes your agent code
- **No framework lock-in** — works with any Python agent (CrewAI, LangGraph, AutoGen, custom)
- **No cloud lock-in** — self-host the API and point `AGENTGRID_API_URL` at it

If you're looking for something that runs inside your agent process and makes decisions, that's not this SDK.

---

## Framework-agnostic

```python
# CrewAI
ag.register(name="my-crew", framework="crewai", model="claude-sonnet-4-6")

# LangGraph
ag.register(name="my-graph", framework="langgraph", model="gpt-4o")

# Custom
ag.register(name="my-agent", framework="custom", model="llama-3.3")
```

---

## Environment variables

| Variable | Description |
|---|---|
| `AGENTGRID_API_KEY` | API key (overrides `agentgrid login` credentials) |
| `AGENTGRID_API_URL` | Override API base URL (default: `https://api.agentgrid.dev/v1`) |

---

## Links

- Docs: [docs.agentgrid.dev](https://docs.agentgrid.dev)
- Cloud: [agentgrid.dev](https://agentgrid.dev)
- Issues: [github.com/nath-abhishek/agentgrid-sdk/issues](https://github.com/nath-abhishek/agentgrid-sdk/issues)
