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.0.tar.gz (76.3 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.0-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tsunagi-0.1.0.tar.gz
  • Upload date:
  • Size: 76.3 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.0.tar.gz
Algorithm Hash digest
SHA256 5dae9febfa19d1b33eae03ece99c955b4388e836d6122f0b47bcb28526675e0b
MD5 80eb6dc875593df2de667e8c5d259ccc
BLAKE2b-256 ab56b69843bf22b963c712240de08835259f1f7d943653ad45b096c679a1aa30

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tsunagi-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dd87d3f4ebb858928709add0bd5128148895b01fdab90ac0e5ea48b71943e8e4
MD5 be0ef3896a4b65f3c4556f35d787b030
BLAKE2b-256 23d6c5584ba6fab46d61f0524f886908d68009d836d4fada32a18110e86da946

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