- SDK: client with BatchTransport, trace decorator/context manager, log_decision, thread-local context stack, nested trace→span support - API: POST /api/traces (batch ingest), GET /api/traces (paginated list), GET /api/traces/[id] (full trace with relations), GET /api/health - Tests: 8 unit tests for SDK (all passing) - Transport: thread-safe buffer with background flush thread
AgentLens Python SDK
AgentLens provides observability for AI agents by tracing decisions, not just API calls.
Installation
pip install agentlens
Quick Start
from agentlens import init, trace
# Initialize AgentLens
init(api_key="your-api-key", endpoint="https://agentlens.vectry.tech")
# Trace your agent functions
@trace(name="research-agent")
async def research(topic: str) -> str:
return f"Researching: {topic}"
Features
- Decision Tracing: Log and visualize agent decisions with alternatives
- Context Awareness: Monitor context window utilization
- Cost Intelligence: Track token usage and costs per operation
- Integrations: Native support for LangChain and OpenAI
Documentation
Full documentation available at https://agentlens.vectry.tech/docs
License
MIT © 2026 Vectry