When your agent fails, this tells you exactly why.
Project description
AgentAutopsy
When your agent fails, this tells you exactly why.
Why this exists
Every time an AI agent fails, you get a useless stack trace. No context. No reason. No fix. AgentAutopsy gives you the exact failure step, root cause, and a verified fix — automatically.
CLI
agentautopsy runs # see all agent runs agentautopsy replay # replay any failure agentautopsy stats # fix cache stats
Install
pip install agentautopsy
Examples
# Basic usage
import agentautopsy
agentautopsy.watch()
# LangChain
from agentautopsy import get_callback_handler
handler = get_callback_handler()
agent.run(input, config={"callbacks": [handler]})
# Slack alerts
export AGENTAUTOPSY_SLACK_WEBHOOK=https://hooks.slack.com/...
# Web UI
agentautopsy ui
# CLI
agentautopsy runs
agentautopsy replay <run_id>
agentautopsy stats
Usage
import agentautopsy
agentautopsy.watch()
# your existing agent code here — nothing else changes
AgentAutopsy automatically intercepts every LLM call, detects failures, finds root cause, outputs a verified fix, and caches it for next time.
Why AgentAutopsy vs LangSmith / Helicone?
| Feature | AgentAutopsy | LangSmith | Helicone |
|---|---|---|---|
| Works offline | ✅ | ❌ | ❌ |
| Zero config | ✅ | ❌ | ❌ |
| Replay failed runs | ✅ | partial | ❌ |
| AI debug assistant | ✅ | ❌ | ❌ |
| Prompt diffing | ✅ | partial | ❌ |
| Divergence detection | ✅ | ❌ | ❌ |
| Free and open source | ✅ | partial | ✅ |
| No cloud required | ✅ | ❌ | ❌ |
Setup
Windows: set ANTHROPIC_API_KEY=your-key-here
Mac/Linux: export ANTHROPIC_API_KEY=your-key-here
Get your free key at console.anthropic.com
Set AGENTAUTOPSY_SLACK_WEBHOOK=your-webhook-url and AgentAutopsy will automatically alert your Slack channel when any agent fails.
Quick start
Create test_agent.py and paste this:
import agentautopsy
agentautopsy.watch()
Run: python test_agent.py
Works with
OpenAI, Anthropic, LangChain, any framework using openai or anthropic
Requirements
Python 3.11+, ANTHROPIC_API_KEY
License
Apache 2.0
Roadmap
- VS Code extension
- GitHub Actions integration
- Multi-agent tracing
- Auto-fix applier
- LangChain support
- Slack alerts
- Web UI
- Prompt diffing
- Divergence detection
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
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-1.4.0.tar.gz.
File metadata
- Download URL: agentautopsy-1.4.0.tar.gz
- Upload date:
- Size: 1.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a4d8a278772dccc04c29007785643d307e74c8117b94c74c7f1ac93c5fd3eb7
|
|
| MD5 |
313132690ec618a069ee818132d6c81d
|
|
| BLAKE2b-256 |
45ada741fa0800d4e8df23f6c6866df30adbb066093ba72bc5f7c202d3105f6c
|
File details
Details for the file agentautopsy-1.4.0-py3-none-any.whl.
File metadata
- Download URL: agentautopsy-1.4.0-py3-none-any.whl
- Upload date:
- Size: 43.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 |
9f0730e8b6ac2f52c45b729f1536f7f24c30b07653cad085134a555041756258
|
|
| MD5 |
a8ab8c57a4c3d38054c0424a72d89556
|
|
| BLAKE2b-256 |
a1b525db52e2828f7ae86eb6440d3da65fddd00a734c4b6f8e2593e8c5b21c2e
|