Skip to main content

Post-mortem debugger for AI agents

Project description

AgentAutopsy

Post-mortem debugger for AI agents — when your agent fails, this tells you exactly why.

AgentAutopsy CI PyPI version PyPI downloads License: MIT Python 3.8+


Lifecycle

  ┌──────┐    ┌────────┐    ┌───────┐    ┌──────────┐    ┌─────┐    ┌─────────┐
  │ Fail │───▶│ Detect │───▶│ Trace │───▶│ Diagnose │───▶│ Fix │───▶│ Prevent │
  └──────┘    └────────┘    └───────┘    └──────────┘    └─────┘    └─────────┘
     │             │              │              │            │             │
  Agent        Pinpoint       Full SQLite     AI root      Auto-fix      Fix cache
  crashes      failure        event log       cause +      + replay      + drift
               step           locally         patch        verify        alerts

Commands

Command What it does
agentautopsy ui Open visual debugger
agentautopsy fix <id> Auto-fix a failure
agentautopsy runs List all runs
agentautopsy replay <id> Print full event report for a run
agentautopsy mcp <cmd...> Proxy and trace an MCP server over stdio
agentautopsy stats Show fix-cache and token stats
agentautopsy serve Start HTTP API (POST /analyze)

Features

Feature What It Does Use When
Zero-config watch One import instruments LLM + HTTP calls Adding tracing to existing agents
LLM interceptor Records every OpenAI / Anthropic prompt and response Debugging model behavior
HTTP interceptor Captures failed outbound HTTP (http_error events) Connection / API failures
SQLite trace store Persists full decision traces in agentautopsy.db Offline post-mortems
Failure detection Finds the exact failing step in a run Any agent crash
Root-cause analysis AI diagnosis + concrete fix (Anthropic) You need a fix, not just a stack trace
Fix cache Remembers verified fixes for instant replay Repeat failures
Auto-fix Applies patch suggestions to your codebase Turning diagnosis into code
Replay Step through failed runs in CLI or UI Understanding what went wrong
Web UI Timeline, stats, debug chat Visual debugging
MCP tracing Proxy + schema drift / mismatch reports MCP server or tool-call failures
Prompt diffing Compares prompts vs. previous run Silent behavior changes
Divergence detection Flags runs that differ from past successes Flaky or drifting agents
Multi-agent graph Parent/child run chains (agentautopsy agents) Crews and agent pipelines
GitHub Actions Posts root cause + fix on PR test failures CI/CD workflows
Slack alerts Notifies channel on failure (AGENTAUTOPSY_SLACK_WEBHOOK) Team visibility

Framework Support

Framework Support Level
OpenAI Native — auto-intercepted
Anthropic Native — auto-intercepted
HTTP / httpx Native — auto-intercepted
LangChain Callback handler — get_callback_handler()
LangGraph Callback handler — get_langgraph_handler()
CrewAI Callback handler — get_crewai_handler()
MCP Proxy CLI + watch_mcp() post-mortem tracing
Any OpenAI/Anthropic client Works with zero config via watch()

Quick Start

1. Install

pip install agentautopsy

2. Instrument your agent

import agentautopsy

agentautopsy.watch()
# your existing agent code — nothing else changes

3. Debug failures

agentautopsy runs                  # find the run id
agentautopsy replay <run_id>       # see the full trace
agentautopsy ui                    # open the visual debugger

License

MIT — see LICENSE.

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

agentautopsy-1.9.0.tar.gz (65.7 kB view details)

Uploaded Source

Built Distribution

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

agentautopsy-1.9.0-py3-none-any.whl (68.6 kB view details)

Uploaded Python 3

File details

Details for the file agentautopsy-1.9.0.tar.gz.

File metadata

  • Download URL: agentautopsy-1.9.0.tar.gz
  • Upload date:
  • Size: 65.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for agentautopsy-1.9.0.tar.gz
Algorithm Hash digest
SHA256 93bedd5b6604f0e25c6d0b5e1bec5708782fd73add63a049b07b41a669ead117
MD5 d3fdae7d3f986ff9676006abf1baf165
BLAKE2b-256 c9c860050ee601f2687dea193fc116b276571e201e32968f097d9f95722234f1

See more details on using hashes here.

File details

Details for the file agentautopsy-1.9.0-py3-none-any.whl.

File metadata

  • Download URL: agentautopsy-1.9.0-py3-none-any.whl
  • Upload date:
  • Size: 68.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for agentautopsy-1.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d1ff11dc8a2314764f5f39212beaeff6297a77db3755ba296c3a90d6d814cef9
MD5 bf59aad279dee98851233d17cb39000e
BLAKE2b-256 97acc8b619ad095d42206e9c4fec8ff37c487481532cdcee201023388b0498dd

See more details on using hashes here.

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