Skip to main content

tantra logo

tantra

The agent actor runtime as a Python library. Install name tantra-harness, import name tantra.

Tantra gives each agent a durable FIFO inbox, an independent event journal, and one active turn. A process-wide Runtime owns providers, stores, tools, hooks, permissions, skills, memory, compaction, telemetry, actor tasks, and writer connections.

Install

Command Adds
pip install tantra-harness Core runtime and shell tools
pip install "tantra-harness[web]" Brave web search and web fetch
pip install "tantra-harness[doc]" PDF and Word document reading
pip install "tantra-harness[postgres]" PostgreSQL storage
pip install "tantra-harness[telemetry]" OpenTelemetry tracing

The unrelated PyPI project tantra installs the same import name. Do not install both projects in one environment.

Basic usage

import asyncio
from uuid import uuid4

from tantra import Agent, OpenAICompatible, Runtime, SQLiteStore
from tantra.extratools.web import web_search


class Researcher(Agent):
    model = "gpt-5"
    prompt = "Answer with current, sourced information."
    tools = [web_search(api_key=BRAVE_API_KEY)]


async def main() -> None:
    store = SQLiteStore("sessions.db")
    await store.setup()
    runtime = Runtime(
        OpenAICompatible("https://api.openai.com/v1", OPENAI_API_KEY),
        store,
        [Researcher],
    )
    root_id = await runtime.create(Researcher)
    async with runtime.connect(root_id, writable=True) as connection:
        result = await connection.prompt(
            "What changed in Python 3.13?",
            command_id=uuid4(),
        )
    print(result.text)
    await runtime.aclose()


asyncio.run(main())

Connection.prompt() accepts a durable command and waits for its terminal result. For streaming, call send() and iterate the connection. Reconnect with the last scalar seq as after; use Runtime.events() for a child journal. Command IDs are UUIDs and make acceptance idempotent.

Subagents are independent actors. Models use the injected spawn, send, and finish tools; no parent stream merges child events. A live typed ask suspends only its actor turn and must be answered through the current writable root connection.

See the documentation and the 1.0 migration guide.

Reference app

apps/sarathi is the repository's interactive web application.

License

Apache-2.0

Metadata

Release files for tantra-harness 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tantra-harness 1.0.0
File Size Uploaded
tantra_harness-1.0.0.tar.gz 164.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tantra-harness 1.0.0
File Interpreter ABI Platform
tantra_harness-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 250.6 kB

Release files / tantra_harness-1.0.0.tar.gz

Download URL tantra_harness-1.0.0.tar.gz
Size 164.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1fc8f52c79597e962bc2de2b9aa6170bdaf1e9f3704f4b35c0646a03edf1f08c
BLAKE2b-256 checksum
How to use checksums
63a4a2c2a13866c04e8120aa50b629ea2ff08a8587d8843384c98d8405c64a5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.

Transparency log

Release files / tantra_harness-1.0.0-py3-none-any.whl

Download URL tantra_harness-1.0.0-py3-none-any.whl
Size 86.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8a95ebbd7d9a0e6aeb4ed4d67abfae51bdedb2161d8ddcc8470b0021162fb77b
BLAKE2b-256 checksum
How to use checksums
42141d8e363fda9a5004e38822f9f4675387297b952cd64d5db8441d005b978c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.

Transparency log

Release history Release notifications | RSS feed

2.0.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

This release

1.0.0 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page