Skip to main content

Post-mortem debugger for AI agents

Project description

AgentAutopsy

PyPI version Downloads GitHub stars License: MIT Python 3.8+

The post-mortem debugger for AI agents. When your agent fails silently — AgentAutopsy tells you exactly why.

Lifecycle

Install  →  Watch  →  Fail  →  Trace  →  Replay  →  Fix
   │          │        │         │          │        │
 pip      watch()   silent   SQLite     rewind    auto-fix
install              failure   log      + fork    + cache
Stage What happens
Install pip install agentautopsy — no cloud account, no config file
Watch agentautopsy.watch() intercepts LLM, HTTP, MCP, and tool calls
Fail Agent errors or returns bad output; run is marked in local SQLite
Trace Full event timeline: prompts, tools, schemas, tokens, timestamps
Replay Rewind to any step, fork with new input, diff original vs replay
Fix Root-cause report, AI chat on trace, verified fix cached for next run

Commands

What you're doing Command Key principle
Zero config setup agentautopsy.watch() One import catches everything
View trace UI agentautopsy ui Visual timeline of every step
Replay a failure agentautopsy replay --run-id <id> --from-step <n> Rewind to exact failure point
Detect schema drift SchemaDriftDetector().watch() Catch API changes before production
Trace MCP servers MCPAutopsy().watch_mcp_server() Every MCP call recorded
Fork and fix DVRReplay().fork(run_id, at_step=3) Branch from any step
Generate tests from failures agentautopsy generate-evals Never fix the same bug twice

Quick Start

pip install agentautopsy
import agentautopsy

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

Features

Feature What It Does Use When
MCP Post-Mortem Tracing Traces every MCP server call, shows bad data source Using Claude Code, Cursor, any MCP client
Schema Drift Detector Detects renamed/removed/added fields automatically After any API or tool upgrade
DVR Fork and Replay Rewind, replay, fork from any step Debugging production failures
Swarm Tracing Causality tracing across 50+ agents Multi-agent workflows
AI Chat on Trace Ask questions about your failure When root cause is unclear
Prompt Diffing Compare runs side by side Optimizing agent behavior
Automatic Eval Generation Generates pytest test cases from every failure automatically When you want to make sure the same failure never happens again

Framework Support

Works with: LangChain, LangGraph, CrewAI, AutoGen, LlamaIndex, OpenAI, Anthropic, MCP

Module Quick Start

Basic

import agentautopsy

agentautopsy.watch()

MCP

from agentautopsy import MCPAutopsy

MCPAutopsy().watch_mcp_server("my-mcp-server")

Schema Drift

from agentautopsy import SchemaDriftDetector

SchemaDriftDetector().watch()

DVR Replay

from agentautopsy import DVRReplay

dvr = DVRReplay()
dvr.replay(run_id, from_step=3)
dvr.fork(run_id, at_step=3, new_input={"query": "fixed prompt"})

Auto Eval Generation

from agentautopsy import EvalGenerator

gen = EvalGenerator()
gen.generate_all()  # generates tests from all recorded failures

Contributing

Fork the repo, open a PR with tests. See CONTRIBUTING.md for setup and CI commands.

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-2.2.0.tar.gz (87.6 kB view details)

Uploaded Source

Built Distribution

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

agentautopsy-2.2.0-py3-none-any.whl (88.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for agentautopsy-2.2.0.tar.gz
Algorithm Hash digest
SHA256 1150e59386d03304fcd5d5de2083373377f2da2c63970bd31345a9daa1b3aa75
MD5 90051835a7b7332287ed26a5eb9fc471
BLAKE2b-256 07a59aee1bad846bfc0143c6ce392498c06509054032521743509580f6ff8174

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for agentautopsy-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1c879ec267845e0c55fea9657955e4a09c1627f25277de05abf158f72851a0e2
MD5 312013bbafd1496bf2b110d6653cdce2
BLAKE2b-256 c138f1981e36fe84673b2c8fea571fd849036df6439c87d5c4261c87fbaedfe1

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