Catalog PyPI
PACKAGE EXPLORERView in registry

agentblackbox

PyPI

A flight recorder for AI agents – record every decision, tool call, and failure

agentsaianthropicdebugginglangchainllmmonitoringobservabilityopenai
Versions collected1
Direct dependencies6From release 0.2.0
Last observed20 Oct, 21:33 UTC

README

Version 0.2.0 documentation

🔲 AgentBlackBox

A flight recorder for AI agents.
Record every decision, tool call, and failure. Replay them later.

PyPI Python License Tests Coverage


The problem

72% of AI agent projects never reach production.

Not because the agents are wrong — but because they're invisible.
You can't debug what you can't see. You can't trust what you can't audit.

AgentBlackBox is the flight recorder your AI agents need.


Install

pip install agentblackbox                 # core only (zero dependencies)
pip install agentblackbox[dashboard]      # + web UI

Requires Python 3.10+.


Quickstart

from agentblackbox import BlackBox

# Drop-in decorator — existing code unchanged
@BlackBox.record(agent_name="researcher")
def run_agent(task: str):
    # your existing agent code here
    ...

run_agent("Summarize today's AI news")

# See what happened
sessions = BlackBox.list_sessions()
BlackBox.replay(sessions[0].session_id)

That's it. Every LLM call, tool use, cost, and error is now recorded locally.

Remote / hosted mode

You can mirror recordings to a hosted AgentBlackBox dashboard while still keeping the local SQLite log:

from agentblackbox import BlackBox
from agentblackbox.remote import RemoteStorage

remote_store = RemoteStorage(
    api_key="abx_...",
    endpoint="https://your-agentblackbox.example.com",
)

with BlackBox.session("researcher", storage=remote_store) as bb:
    bb.record_tool_call("search", {"q": "ai evals"}, {"hits": 12}, 83.4)

To run the dashboard in authenticated cloud mode:

agentblackbox dashboard --cloud

What gets recorded

EventDetails
🤖 LLM callmodel, prompt, output, input/output tokens, cost, latency
🔧 Tool callname, arguments, return value, execution time
❌ Errortype, message, full stack trace, timestamp

All data is stored in a local SQLite file (~/.agentblackbox/recordings.db).
Nothing is sent to any external server.


Usage patterns

Decorator

@BlackBox.record(agent_name="coder")
def coding_agent(task):
    ...

Context manager

with BlackBox.session("planner") as bb:
    plan = agent.run(task)
    bb.record_tool_call("search", {"query": task}, result=plan)

Manual recording

with BlackBox.session("custom") as bb:
    bb.record_llm_call(
        model="gpt-4o",
        input_text="Summarize this",
        output_text="Here is a summary...",
        input_tokens=150,
        output_tokens=80,
        duration_ms=400.0,
    )

OpenAI Agents SDK (auto-instrument)

from agentblackbox.integrations import patch_openai_agents
patch_openai_agents()  # All agents recorded automatically

Web Dashboard

agentblackbox dashboard
# → http://localhost:8765
  • Sessions — all runs with status, cost, duration, auto-refreshes every 30s
  • Timeline — step-by-step replay with expandable LLM inputs/outputs
  • Analytics — daily cost trends, per-agent breakdown, model distribution

CLI

agentblackbox sessions                    # list all sessions
agentblackbox replay <session_id>         # console replay
agentblackbox export <session_id>         # JSON export
agentblackbox dashboard --port 8765       # web UI

Cost tracking

Supports 20+ models with automatic cost calculation:

ProviderModels
OpenAIgpt-4o, gpt-4o-mini, gpt-4-turbo, gpt-3.5-turbo, o1, o3-mini
Anthropicclaude-3-5-sonnet, claude-3-opus, claude-3-haiku, claude-3-5-haiku

License

MIT © 2026 Takumu Hata

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.2.08 May 20266

Package advisories

0
No matching advisories collected

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

Repository

PENDING
takumukata/agentblackbox

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 21:33 UTC

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

Record identity

package:1fb7b4051e8439e49a69c1497a4ec2571e9f91c14fdbd4a760a0526c730fa23a