Metadata-Version: 2.4
Name: ais-protocol
Version: 0.1.3
Summary: Agent Interface Standard - A protocol for AI agent-to-agent communication
Author-email: Mercola Consulting Services <manishk@mercola.com>
Maintainer-email: Mercola Consulting Services <manishk@mercola.com>
License: Apache-2.0
Project-URL: Homepage, https://github.com/ais-protocol/ais-python
Project-URL: Documentation, https://docs.ais-protocol.org
Project-URL: Repository, https://github.com/ais-protocol/ais-python
Project-URL: Issues, https://github.com/ais-protocol/ais-python/issues
Keywords: ai,agents,protocol,multi-agent,communication
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.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp>=3.9.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: python-dateutil>=2.8.0
Requires-Dist: jsonschema>=4.20.0
Requires-Dist: PyJWT>=2.8.0
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: black>=23.0.0; extra == "dev"
Requires-Dist: mypy>=1.7.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Dynamic: license-file

# AIS Protocol - Python SDK

**Agent Interface Standard (AIS)** is a protocol for AI agent-to-agent communication. Think "HTTP for AI agents" or "MCP for agent collaboration."

## Features

- 🚀 **Production-ready** - Battle-tested, type-safe, fully async
- 🔌 **Transport agnostic** - HTTP, WebSocket, or bring your own
- 🔐 **Secure by default** - JWT/API key auth, input validation, rate limiting
- 📦 **Easy to use** - <50 lines to create a basic agent
- 🔄 **Session management** - Stateful multi-turn interactions
- 📊 **Observable** - Structured logging and metrics built-in

## Quick Start

### Installation

```bash
pip install ais-protocol
```

### Create Your First Agent

```python
from ais import AISAgent

# Create agent
agent = AISAgent(
    agent_id="agent://example.com/my-agent",
    agent_name="My First Agent"
)

# Register a capability
@agent.capability(
    name="greet",
    description="Greet someone by name"
)
async def greet_handler(parameters, context, session):
    name = parameters.get("name", "World")
    return {"message": f"Hello, {name}!"}

# Start the agent
agent.start_sync(port=8000)
```

### Connect to an Agent

```python
from ais import AISClient

# Create client
client = AISClient(
    client_agent_id="agent://example.com/my-client"
)

# Connect to remote agent
session_id = await client.connect(
    server_url="http://localhost:8000",
    server_agent_id="agent://example.com/my-agent"
)

# Call a capability
result = await client.call(
    session_id=session_id,
    capability="greet",
    parameters={"name": "Alice"}
)

print(result)  # {"message": "Hello, Alice!"}
```

## Documentation

- [API Reference](docs/api/)
- [User Guide](docs/guides/)
- [Examples](examples/)
- [Protocol Specification](docs/protocol-spec.md)

## Status

**Version:** 0.1.0 (Alpha)
**Python:** 3.9+
**License:** Apache 2.0

## Development

### Setup

```bash
# Clone monorepo
git clone https://mercola-consulting-services.ghe.com/MCS/A2A-Protocol-AIS.git
cd A2A-Protocol-AIS/packages/python

# Install dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Format code
black src tests
ruff check src tests

# Type check
mypy src
```

## Contributing

This project is in active development. We welcome contributions!

## License

Apache License 2.0 - see [LICENSE](LICENSE) for details.

## Links

- [GitHub](https://github.com/ais-protocol/ais-python)
- [Documentation](https://docs.ais-protocol.org)
- [Issues](https://github.com/ais-protocol/ais-python/issues)
