Metadata-Version: 2.4
Name: tsunagi
Version: 0.1.1
Summary: SDK-first orchestration framework for AI pipelines and agents
Project-URL: Homepage, https://github.com/runtakun/tsunagi
Project-URL: Repository, https://github.com/runtakun/tsunagi
License: MIT
License-File: LICENSE
Keywords: agents,ai,orchestration,pipelines
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.11
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Provides-Extra: otel
Requires-Dist: opentelemetry-api>=1.20; extra == 'otel'
Requires-Dist: opentelemetry-sdk>=1.20; extra == 'otel'
Description-Content-Type: text/markdown

# Tsunagi

SDK-first orchestration framework for AI pipelines and agents. Tsunagi keeps SDK calls
as plain user code while adding composition, retry, timeout, and tracing.

## Installation

Install as a standard library (from PyPI or a local checkout):

```bash
pip install tsunagi
# or include optional extras, e.g. tracing
pip install "tsunagi[otel]"
```

Using [uv](https://docs.astral.sh/uv/) for dependency management:

```bash
uv add tsunagi
uv add "tsunagi[otel]"
```

For local development with extras:

```bash
pip install -e .[dev]
uv pip install -e .[dev]
```

## Quick Start

```python
from tsunagi import Pipeline, step


@step
async def add_one(x: int) -> int:
    return x + 1


@step
async def double(x: int) -> int:
    return x * 2


pipe = Pipeline("basic")
result = await pipe.run(add_one >> double, input=3)
print(result)  # 8
```

## Design Philosophy

- **SDK-first**: You call OpenAI/Anthropic/Qdrant directly. Tsunagi never wraps SDKs.
- **Opt-in extras**: Tracing, retry, and timeouts are explicit. No hidden behavior.
- **Zero runtime deps**: Core relies only on Python standard library.
- **Small pieces**: Decorators and adapters stay short and readable (<400 lines).

## API Highlights

- `@step`: Wrap async functions for pipeline use; direct calls stay untouched.
- `Pipeline`: Run steps sequentially or in parallel with tracing and context.
- `RetryConfig`: Per-step retry/backoff configuration.
- `Tracer`: Protocol for observability; includes `NullTracer` and `StdoutTracer`.
- `@tool` and `Agent`: Register async tools and drive LLM tool-use loops via adapters.

## Comparing with LangChain

- Tsunagi keeps SDK calls unwrapped; LangChain introduces wrappers and abstractions.
- No built-in chunking, parsing, or vector store layers — your code, your logic.
- Minimal surface area: a handful of decorators and classes instead of large class hierarchies.

## Examples

See `examples/` for pipelines, agents with tools, custom tracers, and RAG sketches. API-key
dependent examples are annotated accordingly.
