Python tracing SDK for AgentLens, an open-source observability platform for AI agents.
Project description
AgentLens Python SDK
aniket-agentlens-sdk is the Python tracing SDK for AgentLens.
It lets another Python application instrument agent runs and steps with a small decorator-based API while sending trace data to a running AgentLens backend.
Install
pip install aniket-agentlens-sdk
Import path:
from agentlens import AgentLens, trace_agent, trace_step
The PyPI distribution name and the Python import name are intentionally different:
- install name:
aniket-agentlens-sdk - import name:
agentlens
Quick Start
from agentlens import AgentLens, trace_agent, trace_step
AgentLens(
api_key="al_sk_your_key",
project_id="proj_your_project",
endpoint="http://localhost:8000",
).configure()
@trace_step(type="tool_call", name="search_candidates")
def search_candidates(query: str) -> dict[str, object]:
return {"matches": ["candidate_1", "candidate_2"], "query": query}
@trace_agent(name="candidate_screening_agent")
def run_agent(message: str) -> dict[str, object]:
result = search_candidates(message)
return {"message": "done", "result": result}
Runtime Flow
AgentLens(...).configure()sets the default SDK client.@trace_agentcreates a traced run.@trace_stepcreates nested steps under the current run.- The SDK sends HTTP requests to the AgentLens backend.
- The backend stores, masks, and analyzes the trace for display in the dashboard.
Requirements
- Python
>=3.11 - A running AgentLens backend
- A valid AgentLens
project_id - A valid AgentLens ingestion API key
Links
- Repository: https://github.com/aniketgopal/agentlens
- Documentation: https://github.com/aniketgopal/agentlens/tree/main/docs
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 aniket_agentlens_sdk-0.1.0.tar.gz.
File metadata
- Download URL: aniket_agentlens_sdk-0.1.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad75c5d27adeee8452662b36858ab38e4a9031968e0c61ca2f97a63b0051c5aa
|
|
| MD5 |
350f1d87727d20e250d3239b78dbc2ad
|
|
| BLAKE2b-256 |
66fcbc2b0d44e82b2ecbe90de6b39d73b026952ce98fb68035d4a5dd5a10e15f
|
Provenance
The following attestation bundles were made for aniket_agentlens_sdk-0.1.0.tar.gz:
Publisher:
publish-sdk.yml on aniketgopal/agentlens
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aniket_agentlens_sdk-0.1.0.tar.gz -
Subject digest:
ad75c5d27adeee8452662b36858ab38e4a9031968e0c61ca2f97a63b0051c5aa - Sigstore transparency entry: 1393247749
- Sigstore integration time:
-
Permalink:
aniketgopal/agentlens@c18849ea00aa573c17594d00db8b4865f2ad9602 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/aniketgopal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdk.yml@c18849ea00aa573c17594d00db8b4865f2ad9602 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file aniket_agentlens_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: aniket_agentlens_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78a77fcf426c060b4635a8ba556bf46cc860ea89f401c5e94e4a75f8799073a1
|
|
| MD5 |
3b8b53d0e869f981cdde8807859440e2
|
|
| BLAKE2b-256 |
08eec09d9188781ba614030e51a8dbf2b36b937110500484bb1b04b0f50146d6
|
Provenance
The following attestation bundles were made for aniket_agentlens_sdk-0.1.0-py3-none-any.whl:
Publisher:
publish-sdk.yml on aniketgopal/agentlens
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aniket_agentlens_sdk-0.1.0-py3-none-any.whl -
Subject digest:
78a77fcf426c060b4635a8ba556bf46cc860ea89f401c5e94e4a75f8799073a1 - Sigstore transparency entry: 1393247767
- Sigstore integration time:
-
Permalink:
aniketgopal/agentlens@c18849ea00aa573c17594d00db8b4865f2ad9602 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/aniketgopal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdk.yml@c18849ea00aa573c17594d00db8b4865f2ad9602 -
Trigger Event:
workflow_dispatch
-
Statement type: