Metadata-Version: 2.4
Name: corti-agent-sdk
Version: 0.1.0
Summary: Python SDK for building, deploying, and observing autonomous agents on the Corti runtime — tools, memory, guardrails, tracing.
Author: 
License: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# corti-agent-sdk

`corti-agent-sdk` is the Python SDK for building, deploying, and observing autonomous agents on the [Corti](https://corti.ai) runtime. It provides the primitives Corti expects — tool definitions, memory stores, guardrails, and hand-offs — and a typed client for running agents locally, in a sandbox, or against the Corti hosted control plane.

## Features

- Define agents with typed tools, schemas, and system prompts as dataclasses.
- Run agents locally or dispatch them to a Corti sandbox for isolation.
- First-class memory: short-term scratchpad and long-term vector memory.
- Guardrails and policy hooks for input/output validation and PII redaction.
- Structured tracing and span emission compatible with OpenTelemetry.
- Streaming token, tool-call, and step events for live UIs.

## Installation

```bash
pip install corti-agent-sdk
```

## Quick start

```python
from corti_agent_sdk import Agent, tool, run

@tool
def get_order(order_id: str) -> dict:
    """Look up a customer order."""
    return {"id": order_id, "status": "shipped"}

agent = Agent(
    name="support",
    instructions="You are a helpful support agent. Use tools before answering.",
    tools=[get_order],
)

for event in run(agent, "Where is order 1042?"):
    print(event.type, event.payload)
```

## API

- `Agent(name, instructions, tools, memory=..., guardrails=...)` — agent definition.
- `@tool` — decorator that registers a function as a typed, schema-derived tool.
- `run(agent, input, stream=True)` — execute an agent, yielding step and token events.
- `CortiClient(api_key=...)` — control-plane client for deploying and monitoring agents.

## Configuration

Set `CORTI_API_KEY` to use the hosted control plane. Local runs need no key.

## License

MIT
