Metadata-Version: 2.4
Name: uass
Version: 0.2.0
Summary: Unified Agent State System - Cross-framework state management for AI agents
Author: UASS Contributors
License: MIT
Project-URL: Homepage, https://github.com/yourusername/uass
Project-URL: Documentation, https://github.com/yourusername/uass/docs
Project-URL: Repository, https://github.com/yourusername/uass
Keywords: ai,agents,state-management,langgraph,autogen,crewai
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.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: redis>=4.5.0
Provides-Extra: postgresql
Requires-Dist: psycopg2-binary>=2.9.0; extra == "postgresql"
Provides-Extra: hybrid
Requires-Dist: psycopg2-binary>=2.9.0; extra == "hybrid"
Provides-Extra: mcp
Requires-Dist: mcp>=0.1.0; extra == "mcp"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Provides-Extra: test
Requires-Dist: pytest>=7.0.0; extra == "test"
Requires-Dist: pytest-cov>=4.0.0; extra == "test"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "test"
Requires-Dist: langgraph>=0.0.1; extra == "test"
Requires-Dist: langchain-core>=0.1.0; extra == "test"
Requires-Dist: langchain>=0.1.0; extra == "test"
Provides-Extra: all
Requires-Dist: psycopg2-binary>=2.9.0; extra == "all"
Requires-Dist: pytest>=7.0.0; extra == "all"
Requires-Dist: pytest-cov>=4.0.0; extra == "all"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "all"
Requires-Dist: black>=23.0.0; extra == "all"
Requires-Dist: mypy>=1.0.0; extra == "all"
Requires-Dist: ruff>=0.1.0; extra == "all"
Dynamic: license-file

# UASS - Unified Agent State System

A universal state management system that enables cross-framework communication between AI agent frameworks (LangGraph, AutoGen, CrewAI, etc.) through a unified state store.

## Architecture

```
┌─────────────────────────────────────────────────────────────┐
│                    Framework Layer                           │
│  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌──────────┐   │
│  │LangGraph │  │ AutoGen  │  │ CrewAI   │  │  Custom  │   │
│  └────┬─────┘  └────┬─────┘  └────┬─────┘  └────┬─────┘   │
│       │             │              │             │          │
│       └─────────────┴──────────────┴─────────────┘          │
│                          │
└─────────────────────────────────────────────────────────────┘
                          │
                          ▼
┌─────────────────────────────────────────────────────────────┐
│                    UASS SDK Layer                            │
│  ┌──────────────────────────────────────────────────────┐   │
│  │         Unified State API (Python/TypeScript)        │   │
│  └──────────────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────────────┘
                          │
                          ▼
┌─────────────────────────────────────────────────────────────┐
│                    Backend Layer                             │
│  ┌──────────┐  ┌──────────┐  ┌──────────┐                  │
│  │  Redis   │  │PostgreSQL│  │  Memory  │  (pluggable)     │
│  └──────────┘  └──────────┘  └──────────┘                  │
└─────────────────────────────────────────────────────────────┘
```

## Features

- **Unified State Schema**: Standardized state format across all frameworks
- **Cross-Framework Communication**: Any node from any framework can read/write state
- **Pluggable Backends**: Redis, PostgreSQL, in-memory, etc.
- **Framework Adapters**: Easy integration with LangGraph, AutoGen, CrewAI
- **MCP Protocol Support**: Native Model Context Protocol server for AI-native access
- **Type Safety**: Full type definitions for state structures
- **Session Management**: Multi-session support with isolation
- **State Versioning**: Track state changes over time

## 🚀 Try it in 30 Seconds (Zero Setup)

Want to see it in action without installing Redis? Run our zero-setup quickstart script:

```bash
python3 quickstart.py
```

This simulates two agents talking to each other using the in-memory backend.

## Quick Start (Production)

```python
from uass import UASSClient, RedisBackend

# Initialize client
client = UASSClient(backend=RedisBackend(host='localhost', port=6379))

# Write state from any framework
client.write_state(
    session_id="session_123",
    agent_id="agent_1",
    framework="langgraph",
    state={"tokens": 100, "context": "processing..."}
)

# Read state from any other framework
state = client.read_state("session_123", "agent_1")
```

## Backend Options

UASS supports multiple backends - choose based on your needs:

### Redis (Default - Best for Real-time)
```python
from uass import UASSClient, RedisBackend
client = UASSClient(backend=RedisBackend())
```
**Best for:** Real-time access, high-frequency updates, pub/sub events

### PostgreSQL (Best for Analytics)
```python
from uass import UASSClient, PostgreSQLBackend
client = UASSClient(backend=PostgreSQLBackend())
```
**Best for:** Complex queries, large states, analytics, ACID transactions

### Hybrid (Best of Both Worlds)
```python
from uass import UASSClient, RedisBackend, PostgreSQLBackend, HybridBackend
redis = RedisBackend()
postgres = PostgreSQLBackend()
client = UASSClient(backend=HybridBackend(redis, postgres))
```
**Best for:** Production systems needing both speed and analytics

### Memory (Testing Only)
```python
from uass import UASSClient, MemoryBackend
client = UASSClient(backend=MemoryBackend())
```
**Best for:** Development and testing

See [Backend Comparison Guide](docs/BACKEND_COMPARISON.md) for detailed recommendations.

## Installation

### Basic Installation

```bash
pip install uass
```

This installs UASS with Redis support (default backend).

### Optional Dependencies

```bash
# With PostgreSQL support
pip install uass[postgresql]

# With hybrid backend (Redis + PostgreSQL)
pip install uass[hybrid]

# With test dependencies (includes LangGraph for integration tests)
pip install uass[test]

# With all optional dependencies
pip install uass[all]
```

### For Development

```bash
# Clone repository
git clone https://github.com/yourusername/uass.git
cd uass

# Install in development mode
pip install -e .

# Install test dependencies (includes LangGraph, etc.)
pip install -r requirements-test.txt
```

See [INSTALL.md](INSTALL.md) for detailed installation instructions.

## Testing

### Unit Tests (No Dependencies)

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

### Integration Tests (Requires Frameworks)

```bash
# Install test dependencies first
pip install -r requirements-test.txt

# Run integration tests
pytest tests/integration/ -v
```

## Documentation

- [Installation Guide](INSTALL.md)
- [Quick Start Guide](docs/QUICKSTART.md)
- [MCP Integration](docs/MCP_INTEGRATION.md)
- [Backend Comparison](docs/BACKEND_COMPARISON.md)
- [Backend Recommendations](docs/BACKEND_RECOMMENDATION.md)
- [State Schema Reference](docs/STATE_SCHEMA.md)
- [Architecture Overview](docs/ARCHITECTURE.md)

## Examples

- [Basic Usage](examples/basic_usage.py)
- [Cross-Framework Communication](examples/cross_framework.py)
- [Token Tracking](examples/token_tracking.py)
- [LangGraph Integration](examples/langgraph_integration_example.py)

