Skip to main content

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

  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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aniket_agentlens_sdk-0.1.0.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aniket_agentlens_sdk-0.1.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

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

Hashes for aniket_agentlens_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ad75c5d27adeee8452662b36858ab38e4a9031968e0c61ca2f97a63b0051c5aa
MD5 350f1d87727d20e250d3239b78dbc2ad
BLAKE2b-256 66fcbc2b0d44e82b2ecbe90de6b39d73b026952ce98fb68035d4a5dd5a10e15f

See more details on using hashes here.

Provenance

The following attestation bundles were made for aniket_agentlens_sdk-0.1.0.tar.gz:

Publisher: publish-sdk.yml on aniketgopal/agentlens

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aniket_agentlens_sdk-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for aniket_agentlens_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 78a77fcf426c060b4635a8ba556bf46cc860ea89f401c5e94e4a75f8799073a1
MD5 3b8b53d0e869f981cdde8807859440e2
BLAKE2b-256 08eec09d9188781ba614030e51a8dbf2b36b937110500484bb1b04b0f50146d6

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page