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

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

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"})

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.1.0.tar.gz (76.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.1.0-py3-none-any.whl (79.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agentautopsy-2.1.0.tar.gz
  • Upload date:
  • Size: 76.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.1.0.tar.gz
Algorithm Hash digest
SHA256 8f57b42d0836f6575963c8dd166e7f412a8bb45abb925ce62adba9f2427a5caf
MD5 a5d5a2f5197012975585cc8300b63cf8
BLAKE2b-256 0d6c0ccc9270cb3f0188827615d165bcdf6d8becd930090190909c9047ea6375

See more details on using hashes here.

File details

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

File metadata

  • Download URL: agentautopsy-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 79.7 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ec950552f97e4fc4a49b7c0f90aaf21a9631f5d0357363b941a29f924cc44da6
MD5 04d0ece06806f09000a63f0467dd8b6e
BLAKE2b-256 fa87b6e565ef8c9976b66e3d72ceb9cf665701e6bfa529ddf2d9c661c24cde42

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