Skip to content

Quickstart

Get AgentLens running in under 5 minutes.

Terminal window
docker run -p 3000:3000 tranhoangtu/agentlens-observe:0.5.0

Open http://localhost:3000 — login with admin@agentlens.local / changeme.

Terminal window
pip install agentlens-observe
import agentlens
agentlens.configure(server_url="http://localhost:3000")
@agentlens.trace(name="ResearchAgent")
def run_agent(query: str) -> str:
with agentlens.span("web_search", "tool_call") as s:
result = search(query)
s.set_output(result)
s.set_cost("gpt-4o", input_tokens=500, output_tokens=200)
return summarize(result)
run_agent("Latest AI research papers")
# → Traces stream to http://localhost:3000

Navigate to http://localhost:3000 — your agent runs appear instantly with the interactive topology graph.

Your Agent (Python/TS) AgentLens Server Browser Dashboard
│ │ │
├── @agentlens.trace ──────► POST /api/traces ───────► Live topology graph
│ (fire-and-forget) │ │
│ flush_span() ──────────► POST /api/traces/:id/spans► Real-time node updates
│ │ │
Any OTel App ────────────────────► POST /api/otel/v1/traces ► Same dashboard
│ (OTLP HTTP JSON) │ │
│ ├── SSE stream ──────────► span_created events
│ │ │
└── Never blocked └── SQLite/PostgreSQL └── Cost breakdown + diff