Metadata-Version: 2.4
Name: aigie
Version: 0.2.44
Summary: Enterprise-grade AI agent reliability monitoring and autonomous remediation
Home-page: https://kytte.ai/
Author: Aigie
Author-email: support@kytte.ai
License: Proprietary
Project-URL: Homepage, https://kytte.ai/
Keywords: ai agent monitoring observability llm reliability remediation
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.25.0
Requires-Dist: websockets>=11.0
Requires-Dist: redis>=5.0.0
Requires-Dist: grpcio>=1.60
Requires-Dist: protobuf<7,>=6.31
Requires-Dist: prometheus-client>=0.20.0
Requires-Dist: opentelemetry-api>=1.20.0
Requires-Dist: opentelemetry-sdk>=1.20.0
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.20.0
Requires-Dist: opentelemetry-instrumentation-httpx>=0.41b0
Provides-Extra: compression
Requires-Dist: zstandard>=0.22.0; extra == "compression"
Provides-Extra: openai
Requires-Dist: openai<3,>=1.0.0; extra == "openai"
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.18.0; extra == "anthropic"
Provides-Extra: gemini
Requires-Dist: google-generativeai>=0.3.0; extra == "gemini"
Provides-Extra: langchain
Requires-Dist: langchain-core>=0.1.0; extra == "langchain"
Provides-Extra: langgraph
Requires-Dist: langgraph>=0.0.20; extra == "langgraph"
Requires-Dist: langchain-core>=0.1.0; extra == "langgraph"
Provides-Extra: claude-agent-sdk
Requires-Dist: claude-agent-sdk>=0.0.10; extra == "claude-agent-sdk"
Provides-Extra: pinecone
Requires-Dist: pinecone-client>=3.0.0; extra == "pinecone"
Provides-Extra: qdrant
Requires-Dist: qdrant-client>=1.7.0; extra == "qdrant"
Provides-Extra: chromadb
Requires-Dist: chromadb>=0.4.0; extra == "chromadb"
Provides-Extra: weaviate
Requires-Dist: weaviate-client>=4.0.0; extra == "weaviate"
Provides-Extra: vectordbs
Requires-Dist: pinecone-client>=3.0.0; extra == "vectordbs"
Requires-Dist: qdrant-client>=1.7.0; extra == "vectordbs"
Requires-Dist: chromadb>=0.4.0; extra == "vectordbs"
Requires-Dist: weaviate-client>=4.0.0; extra == "vectordbs"
Provides-Extra: opentelemetry
Requires-Dist: opentelemetry-api>=1.20.0; extra == "opentelemetry"
Requires-Dist: opentelemetry-sdk>=1.20.0; extra == "opentelemetry"
Provides-Extra: otlp
Requires-Dist: opentelemetry-api>=1.20.0; extra == "otlp"
Requires-Dist: opentelemetry-sdk>=1.20.0; extra == "otlp"
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.20.0; extra == "otlp"
Provides-Extra: internal-telemetry
Requires-Dist: opentelemetry-sdk>=1.20.0; extra == "internal-telemetry"
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.20.0; extra == "internal-telemetry"
Requires-Dist: opentelemetry-semantic-conventions>=0.41b0; extra == "internal-telemetry"
Provides-Extra: pandas
Requires-Dist: pandas>=1.5.0; extra == "pandas"
Provides-Extra: dev
Requires-Dist: pytest>=7.4.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: pytest-httpx>=0.30.0; extra == "dev"
Requires-Dist: pytest-benchmark>=4.0.0; extra == "dev"
Requires-Dist: pytest-mock>=3.12.0; extra == "dev"
Requires-Dist: respx>=0.20.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: isort>=5.12.0; extra == "dev"
Requires-Dist: mypy>=1.5.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: pytest-timeout; extra == "dev"
Requires-Dist: tenacity>=8.2.0; extra == "dev"
Requires-Dist: grpcio-tools>=1.60; extra == "dev"
Requires-Dist: import-linter>=2.0; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx>=7.0.0; extra == "docs"
Requires-Dist: sphinx-rtd-theme>=1.3.0; extra == "docs"
Requires-Dist: sphinx-autodoc-typehints>=1.24.0; extra == "docs"
Provides-Extra: all
Requires-Dist: zstandard>=0.22.0; extra == "all"
Requires-Dist: openai<3,>=1.0.0; extra == "all"
Requires-Dist: anthropic>=0.18.0; extra == "all"
Requires-Dist: google-generativeai>=0.3.0; extra == "all"
Requires-Dist: langchain-core>=0.1.0; extra == "all"
Requires-Dist: langgraph>=0.0.20; extra == "all"
Requires-Dist: claude-agent-sdk>=0.0.10; extra == "all"
Requires-Dist: opentelemetry-api>=1.20.0; extra == "all"
Requires-Dist: opentelemetry-sdk>=1.20.0; extra == "all"
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.20.0; extra == "all"
Provides-Extra: integrations
Requires-Dist: langchain-core>=0.1.0; extra == "integrations"
Requires-Dist: langgraph>=0.0.20; extra == "integrations"
Requires-Dist: claude-agent-sdk>=0.0.10; extra == "integrations"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: project-url
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# Aigie Python SDK

