Skip to main content

Multi-agent failure detection for production AI systems

Project description

Pisama

Find and fix failures in AI agent systems. No LLM calls required.

PyPI License: MIT Python 3.10+

Pisama ships 32 core heuristic detectors plus framework-specific detectors for n8n, LangGraph, Dify, and OpenClaw, running locally with zero LLM cost on the heuristic tier. On the TRAIL benchmark, Pisama's purpose-built detectors reach 59.9% joint accuracy (span and category) vs. about 11% for general-purpose LLMs doing open-ended failure analysis. Precision is 100% on the categories they flag (zero false positives), and micro-recall is about 60%, so the heuristic tier alone still misses roughly 40% of failures; the tiered pipeline escalates to LLM judges for better coverage on the rest.

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, Windsurf — no API key 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 60.2%

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

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

pisama-0.5.0.tar.gz (58.2 kB view details)

Uploaded Source

Built Distribution

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

pisama-0.5.0-py3-none-any.whl (59.6 kB view details)

Uploaded Python 3

File details

Details for the file pisama-0.5.0.tar.gz.

File metadata

  • Download URL: pisama-0.5.0.tar.gz
  • Upload date:
  • Size: 58.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pisama-0.5.0.tar.gz
Algorithm Hash digest
SHA256 ded04c02fe9c011cfe6e8ac145c8c0dea69e6dda27a0ac0ebd9ee024a82cf24b
MD5 67744c58dada62543590dcf870778714
BLAKE2b-256 f0a1f4faf75a82caa3ae01d544316914d500918e6f779b9901605b30ee4d99a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for pisama-0.5.0.tar.gz:

Publisher: publish.yml on Pisama-AI/pisama

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pisama-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: pisama-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 59.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pisama-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a6031a8ac71c13c0326e318fc9cdd5996dd7f20e804fcb81873556337001d73f
MD5 5fd29e9c8107ef9408c74775b8cd0c29
BLAKE2b-256 980cd18946cdd798d681087ff8a47a76d6014d90a96978918c72d29cf1846c85

See more details on using hashes here.

Provenance

The following attestation bundles were made for pisama-0.5.0-py3-none-any.whl:

Publisher: publish.yml on Pisama-AI/pisama

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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