Current collected state Current
Observed since 20 Oct, 22:34 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Python SDK for AgentLens — observability for AI agents
Python SDK for AgentLens — real-time observability and debugging for AI agents.
pip install agentlens-sdk
With framework extras:
pip install "agentlens-sdk[openai]"
pip install "agentlens-sdk[anthropic]"
pip install "agentlens-sdk[langchain]"
pip install "agentlens-sdk[all]"
Start the AgentLens server first:
pip install agentlens-server
agentlens-server
# Server running at http://localhost:8766
Then open the dashboard at http://localhost:5173.
from agentlens_sdk import auto_instrument
auto_instrument() # patches OpenAI + Anthropic clients automatically
# All subsequent OpenAI/Anthropic calls are traced — no other changes needed
import openai
client = openai.AsyncOpenAI()
response = await client.chat.completions.create(...)
from agentlens_sdk import init, trace
init(server_url="ws://localhost:8766/ws")
@trace(name="my_agent")
async def my_agent(query: str) -> str:
result = await call_llm(query)
return result
from agentlens_sdk import get_tracer
async def my_agent(query: str) -> str:
with get_tracer().span("my_agent") as span:
span.set_attribute("query", query)
result = await call_llm(query)
span.set_output(result)
return result
from agentlens_sdk.interceptors.langchain_interceptor import AgentLensCallbackHandler
handler = AgentLensCallbackHandler()
chain = my_chain.with_config(callbacks=[handler])
from agentlens_sdk import auto_instrument
auto_instrument() # CrewAI is auto-detected
from agentlens_sdk import auto_instrument
auto_instrument() # AutoGen ConversableAgent is auto-detected
from agentlens_sdk import init
init(
server_url="ws://localhost:8766/ws", # AgentLens server WebSocket URL
http_url="http://localhost:8766", # AgentLens server HTTP URL
session_name="my-agent-v2", # Optional: name shown in dashboard
)
api_key, token, password, secret, authorization are automatically replaced with [REDACTED].MIT
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.2.0 | 18 Mar 2026 | 8 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 22:34 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:c9ac14ff06a1cd35beb7457ead208252ef5c013feddac977f59d29ce35bce11e