[![PyPI Version](https://img.shields.io/pypi/v/aigie)](https://pypi.org/project/aigie/)
[![Python Version](https://img.shields.io/badge/python-3.10%2B-blue)](https://www.python.org/downloads/)
[![License: Proprietary](https://img.shields.io/badge/License-Proprietary-red.svg)](LICENSE)
[![CI](https://github.com/Kytte-AI/kytte-python-sdk/actions/workflows/ci.yaml/badge.svg)](https://github.com/Kytte-AI/kytte-python-sdk/actions/workflows/ci.yaml)

**Aigie** is the official Python SDK for **Kytte** -- the Autonomous Reliability Platform for Agentic AI.

> **Proprietary software.** Copyright (c) 2026 Kytte AI, Inc. All Rights Reserved.
> Use of the Aigie SDK requires a written agreement with Kytte AI, Inc. and a valid
> Kytte account. Not licensed for redistribution or modification.
> Contact: support@aigie.io

Kytte is a runtime reliability platform for agentic AI, built to address the core reason
most AI agents never reach production: non-deterministic runtime failures. Unlike reactive
observability tools, Kytte operates during execution -- proactively detecting and
autonomously remediating failed agent steps in real time, with no changes to your existing
infrastructure or agent architecture. The Aigie SDK is the integration layer that connects
your agents to the Kytte platform:

- **Detects** context drift and errors before they impact users
- **Fixes** issues automatically through self-healing workflows
- **Prevents** failures with predictive intervention

## Installation

```bash
pip install aigie
```

### With optional integrations

```bash
# Compression (recommended for production -- 50-90% bandwidth savings)
pip install aigie[compression]

# LLM providers
pip install aigie[openai]              # OpenAI
pip install aigie[anthropic]           # Anthropic Claude
pip install aigie[gemini]              # Google Gemini

# Agent frameworks
pip install aigie[langchain]           # LangChain
pip install aigie[langgraph]           # LangGraph
pip install aigie[claude-agent-sdk]    # Anthropic Claude Agent SDK

# Vector databases
pip install aigie[pinecone]            # Pinecone
pip install aigie[qdrant]              # Qdrant
pip install aigie[chromadb]            # ChromaDB
pip install aigie[weaviate]            # Weaviate
pip install aigie[vectordbs]           # All vector DBs

# Observability
pip install aigie[opentelemetry]       # OpenTelemetry inbound
pip install aigie[otlp]                # OTLP export

# Everything
pip install aigie[all]
```

## Quick start

### Decorator-based tracing (recommended)

```python
from aigie import traceable

@traceable(run_type="agent")
async def my_agent(query: str):
    result = await process_query(query)
    return result

result = await my_agent("What is the weather?")
```

### Auto-instrument LLM providers

```python
from aigie import wrap_openai, wrap_anthropic
from openai import AsyncOpenAI
from anthropic import AsyncAnthropic

# OpenAI -- all calls automatically traced with model, tokens, cost, latency
client = wrap_openai(AsyncOpenAI())
response = await client.chat.completions.create(
    model="gpt-4",
    messages=[{"role": "user", "content": "Hello!"}],
)

# Anthropic
client = wrap_anthropic(AsyncAnthropic())
```

### Context manager

```python
from aigie import Aigie, Config

config = Config(
    api_url="https://api.aigie.com",
    api_key="your-key",
    batch_size=100,
    flush_interval=5.0,
)

aigie = Aigie(config=config)
await aigie.initialize()

async with aigie.trace("My Workflow") as trace:
    async with trace.span("operation", type="llm") as span:
        result = await do_work()
        span.set_output({"result": result})
```

## Integrations

### Agent frameworks

| Framework | Install extra | Auto-instrument |
|-----------|--------------|-----------------|
| LangChain | `langchain` | `AigieCallbackHandler` |
| LangGraph | `langgraph` | `wrap_langgraph()` |
| Claude Agent SDK | `claude-agent-sdk` | `patch_claude_agent_sdk()` |

### LLM providers

| Provider | Wrapper |
|----------|---------|
| OpenAI | `wrap_openai()` |
| Anthropic | `wrap_anthropic()` |
| Google Gemini | `wrap_gemini()` |
| AWS Bedrock | `wrap_bedrock()` |

Each integration lives in `sdk/aigie/integrations/<framework>/` and follows a
consistent pattern with auto-instrumentation, cost tracking, drift detection,
error detection, retry logic, and session management. See
[CONTRIBUTING.md](CONTRIBUTING.md) for details on adding new integrations.

## Configuration

### Environment variables

```bash
export AIGIE_API_URL=https://your-instance.aigie.io/api
export AIGIE_API_KEY=your-api-key
export AIGIE_BATCH_SIZE=100
export AIGIE_FLUSH_INTERVAL=5.0
```

### Config object

```python
from aigie import Config

config = Config(
    api_url="https://api.aigie.com",   # Aigie API endpoint
    api_key="your-key",                # API key
    batch_size=100,                    # Events per batch (default: 10)
    flush_interval=5.0,               # Flush interval in seconds
    enable_buffering=True,            # Enable event buffering (default: True)
    max_retries=3,                    # Retry count on failure
)
```

## Advanced features

### OpenTelemetry integration

```python
from aigie import Aigie
from aigie.opentelemetry import setup_opentelemetry

aigie = Aigie()
await aigie.initialize()
setup_opentelemetry(aigie, service_name="my-service")

# All OTel spans now flow to Aigie
from opentelemetry import trace
tracer = trace.get_tracer(__name__)
with tracer.start_as_current_span("operation"):
    pass
```

### Evaluation and scoring

```python
from aigie import score, feedback

await score(trace_id, "accuracy", 0.95)
await feedback(trace_id, "user_feedback", "Great response!")
```

### Prompt management

```python
from aigie import Prompt

prompt = Prompt.chat(
    name="customer_support",
    messages=[{"role": "system", "content": "You are a helpful assistant."}],
    version="1.0",
)
```

### Synchronous API

```python
from aigie import AigieSync

aigie = AigieSync()
aigie.initialize()

with aigie.trace("workflow") as trace:
    with trace.span("operation") as span:
        result = do_work()
        span.set_output({"result": result})
```

### Zero data retention

Wrap a call in `aigie.no_retention()` to keep its execution data inside your
environment. Nothing about that run leaves it.

```python
from contextlib import nullcontext

ctx = aigie.no_retention() if request.zero_retention else nullcontext()
with ctx:
    result = app.invoke(state, config)
```

Use `aigie.no_retention_async()` in async code.

## API reference

Full API documentation is available at [docs.aigie.io/sdk/python](https://docs.aigie.io/sdk/python).

## Development

```bash
# Clone and set up
git clone https://github.com/Kytte-AI/kytte-python-sdk.git
cd kytte-python-sdk
python -m venv .venv
source .venv/bin/activate
pip install -e "sdk/[dev]"
```

### Common commands

```bash
make lint        # Run ruff linter
make format      # Format code with ruff
make test        # Run unit tests
make test-all    # Run all tests including integration
make coverage    # Run tests with coverage report
make typecheck   # Run mypy type checking
make check       # Run all checks (lint + test)
make build       # Build distribution packages
```

### Running tests

```bash
# Unit tests
pytest tests/unit/ -v

# Integration tests (requires API keys)
pytest tests/integration/ -v

# Coverage report
pytest tests/unit/ --cov=sdk/aigie --cov-report=html --cov-report=term-missing
```

## Publishing

Releases are published to [PyPI](https://pypi.org/project/aigie/) automatically
when a GitHub release is created, via the `publish.yaml` workflow.

Manual publishing is also supported:

```bash
./scripts/publish-sdk.sh <version>
# e.g. ./scripts/publish-sdk.sh 0.2.39
```

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.

## License

Proprietary -- Copyright (c) 2026 Kytte AI, Inc. All Rights Reserved. See [LICENSE](LICENSE) for details.

## Documentation

- [API Reference](https://docs.aigie.io/sdk/python)
- [Integration Guides](https://docs.aigie.io/integrations)
- [Changelog](./CHANGELOG.md)

## Related

| Repository | Description |
|-----------|-------------|
| [docs-site](https://github.com/Kytte-AI/docs-site) | Documentation site |

Website: https://kytte.ai/
