Skip to main content

AgentLogs SDK (Python)

Open-source observability for AI agents. Trace every LLM call, tool use, error, and cost.

pip install agentlogs-sdk

Quickstart

import asyncio
from agentlogs import AgentLogs, StepType

async def main():
    # Reads AGENTLOGS_API_KEY from env, defaults to https://agentlogs.app
    client = AgentLogs()

    async with await client.create_trace(name="research-agent") as trace:
        async with trace.step("search", step_type=StepType.TOOL) as s:
            # ... your tool call
            pass

        await trace.add_step(
            name="gpt-4o",
            step_type=StepType.LLM,
            metadata={"model": "gpt-4o", "provider": "openai"},
            tokens=1234,
            cost=0.012,
        )

asyncio.run(main())

Configuration

from agentlogs import configure

configure(
    api_key="al_...",                  # or set AGENTLOGS_API_KEY
    api_url="https://agentlogs.app",   # default
    project="my-agent",
)

Env vars:

  • AGENTLOGS_API_KEY — get one from https://agentlogs.app/settings
  • AGENTLOGS_API_URL — override for self-hosted instances
  • AGENTLOGS_PROJECT — default project name

Decorator API

from agentlogs import trace_agent

@trace_agent()
async def my_agent(query: str):
    return await llm.generate(query)

Self-hosting

Point the SDK at your own deployment:

configure(api_url="https://logs.your-company.com")

MIT licensed.

Metadata

Release files for agentlogs-sdk 0.1.1

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

Source distribution (sdist)

Source distribution for agentlogs-sdk 0.1.1
File Size Uploaded Provenance Actions
agentlogs_sdk-0.1.1.tar.gz 6.1 kB Without provenance Details for agentlogs_sdk-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agentlogs-sdk 0.1.1
File Interpreter ABI Platform Actions
agentlogs_sdk-0.1.1-py3-none-any.whl Python 3 none any Details for agentlogs_sdk-0.1.1-py3-none-any.whl

Total release size: 14.1 kB

Release files / agentlogs_sdk-0.1.1.tar.gz

Download URL agentlogs_sdk-0.1.1.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f9b6f9a44e54b0d5dcd4f386425be616f8ac670b874e2366b475d61d865f2e7f
BLAKE2b-256 checksum
How to use checksums
eafe752406c838c2e0fe36e06310c4864dd40f175b0fb0de2e280d1be2e54cec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / agentlogs_sdk-0.1.1-py3-none-any.whl

Download URL agentlogs_sdk-0.1.1-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1298c956a14140419f6cfd8f7b728a84fa5e90679f3124c6c2c1b4dd5bb92f07
BLAKE2b-256 checksum
How to use checksums
30aefc486496874a3e8be46748b8e25d189d86a2cf1f2d80e436edb61778feb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for agentlogs-sdk 0.1.1

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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