Catalog PyPI
PACKAGE EXPLORERView in registry

agent-lighthouse

PyPI

Multi-Agent Observability SDK for Agent Lighthouse

agentsdebuggingmulti-agentobservabilitytracing
Versions collected1
Direct dependencies8From release 0.4.0
Last observed20 Oct, 22:34 UTC

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.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.4.020 Feb 20268

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

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:6bcdf096704ad9682436d3358f7ac0d50567495db87df55c251bcc5c38ed64f3