AgentTrail Python SDK — observability for agentic AI systems
Project description
AgentTrail Python SDK
Client library for tracing agent and LLM workloads: it records spans and sends them to your ingestion endpoint (POST {base_url}/v1/spans). It does not include a server, database, or UI—only instrumentation and export.
Install (PyPI)
pip install agenttrail-sdk
LangGraph, OpenAI, and Anthropic clients are dependencies of this package—customers install once; new framework support ships in new SDK releases, not separate extras.
Developers can use uv with this repo: see pyproject.toml and uv.lock.
Quick usage
Set base_url to your span ingestion service, or set the environment variable AGENTTRAIL_BASE_URL (default if both omitted: http://127.0.0.1:8080).
from agenttrail import init, shutdown
init(
api_key="your-api-key",
project="my-agent",
base_url="https://ingest.example.com",
)
try:
... # app / agents
finally:
shutdown()
By default, init() auto-instruments LangGraph (invoke / ainvoke / stream / astream), OpenAI chat.completions.create, and Anthropic messages.create. Use auto_instrument=False to disable.
Docs
Links use the GitHub repository so they work from PyPI and from this checkout.
| Doc | Purpose |
|---|---|
| QUICKSTART | Examples (LangGraph, OpenAI, Anthropic, manual spans) |
| CONNECTOR_SPEC | Building third-party connectors |
| TESTING | Automated checks and manual smoke tests |
| PUBLISHING | PyPI release (uv build, uv publish) |
| SDK_Plan | Internal roadmap / program context |
Development
cd /path/to/repo # repository root containing pyproject.toml
uv sync
uv run pytest
uv run ruff check src tests
uv run ruff format --check src tests
uv run mypy src
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agenttrail_sdk-0.1.0.tar.gz.
File metadata
- Download URL: agenttrail_sdk-0.1.0.tar.gz
- Upload date:
- Size: 80.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee7b35ee873843cd4dbd9a9696cc8b7b0458b955e96e8ba1ad38ab3cbfeac4cd
|
|
| MD5 |
11649667ca04a36636224568203b3e62
|
|
| BLAKE2b-256 |
51506e06d7c89526cdaec1a2a72ffea17e7fc12fe7761575f73fe42bb14bab39
|
File details
Details for the file agenttrail_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: agenttrail_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 22.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c39c5e9df63e2a12d94d6ff3f7cabb17779a58ccf93205296223a5a288bbca64
|
|
| MD5 |
0b4c5b0791e4ecf11d3c2f5bb138beb3
|
|
| BLAKE2b-256 |
817db7c38a268397b64266cbff83b4e6a7a2adad5924a8a28e96447ce00dd114
|