Ext · Cross-cutting

Loop Detection

Detects when agents get stuck repeating the same sequence of actions. Uses multiple detection methods from hash-based to semantic clustering.

Examples

  • Agent calls search_tool("weather") 15 times in a row with identical queries
  • Agent A asks B for clarification, B asks A, creating endless back-and-forth
  • Agent paraphrases the same response 8 times using different wording
  • State oscillates between two values without converging on a solution

Detection methods

Structural Matching
Detects repeated action sequences via substring matching
Hash Collision
Identifies identical state hashes indicating no progress
Semantic Clustering
Groups semantically similar messages using embeddings
Summary Whitelisting
Distinguishes recap/progress patterns from genuine loops

Calibration accuracy

F1
0.846
Precision
0.829
Recall
0.863

From the Pisama calibration set. See detector scoreboard for the full table.

Detect this in production with the framework adapters (LangGraph, CrewAI, AutoGen, OpenAI Agents SDK, Claude Agent SDK, n8n, Dify). See the full taxonomy at /taxonomy.