Python observability SDK for agentic systems
Project description
AgentInsight Python SDK
Drop-in observability for agentic systems. The SDK records agent, LLM, tool, retrieval, orchestration, and custom spans, then exports them locally or to an AgentInsight backend.
Install
pip install agentinsight
For local development from this repository:
pip install -e sdk
Quick Start
import agentinsight
import openai
agentinsight.init(
service_name="support-agent",
exporter="cloud",
endpoint="https://your-agentinsight-app.vercel.app",
api_key="ai_...",
)
client = openai.OpenAI()
response = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Hello"}],
)
OpenAI and Anthropic calls are automatically traced when those packages are
installed. Use @observe and trace_context for custom agent logic.
Local Export
import agentinsight
from agentinsight import observe
agentinsight.init(exporter="local", local_path="agentinsight-spans.jsonl")
@observe(kind="agent")
def run_agent(task: str):
return {"answer": task.upper()}
run_agent("triage this incident")
Manual Spans
from agentinsight import trace_context
with trace_context("plan_trip", kind="agent", attributes={"agent.name": "planner"}) as span:
span.set_attribute("agent.step", "plan")
LangChain / LangGraph
from agentinsight.integrations.langchain import AgentInsightCallbackHandler
handler = AgentInsightCallbackHandler()
chain.invoke({"input": "hello"}, config={"callbacks": [handler]})
LangGraph uses LangChain callbacks, so the same handler works for many LangGraph apps.
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 agentinsight-0.1.0a1.tar.gz.
File metadata
- Download URL: agentinsight-0.1.0a1.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
799cc52bd44ebafa98ef1aa3a22f44d115b5d4a35034ba4b88f83f2b2abef109
|
|
| MD5 |
88938369b71f91681c41eb1d371b6bcb
|
|
| BLAKE2b-256 |
1c9d4d6d10f8efee8102ad3024a3be317e98b76e9d9bd1c93d7c34389368cd7d
|
File details
Details for the file agentinsight-0.1.0a1-py3-none-any.whl.
File metadata
- Download URL: agentinsight-0.1.0a1-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48914d61c4037bffd4393af9a0d1daa2f2861ac0eda249bd188398209b1c4a9d
|
|
| MD5 |
33bdcf990ff77abe8d7c046194f9a69a
|
|
| BLAKE2b-256 |
f24f4973adad9cbd79237162ac211a0a96e64d931ebe28bf021a0f9bfe7059cd
|