Post-mortem debugger for AI agents
Project description
AgentAutopsy
Post-mortem debugger for AI agents — when your agent fails, this tells you exactly why.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
agentautopsy-2.0.0.tar.gz
(72.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agentautopsy-2.0.0.tar.gz.
File metadata
- Download URL: agentautopsy-2.0.0.tar.gz
- Upload date:
- Size: 72.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ada27e54513c85e12ea1854b21a83abae6ed8c502421ef4c2e6027d77b856d73
|
|
| MD5 |
be5dff12c47a0086851fedd0424e6114
|
|
| BLAKE2b-256 |
69ab3a7f81f417e22676fcec734df0dfae690811b3cc22cab4096c34d02d5a83
|
File details
Details for the file agentautopsy-2.0.0-py3-none-any.whl.
File metadata
- Download URL: agentautopsy-2.0.0-py3-none-any.whl
- Upload date:
- Size: 75.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f832d62f0001de600aad9c0d6e23e312e63851742382745c5e4688190b3a1e67
|
|
| MD5 |
7d1b4a72e426a3f6bcd0b433113b80c2
|
|
| BLAKE2b-256 |
27e7be5ddc43479ab85038f4e63788ef3eda1edfb29aff9cd4f35ee66780459c
|