Skip to main content

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

  1. AgentLens(...).configure() sets the default SDK client.
  2. @trace_agent creates a traced run.
  3. @trace_step creates nested steps under the current run.
  4. The SDK sends HTTP requests to the AgentLens backend.
  5. 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

Release files for aniket-agentlens-sdk 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aniket-agentlens-sdk 0.1.0
File Size Uploaded
aniket_agentlens_sdk-0.1.0.tar.gz 6.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aniket-agentlens-sdk 0.1.0
File Interpreter ABI Platform
aniket_agentlens_sdk-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.9 kB

Release files / aniket_agentlens_sdk-0.1.0.tar.gz

Download URL aniket_agentlens_sdk-0.1.0.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ad75c5d27adeee8452662b36858ab38e4a9031968e0c61ca2f97a63b0051c5aa
BLAKE2b-256 checksum
How to use checksums
66fcbc2b0d44e82b2ecbe90de6b39d73b026952ce98fb68035d4a5dd5a10e15f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 27, 2026.

Transparency log

Release files / aniket_agentlens_sdk-0.1.0-py3-none-any.whl

Download URL aniket_agentlens_sdk-0.1.0-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
78a77fcf426c060b4635a8ba556bf46cc860ea89f401c5e94e4a75f8799073a1
BLAKE2b-256 checksum
How to use checksums
08eec09d9188781ba614030e51a8dbf2b36b937110500484bb1b04b0f50146d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 27, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page