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 60.2% F1 (100% precision, zero false positives) vs. about 11% for general-purpose LLMs doing open-ended failure analysis. Recall is about 43%, so the heuristic tier alone misses over half 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.4.0.tar.gz (52.7 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.4.0-py3-none-any.whl (56.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pisama-0.4.0.tar.gz
Algorithm Hash digest
SHA256 294d3e0b778ced70702846158558368e5ea98881838bd5d078a22326dd88957a
MD5 f00163acaa564959dc18f8e130c3e558
BLAKE2b-256 2cf612577a398a96a972b7212da603f91c26d8d310359a9c827edfc08537c59d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pisama-0.4.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.4.0-py3-none-any.whl.

File metadata

  • Download URL: pisama-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 56.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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0ddda6c394e00695697a4c717b01d9de6f80aaac9df90f2cc945b3f4fb3b1a99
MD5 1247c6cddd1315835323cb603cbe8edb
BLAKE2b-256 ccc1da333a209d9c1eadc4a3fb4a7806f35d4de3aa74584f10a683e0f17ae1c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pisama-0.4.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