Skip to main content

SDK-first orchestration framework for AI pipelines and agents

Project description

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):

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

Using uv for dependency management:

uv add tsunagi
uv add "tsunagi[otel]"

For local development with extras:

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

Quick Start

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tsunagi-0.1.1.tar.gz (55.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tsunagi-0.1.1-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file tsunagi-0.1.1.tar.gz.

File metadata

  • Download URL: tsunagi-0.1.1.tar.gz
  • Upload date:
  • Size: 55.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for tsunagi-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4ee8da74a853ead6d308ae79c0819e7f8362bb827d3d7f36f29bc406c1267240
MD5 79fee7715a7f3da9c1e45abafa23f44c
BLAKE2b-256 636a75cd34118ca5f4244005468849b193ea7785c007beb76073b18813e9aa6f

See more details on using hashes here.

File details

Details for the file tsunagi-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tsunagi-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for tsunagi-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b47de96d9679157f097e2b05f73e82bf32164afa94cc26adadbc79c25c3e8073
MD5 9723bcf557ede3ec648c87e6e0e5d2d1
BLAKE2b-256 a46d72eb8d1898538a2c141e7c326bc5f2864e2b7694bcb6647915de10b0f642

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page