Skip to main content

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 opentelemetry patterns 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.

Release files for agent-obs-sdk 0.1.2

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

Source distribution (sdist)

Source distribution for agent-obs-sdk 0.1.2
File Size Uploaded
agent_obs_sdk-0.1.2.tar.gz 5.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agent-obs-sdk 0.1.2
File Interpreter ABI Platform
agent_obs_sdk-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 13.5 kB

Release files / agent_obs_sdk-0.1.2.tar.gz

Download URL agent_obs_sdk-0.1.2.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
875e8146fbd3b5250a006ced541865f353884d4060f6324c7d749df5f81224e4
BLAKE2b-256 checksum
How to use checksums
d106638a41a8afb440da788ad550b6cd0b0042567c0e929398eed462543f2219
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / agent_obs_sdk-0.1.2-py3-none-any.whl

Download URL agent_obs_sdk-0.1.2-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ae091a5721d75263ad9b43aac0566fc919e29937a6e6805bdfc14f41f637a99a
BLAKE2b-256 checksum
How to use checksums
1cf8bddb7d190ddfc939f1725ea797c978e20e40b8d4bbbb0932a4b13239a709
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

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