Catalog PyPI
Back to packageRELEASE DETAILS

0.4.0

PyPI

agent-lighthouse

Multi-Agent Observability SDK for Agent Lighthouse

agentsdebuggingmulti-agentobservabilitytracing
Published20 Feb 2026
Direct dependencies8
Transitive dependenciesNot calculated

README

Version 0.4.0 documentation

Agent Lighthouse SDK (Python)

The official Python client for instrumenting AI agents with Agent Lighthouse.

Features

  • Automatic Tracing: Decorators for agents, tools, and LLM calls.
  • Async Support: Fully compatible with async/await workflows.
  • State Management: Expose internal agent state (memory, context) for real-time inspection.
  • Token Tracking: Automatically capture token usage and costs from LLM responses.

Installation

Install from PyPI:

pip install agent-lighthouse

Or install from source in development mode:

cd sdk
pip install -e .

Quick Start

1. Initialize Tracer

from agent_lighthouse import LighthouseTracer

# Use your API Key (starts with lh_)
tracer = LighthouseTracer(api_key="lh_...")

2. Add Decorators

Wrap your functions with @trace_agent, @trace_tool, or @trace_llm.

from agent_lighthouse import trace_agent, trace_tool, trace_llm

@trace_tool("Web Search")
def search_web(query):
    # ... logic ...
    return results

@trace_llm("GPT-4", model="gpt-4-turbo", cost_per_1k_prompt=0.01)
def call_llm(prompt):
    # ... call OpenAI ...
    return response

@trace_agent("Researcher")
def run_research_agent(topic):
    data = search_web(topic)
    summary = call_llm(f"Summarize {data}")
    return summary

3. Run It

Just run your script as normal. The SDK will automatically send traces to the backend.

State Inspection

Allow humans to inspect and modify agent state during execution:

from agent_lighthouse import get_tracer

@trace_agent("Writer")
def writer_agent():
    tracer = get_tracer()
    
    # Expose state
    tracer.update_state(
        memory={"draft": "Initial draft..."},
        context={"tone": "Professional"}
    )
    
    # ... execution continues ...

Zero-Touch Auto-Instrumentation (Magic Import)

No code changes to your LLM calls. Just import once at the top of your script:

import agent_lighthouse.auto  # auto-instruments OpenAI, Anthropic, requests, and frameworks

This automatically captures:

  • LLM latency
  • Token usage
  • Cost (best-effort pricing)

Content capture is off by default. Enable if you explicitly want payloads:

export LIGHTHOUSE_CAPTURE_CONTENT=true

Configuration

You can configure the SDK via environment variables:

VariableDescriptionDefault
LIGHTHOUSE_API_KEYYour machine API keyNone
LIGHTHOUSE_BASE_URLURL of the backend APIhttp://localhost:8000
LIGHTHOUSE_AUTO_INSTRUMENTEnable auto-instrumentation1
LIGHTHOUSE_CAPTURE_CONTENTCapture request/response payloadsfalse
LIGHTHOUSE_LLM_HOSTSAllowlist extra LLM hosts for requests instrumentation""
LIGHTHOUSE_PRICING_JSONPricing override JSON string""
LIGHTHOUSE_PRICING_PATHPricing override JSON file path""
LIGHTHOUSE_DISABLE_FRAMEWORKSDisable framework adapters (csv)""

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 8

Native requirements
8 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
httpx
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
httpx>=0.25.0runtime
crewai
Environment
{
  "extras": "",
  "marker": "extra == \"crewai\"",
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
crewai>=0.1.0; extra == "crewai"runtime
langgraph
Environment
{
  "extras": "",
  "marker": "extra == \"langgraph\"",
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
langgraph>=0.0.1; extra == "langgraph"runtime
pytest
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
pytest>=8.3.0; extra == "dev"runtime
pytest-asyncio
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
pytest-asyncio>=0.24.0; extra == "dev"runtime
pytest-cov
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
pytest-cov>=5.0.0; extra == "dev"runtime
ruff
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
ruff>=0.8.0; extra == "dev"runtime
bandit
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.9",
  "evaluation": "NOT_EVALUATED"
}
bandit>=1.8.0; extra == "dev"runtime

Distribution files

2 collected
agent_lighthouse-0.4.0-py3-none-any.whl

bdist_wheel · 20.03 KB · Python py3

Source file
agent_lighthouse-0.4.0.tar.gz

sdist · 21.08 KB · Python source

Source file

Repository

PENDING
noogler-aditya/agent-lighthouse

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:34 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:d6e34342af3be787982fbeb8735e76a24f4157937f31209a2eba7a4bc4d0a6fc

Other collected versions

View all collected versions →