Skip to main content

ChainThread Python SDK

Open agent handoff protocol and verification infrastructure.

Install

pip install chainthread

Quick Start

from chainthread import ChainThread

ct = ChainThread()

# Create a chain
chain = ct.create_chain(
    name="my-agent-pipeline",
    description="Research to writer handoff"
)

# Send a handoff envelope
envelope = ct.send_envelope(
    chain_id=chain["chain_id"],
    sender_id="research-agent",
    sender_role="researcher",
    receiver_id="writer-agent",
    receiver_role="writer",
    payload={"summary": "AI is transforming software.", "confidence": 0.95},
    summary="Research complete, handing off to writer",
    provenance=[{"field": "summary", "source": "model_generated", "confidence": 0.95}],
    contract={
        "required_fields": ["summary", "confidence"],
        "assertions": [{"field": "confidence", "type": "range", "value": {"min": 0.0, "max": 1.0}}],
        "on_fail": "block"
    }
)

print(envelope["contract_passed"])
print(ct.stats())

Links

Download files

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

Source Distribution

chainthread-0.10.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

chainthread-0.10.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file chainthread-0.10.0.tar.gz.

File metadata

  • Download URL: chainthread-0.10.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for chainthread-0.10.0.tar.gz
Algorithm Hash digest
SHA256 fc54552dbb1884f7aa3ce75bffda0ecee3404f9a3ff92b8dd28bd6ca16139e46
MD5 96c0975f469abe51457d5ac4e7ae82b3
BLAKE2b-256 5a833e111f91f4bd5cb92c51cd04661ea919397a75e6cecb71af54926214f7ca

See more details on using hashes here.

File details

Details for the file chainthread-0.10.0-py3-none-any.whl.

File metadata

  • Download URL: chainthread-0.10.0-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for chainthread-0.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 945407dade330413b015eacc9a6df960ebfecbfb3760881a3c3421cd56ad42d6
MD5 9ee4ffc3a42c15b04649d37a67d820c9
BLAKE2b-256 483360c6e80e71d069c346ccc43f162b5c5f9261870e2ab1377285901d4acf74

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.10.0 This release

2 files

0.9.0

2 files

0.8.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 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