·Kian Quinlan

How Prova detects coordination loops

A short technical post -- the math, the data, and the one line of code you write.

The job of Prova's runtime is to answer one question, continuously: is the agent system you're watching making real progress, or is it stuck in a coordination loop?

This post walks through how we answer that. No heavy math; just the structure.

What we actually watch

Every multi-agent runtime -- LangGraph, CrewAI, AutoGen, your own -- boils down to a sequence of steps, where each step is one agent reading some state and writing new state. So we watch the read/write events. Every read is "agent A read state key K that was last written by agent B." Every write is "agent A wrote state key K."

If you sequence those events, you get a directed graph: edges from writer to subsequent reader. A healthy run produces a mostly tree-like graph -- agents fan out, do work, hand results upstream, converge.

A stuck run produces something different: a closed loop. Agent A writes K, agent B reads K and writes L, agent C reads L and writes K-again, agent A reads K-again. The path A -> B -> C -> A closes. And, critically: that closure persists across multiple steps. The same loop pattern keeps re-forming.

The catch

Detecting "the same loop just formed again" naively is a mess. Strings of state keys vary. Agents may take slightly different paths each cycle. False positives kill you.

So we use persistent homology, specifically the first homology group H1 of the simplicial complex you build from the communication graph at each step. The technical version is in our docs; the intuitive version is:

  1. Each agent is a vertex.
  2. Each two-way handoff (or longer cycle) closes a "loop" in the graph.
  3. Loops can be transient (a one-time exchange) or persistent (the same loop keeps coming back).
  4. Persistent ones are the ones that matter. The math gives a precise definition of "persistent" -- a 1-cycle that survives across multiple consecutive states.

When a persistent 1-cycle is born and lasts past a threshold of steps, we declare a coordination loop. The agents in the cycle, the step it started, and the state keys involved are all part of the receipt we emit.

What you write

import prova

with prova.watch(graph):
    graph.invoke(initial_state)

That's it. The watch context manager hooks into your agent runtime's state events. We do the rest server-side. If anything looks like a persistent loop, your configured webhook fires.

What you get back

When the watcher catches a loop, the alert includes:

  • The agents involved -- e.g., "Orchestrator -> Data -> Analysis -> QA -> Orchestrator"
  • The step the loop started -- so you can jump straight to the relevant turn in your trace
  • The shared state keys driving the cycle -- which is usually where the bug is
  • A tamper-evident receipt -- a SHA-256-hashed record of the detection. If you're in a regulated industry (EU AI Act Article 12, FDA AI guidance, SEC algorithmic audit), this is the audit artifact you've been wondering how to produce.

The receipt is what makes the difference between "Slack alert" and "compliance-grade evidence." You can hand it to a regulator. The hash is independently verifiable.

Why this beats heuristics

The standard answers to "is this thing looping?" are heuristics: count repeated state values, check tool-call signatures, compare prompt embeddings. They work most of the time and fail in the long tail.

Persistent homology gives a definition of looping that doesn't depend on what the agents are saying -- only on the structure of how they're handing off work. It catches loops that look different on every iteration. It also doesn't fire on healthy retries where progress is happening despite repetition.

The math has been studied for forty years. We didn't invent it. We're just applying it to a problem that didn't exist forty years ago.

What's next

We're working on shipping framework-specific adapters (LangChain, CrewAI, Vercel AI SDK), a self-hosted option for regulated industries, and a richer dashboard. If you want early access to any of those, book a call.