Lightweight Python SDK for Agent Observability Tracing — instruments multi-agent AI workflows
Project description
Agent Trace SDK (agent-obs-sdk)
Welcome to the Agent Trace SDK!
This is the official, lightweight Python library for connecting your AI agent swarms to the Agent Observability Tracing Platform.
The Core Idea
As AI workflows become increasingly complex—incorporating multiple specialized agents, chained LLM calls, and asynchronous interactions—debugging and observability become critical challenges. It's often difficult to answer questions like:
- Why did Agent A hand off control to Agent B instead of Agent C?
- What specific prompt sequence caused the LLM to hallucinate?
- How long did the retrieval step take compared to generation?
Agent Trace SDK solves this. It provides drop-in observability for multi-agent workflows, letting you trace logic execution, tool calls, token usage, and latency seamlessly. By simply decorating your agent functions, you gain deep visibility via our interactive tracing dashboard.
Key Features
- Zero-Friction Integration: Start tracing with just a single decorator (
@trace_agent()). - Framework Agnostic but LangChain Friendly: Works out-of-the-box with any standard Python functions, with optional extensions specifically for LangChain workflows.
- Deep Visibility: Captures inputs, outputs, execution time, and any intermediate states.
- OpenTelemetry Based: Built on standard
opentelemetrypatterns for robust, reliable metric delivery. - Hierarchical Traces: Automatically links parent-child agent workflows for easy debugging of Swarm/Agent hierarchies.
Installation
Getting started is as easy as installing via pip:
pip install agent-obs-sdk
(Optional) If you are using LangChain, you can install the specific extras:
pip install "agent-obs-sdk[langchain]"
Quick Start & Usage
Below is a minimal setup that shows how you can start tracing an agent and tracking its outputs.
import os
from agent_trace import trace_agent, configure
# 1. Configure the SDK with your platform credentials
configure(
api_endpoint=os.getenv("AGENT_OBS_ENDPOINT", "http://localhost:8000"),
api_key=os.getenv("AGENT_OBS_API_KEY", "YOUR_API_KEY"),
project_id="YOUR_PROJECT_SLUG",
)
# 2. Decorate your agent functions
@trace_agent(agent_name="GreetingAgent")
def my_agent(query: str):
"""A conversational agent that processes a user's query."""
print(f"Agent is reasoning about '{query}'...")
# ... complex LLM calls or tool invocations here ...
return f"Processed Response to: {query}"
if __name__ == "__main__":
reply = my_agent("Hello, can you help me plan a trip?")
print(reply)
Configuration Options
You can configure the SDK using the configure() function, or via environment variables (which are automatically picked up):
AGENT_OBS_ENDPOINT/api_endpoint: The base URL of the Agent Observability Platform.AGENT_OBS_API_KEY/api_key: Your secret token.AGENT_OBS_PROJECT_ID/project_id: Distinguishes traces across multiple projects.
Contributing
We welcome issues, feature requests, and pull requests! Let's build the future of AI Agent Observability together.
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 agent_obs_sdk-0.1.2.tar.gz.
File metadata
- Download URL: agent_obs_sdk-0.1.2.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
875e8146fbd3b5250a006ced541865f353884d4060f6324c7d749df5f81224e4
|
|
| MD5 |
f0b1fa04fb3c8582703dd51f72c8b226
|
|
| BLAKE2b-256 |
d106638a41a8afb440da788ad550b6cd0b0042567c0e929398eed462543f2219
|
File details
Details for the file agent_obs_sdk-0.1.2-py3-none-any.whl.
File metadata
- Download URL: agent_obs_sdk-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae091a5721d75263ad9b43aac0566fc919e29937a6e6805bdfc14f41f637a99a
|
|
| MD5 |
78d7aef7474b36f79f2520e38d343820
|
|
| BLAKE2b-256 |
1cf8bddb7d190ddfc939f1725ea797c978e20e40b8d4bbbb0932a4b13239a709
|