Multi-agent failure detection for production AI systems
Project description
Pisama
Find and fix failures in AI agent systems. No LLM calls required.
Pisama ships 32 core heuristic detectors plus framework-specific detectors for n8n, LangGraph, Dify, and OpenClaw. They run locally with zero LLM cost on the heuristic tier. An archived run on the TRAIL benchmark reports 59.9% joint accuracy (span and category), compared with 11.9% for the best general-purpose LLM judge tested. The public confusion counts reproduce the reported macro-F1 and micro-F1. See the benchmark evidence and its reproducibility boundary.
Install
pip install pisama
Usage
from pisama import analyze
result = analyze("trace.json") # also accepts dicts and JSON strings
for issue in result.issues:
print(f"[{issue.type}] {issue.summary} (severity: {issue.severity})")
print(f" Fix: {issue.recommendation}")
CLI
pisama analyze trace.json # Analyze a trace
pisama watch python my_agent.py # Watch a live agent (pip install pisama[auto])
pisama replay <trace-id> # Re-run detection on stored traces
pisama smoke-test --last 50 # Batch test recent traces
pisama detectors # List all 32 core detectors
pisama mcp-server # Start MCP server (pip install pisama[mcp])
MCP Server
Works in Cursor, Claude Desktop, and Windsurf. No API key is needed:
{
"mcpServers": {
"pisama": { "command": "pisama", "args": ["mcp-server"] }
}
}
Detectors
32 core detectors plus framework-specific detectors for n8n, LangGraph, Dify, and OpenClaw. A representative selection:
| Detector | What It Catches |
|---|---|
loop |
Infinite loops, retry storms, stuck patterns |
coordination |
Deadlocked handoffs, message storms |
hallucination |
Factual errors, fabricated tool results |
injection |
Prompt injection, jailbreak attempts |
corruption |
State corruption, type drift |
persona_drift |
Persona drift, role confusion |
derailment |
Task deviation, goal drift |
context |
Context neglect, ignored instructions |
specification |
Output vs. requirement mismatch |
communication |
Inter-agent message breakdown |
decomposition |
Poor task breakdown, circular dependencies |
workflow |
Unreachable nodes, missing error handling |
completion |
Premature completion, unfinished work |
withholding |
Suppressed findings, hidden errors |
convergence |
Metric plateau, regression, thrashing |
overflow |
Context window exhaustion |
delegation |
Delegation quality and task handoff failures |
grounding |
Claims not supported by source documents |
retrieval_quality |
Poor retrieval relevance or coverage |
compaction_quality |
Information loss during context compaction |
Benchmark Results
TRAIL (trace-level failure detection, 148 traces):
| Method | Joint Accuracy |
|---|---|
| GPT-5.4 | 11.9% |
| Gemini 3.1 Pro | 6.8% |
| Pisama archived run | 59.9% |
Who&When (ICML 2025, multi-agent attribution, 58 hand-crafted cases):
| Method | Agent Accuracy | Step Accuracy |
|---|---|---|
| GPT-5.4 Mini | 60.3% | 22.4% |
| Pisama + Sonnet 4 | 60.3% | 24.1% |
Links
License
MIT
Source boundary
This repository is the public source for the MIT-licensed pisama Python
package. It does not contain the Pisama Cloud backend, dashboard, calibration
data, managed detection tiers, or paid automation.
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 pisama-0.5.5.tar.gz.
File metadata
- Download URL: pisama-0.5.5.tar.gz
- Upload date:
- Size: 77.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebe337199c214053e1178f3be869f7d5dfc8a8e7ec11b3861f00991befcdfd48
|
|
| MD5 |
a200a12db0a2a6dd0f6099c411e60834
|
|
| BLAKE2b-256 |
9c91f573bdfa153822214eec5d9f20fbba19294d9b786cb3f97dfa3bf3581d2d
|
Provenance
The following attestation bundles were made for pisama-0.5.5.tar.gz:
Publisher:
publish.yml on Pisama-AI/pisama-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pisama-0.5.5.tar.gz -
Subject digest:
ebe337199c214053e1178f3be869f7d5dfc8a8e7ec11b3861f00991befcdfd48 - Sigstore transparency entry: 2266971730
- Sigstore integration time:
-
Permalink:
Pisama-AI/pisama-python@cb62b321159fc10d4aa894381224ccb76f2aca75 -
Branch / Tag:
refs/tags/v0.5.5 - Owner: https://github.com/Pisama-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cb62b321159fc10d4aa894381224ccb76f2aca75 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pisama-0.5.5-py3-none-any.whl.
File metadata
- Download URL: pisama-0.5.5-py3-none-any.whl
- Upload date:
- Size: 71.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a51a19e474669d76bd7e30da499432f75f17ad46e6af9bbdb05ddfc6056aa43
|
|
| MD5 |
702cb5e93dbfcf430bbe5228cf599805
|
|
| BLAKE2b-256 |
089e522b7cdb2591c8d66d9be780298e667c8145044ab66a5afadac550717589
|
Provenance
The following attestation bundles were made for pisama-0.5.5-py3-none-any.whl:
Publisher:
publish.yml on Pisama-AI/pisama-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pisama-0.5.5-py3-none-any.whl -
Subject digest:
5a51a19e474669d76bd7e30da499432f75f17ad46e6af9bbdb05ddfc6056aa43 - Sigstore transparency entry: 2266971950
- Sigstore integration time:
-
Permalink:
Pisama-AI/pisama-python@cb62b321159fc10d4aa894381224ccb76f2aca75 -
Branch / Tag:
refs/tags/v0.5.5 - Owner: https://github.com/Pisama-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cb62b321159fc10d4aa894381224ccb76f2aca75 -
Trigger Event:
release
-
Statement type: