agentlens-observe
Debug AI agents visually — Python SDK for AgentLens, the self-hosted AI agent observability platform.
Install
pip install agentlens-observe
Quick Start
import agentlens
agentlens.configure(server_url="http://localhost:8000")
@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 your AgentLens dashboard
Features
- 2-line integration —
@agentlens.tracedecorator +agentlens.span()context manager - Fire-and-forget — never blocks your agent (daemon thread transport)
- Async-safe — uses
contextvars.ContextVarfor trace propagation - Cost tracking — built-in pricing for 12+ models (GPT-4o, Claude, etc.)
- Framework integrations — LangChain, CrewAI
Framework Integrations
LangChain / LangGraph
from agentlens.integrations.langchain import AgentLensCallbackHandler
agent.run("task", callbacks=[AgentLensCallbackHandler()])
CrewAI
from agentlens.integrations.crewai import patch_crewai
patch_crewai() # Auto-instruments all Crew runs
License
MIT — see LICENSE
Metadata
Release files for agentlens-observe 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agentlens_observe-0.6.0.tar.gz | 19.3 kB | Without provenance | Details for agentlens_observe-0.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agentlens_observe-0.6.0-py3-none-any.whl | Python 3 | none | any | Details for agentlens_observe-0.6.0-py3-none-any.whl |
Total release size: 39.8 kB
Release files / agentlens_observe-0.6.0.tar.gz
| Download URL | agentlens_observe-0.6.0.tar.gz |
|---|---|
| Size | 19.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2b79abbc7def6de188a27332c102f1e373f03ae003db3ca5644d6c05e07a0ad9
|
|
BLAKE2b-256 checksum How to use checksums |
472c63c6165480a074253db61bf4c718b5a3aa343537a5743327a58935e7e59b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / agentlens_observe-0.6.0-py3-none-any.whl
| Download URL | agentlens_observe-0.6.0-py3-none-any.whl |
|---|---|
| Size | 20.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9c8c4982f478fe346ffe91dc3446f43949096f0e1af2ec92f9231beabb5616df
|
|
BLAKE2b-256 checksum How to use checksums |
3647419a559d07d3d7f9a7fa3863f23f57102145f1b4603201fa1024d9c9746a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Security for agentlens-observe 0.6.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.