Agentreplay is a high-performance observability and tracing platform for LLM agents and AI apps, combining semantic search, specialized evals (RAGAS, G-Eval, toxicity), and Git-like versioning of prompts and responses.
Project description
Agent Replay Python SDK
Python SDK for Agent Replay - A purpose-built agent trace engine for LLM agents.
Installation
pip install agentreplay
With Framework Integrations
# Install specific framework integrations
pip install agentreplay[langchain] # LangChain / LangGraph
pip install agentreplay[llamaindex] # LlamaIndex
pip install agentreplay[openai-agents] # OpenAI Agents SDK
pip install agentreplay[autogen] # Microsoft AutoGen
pip install agentreplay[semantic-kernel] # Semantic Kernel
pip install agentreplay[crewai] # CrewAI
pip install agentreplay[smolagents] # Hugging Face smolagents
pip install agentreplay[pydantic-ai] # PydanticAI
pip install agentreplay[strands] # AWS Strands Agents
pip install agentreplay[google-adk] # Google ADK
# Or install all framework integrations at once
pip install agentreplay[all-frameworks]
# For development (includes all frameworks + dev tools)
pip install agentreplay[all]
Quick Start
from agentreplay import AgentreplayClient, SpanType
# Initialize client
client = AgentreplayClient(
url="http://localhost:47100",
tenant_id=1,
project_id=0
)
# Log a trace
with client.trace(span_type=SpanType.ROOT) as root:
# Planning step
with root.child(SpanType.PLANNING) as planning:
planning.set_token_count(50)
planning.set_confidence(0.95)
# Tool call
with root.child(SpanType.TOOL_CALL) as tool:
tool.set_token_count(20)
tool.set_duration_ms(150)
# Final response
with root.child(SpanType.RESPONSE) as response:
response.set_token_count(80)
response.set_confidence(0.94)
# Query traces
edges = client.query_temporal_range(
start_timestamp_us=start_time,
end_timestamp_us=end_time
)
# Get causal relationships
children = client.get_children(edge_id)
ancestors = client.get_ancestors(edge_id)
Framework Integrations
Agent Replay provides seamless integrations for all major AI agent frameworks:
Supported Frameworks
| Framework | Install | Documentation |
|---|---|---|
| LangChain / LangGraph | pip install agentreplay[langchain] |
Chains, agents, workflows |
| LlamaIndex | pip install agentreplay[llamaindex] |
Query engines, agents, workflows |
| OpenAI Agents SDK | pip install agentreplay[openai-agents] |
Agent wrappers, sessions |
| Microsoft AutoGen | pip install agentreplay[autogen] |
Multi-agent conversations |
| Semantic Kernel | pip install agentreplay[semantic-kernel] |
Kernel functions, planners |
| CrewAI | pip install agentreplay[crewai] |
Crews, tasks, collaboration |
| Hugging Face smolagents | pip install agentreplay[smolagents] |
Code agents, tool calling |
| PydanticAI | pip install agentreplay[pydantic-ai] |
Type-safe agents |
| Strands Agents | pip install agentreplay[strands] |
AWS agents, multi-provider |
| Google ADK | pip install agentreplay[google-adk] |
Gemini agents |
Quick Integration Examples
LangChain
from agentreplay.integrations.langchain import Agent ReplayCallbackHandler
from langchain.chains import LLMChain
callback = Agent ReplayCallbackHandler(
url="http://localhost:8080",
tenant_id=1
)
chain = LLMChain(llm=llm, callbacks=[callback])
result = chain.run("What is the weather?")
LlamaIndex
from agentreplay.integrations.llamaindex import create_callback_manager
from llama_index.core import VectorStoreIndex
callback_manager = create_callback_manager(
agentreplay_url="http://localhost:8080",
tenant_id=1
)
index = VectorStoreIndex.from_documents(
documents,
callback_manager=callback_manager
)
OpenAI Agents SDK
from agentreplay.integrations.openai_agents import Agent ReplayAgentWrapper
from openai_agents import Agent
agent = Agent(name="assistant", instructions="You are helpful")
wrapped = Agent ReplayAgentWrapper(
agent=agent,
agentreplay_url="http://localhost:8080",
tenant_id=1
)
session = wrapped.create_session()
response = wrapped.run(session, "Hello!")
PydanticAI
from agentreplay.integrations.pydantic_ai import wrap_pydantic_ai_agent
from pydantic_ai import Agent
agent = Agent("openai:gpt-4")
agent = wrap_pydantic_ai_agent(
agent,
agentreplay_url="http://localhost:8080",
tenant_id=1
)
result = agent.run_sync("Process this request")
📚 For detailed integration guides and examples, see INTEGRATIONS.md
Features
Core SDK
- Low-level API: Direct control over edge creation and querying
- Context Managers: Pythonic span tracking with automatic parent-child relationships
- Async Support: Full async/await support for high-performance applications
- Type Safety: Full type hints and Pydantic models
- Causal Queries: Navigate agent reasoning graphs
- Semantic Search: Find similar traces using vector embeddings
Framework Integrations (New in v2.0!)
- 10+ Framework Support: LangChain, LlamaIndex, OpenAI Agents, AutoGen, and more
- Automatic Tracking: LLM calls, token usage, costs, and execution timing
- OpenTelemetry GenAI: Full semantic conventions support
- Production Ready: Async/sync, error resilience, connection pooling
- Zero Code Changes: Wrap existing agents with minimal modifications
Documentation
- Quick Start: See above and examples/
- Framework Integrations: INTEGRATIONS.md
- Full API Documentation: https://docs.agentreplay.dev/python-sdk
- Examples:
License
Apache License 2.0 - Copyright 2025 Sushanth (https://github.com/sushanthpy)
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 agentreplay-0.1.2.tar.gz.
File metadata
- Download URL: agentreplay-0.1.2.tar.gz
- Upload date:
- Size: 70.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
095290ec76c25e3f56708d1f6b69b6e277c4b19df4c8769411c45e3bfc010a40
|
|
| MD5 |
1ce325d5ccaef9c8d38854278ecf53ac
|
|
| BLAKE2b-256 |
309e35ce5297421066bbaa96b9faaf0868a7d9ea86beccab36798223bdbe2d3f
|
Provenance
The following attestation bundles were made for agentreplay-0.1.2.tar.gz:
Publisher:
release-pypi.yml on agentreplay/agentreplay
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentreplay-0.1.2.tar.gz -
Subject digest:
095290ec76c25e3f56708d1f6b69b6e277c4b19df4c8769411c45e3bfc010a40 - Sigstore transparency entry: 891571291
- Sigstore integration time:
-
Permalink:
agentreplay/agentreplay@2b817ae84989cb46793a7c80210b17599dcfde66 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/agentreplay
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@2b817ae84989cb46793a7c80210b17599dcfde66 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file agentreplay-0.1.2-py3-none-any.whl.
File metadata
- Download URL: agentreplay-0.1.2-py3-none-any.whl
- Upload date:
- Size: 85.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7dcd1ca1d8a2c8425169c7f54bf2e127946ebab5c521a65b64fd5e0cfb8baab
|
|
| MD5 |
1f9033eb1d32b13092e21a276af18322
|
|
| BLAKE2b-256 |
6507473624c4e103dda46062a100e87a97245b551522c3bf844e50af79985215
|
Provenance
The following attestation bundles were made for agentreplay-0.1.2-py3-none-any.whl:
Publisher:
release-pypi.yml on agentreplay/agentreplay
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentreplay-0.1.2-py3-none-any.whl -
Subject digest:
c7dcd1ca1d8a2c8425169c7f54bf2e127946ebab5c521a65b64fd5e0cfb8baab - Sigstore transparency entry: 891571357
- Sigstore integration time:
-
Permalink:
agentreplay/agentreplay@2b817ae84989cb46793a7c80210b17599dcfde66 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/agentreplay
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@2b817ae84989cb46793a7c80210b17599dcfde66 -
Trigger Event:
workflow_dispatch
-
Statement type: