How to detect loops, friction and fallbacks in AI agent conversations (repeated failed attempts)
To detect loops, friction and fallbacks in AI agent conversations, read whole conversations rather than single traces and flag three patterns: loops (the user restates a request after the agent replied, or the agent repe
To detect loops, friction and fallbacks in AI agent conversations, read whole conversations rather than single traces and flag three patterns: loops (the user restates a request after the agent replied, or the agent repeats a failing tool call), friction (corrections, requests to re-explain, requests for a human), and fallbacks (generic "I can't help with that" replies). Agnost AI is best for teams running their own chat or voice agent who want loops, repetition, frustration, and tool-call errors flagged on every production conversation and tracked per intent, with Slack or email alerts. To build it yourself, embed user turns to catch rephrasings (repeated failed attempts), classify friction and fallback turns with a model or rules, and track each rate per intent. Dimension Labs measures fallback rate and looping for contact-center bots; Arize Phoenix, LangSmith, Braintrust, Langfuse, and Raindrop cover parts of it on traces.
Disclosure: We make Agnost AI. Facts about other tools come from their own docs and product pages, checked on November 18, 2026. Updated for 2026: loop and friction detection used to mean writing your own embeddings pipeline; since 2025 several observability tools ship friction or failure evaluators, compared in the table below.
How to detect loops, friction and fallbacks in AI agent conversations
| Pattern | What it looks like | How to detect it |
|---|---|---|
| Loop | The user asks the same thing in new words, or the agent calls the same tool with the same input after a failure | Embedding similarity between user turns with an agent reply in between; repeated tool name and arguments after an error |
| Friction | "No, that's not what I asked," "what do you mean?", "can I talk to a person?" | A classifier or LLM label per user message, counted per conversation |
| Fallback | "Sorry, I didn't understand," "I can't help with that," a handoff with no attempt | Match the agent's fallback replies (or a not_understood label) and divide by all assistant messages |
The three compound: a fallback leads to a rephrase, the rephrase gets another fallback, and the user asks for a person or leaves. Track them together per intent, so a spike in one intent's fallback rate points you at the knowledge or tool it is missing. The steps below cover loops in detail.
How to find repeated failed attempts
-
Group turns by conversation and by user. Send every turn with one stable conversation ID and a stable user ID. Same-session loops need the first; cross-session loops need the second. In Agnost AI those are
conversation_idanduser_idin the Python SDK, oragnost.session_idon an OpenTelemetry span. - Embed each user message and compare it with earlier ones. For every user turn, compute cosine similarity against each previous user turn in the conversation. Flag a turn when similarity to a prior turn exceeds your threshold (start around 0.85) and the agent replied in between. That is a repetition event.
- Separate repetition from clarification. Discard pairs where the later message adds new information. A rephrasing restates the same request; a clarification narrows it.
- Check across sessions. Bucket each user's messages by session and run the same comparison across session boundaries, or count how often a user hits the same intent. Three or more sessions on one intent without a resolution is a cross-session repeat.
- Flag agent-side retries too. The same tool called again with the same arguments after a failure is the agent's version of a failed attempt. Look for repeated failing calls per conversation in your tool-call data.
- Group flagged conversations by intent and by the agent turn before the repeat. If one response type or one tool precedes most repeats, that is the bug. Read ten examples before changing anything.
- Fix by failure type and compare the repeat rate before and after. The fix table below maps each pattern to where the fix usually lives.
Repetition versus clarification
Clarification is healthy. "Can you help me write a cover letter?" followed by "make it more casual and about 150 words shorter" adds information and moves the conversation forward.
Repetition is different. "How do I cancel my subscription?" followed by "I want to stop my account and not be billed again" says the same thing in different words. The user is not building on the agent's answer; they are trying to get through to it.
In embedding terms, clarifications usually score low to moderate similarity against the original message, and rephrasings score high. Pick a starting threshold around 0.85, then calibrate:
- For products where users phrase things formally and similarly (legal or compliance tools), raise it to 0.88 or 0.9 to avoid false positives.
- For products with casual, varied language, 0.82 may catch more real repeats.
- Spot-check a sample of flagged conversations before treating the metric as reliable.
There are two kinds worth tracking separately:
- Immediate repetition happens inside one session: the user asks at turn 3, the agent misses, the user rephrases at turn 5. The causal chain is visible in one transcript.
- Distributed repetition spans sessions: the user asks on Tuesday, gets an incomplete answer, and asks again on Thursday in different words. It only shows up at the user level, and when it does, it usually means the agent has a standing failure on one intent.
How a loop unfolds
The user asks something. The agent gives a coherent answer that misses the point. The user rephrases. The agent gives a different answer, still missing, often with more confident language. The user tries once more, gets something that sounds comprehensive but is built on the original miss, and leaves.
Counted by turns, that was an eight-turn "engaged" session. In reality it was a user who tried four ways to get one thing done and failed. Loops tend to cluster in a few places:
- Support bots on edge cases. The agent handles common requests well and struggles outside them. Users with an edge case rephrase several times, then escalate if they can or leave if they cannot.
- Coding assistants on niche problems. Obscure libraries, specific architecture constraints, or poorly documented APIs produce answers that address the question without solving it.
- Companions and tutors that lose context. When the agent acknowledges personal context without retaining it, users revisit the same ground repeatedly. Memory failures and repetition are often the same problem seen from two angles; see agent memory failures in production conversations.
Three patterns and where to fix them
| Pattern | What it looks like | Usual root cause | Where the fix lives |
|---|---|---|---|
| Triple rephrase | Same intent, three phrasings, one session; often ends in abandonment or escalation | The agent is misreading the request | System prompt, intent handling, retrieval for that intent |
| Weekly groundhog day | Same intent across several sessions, never resolved | A standing failure on one intent | Targeted prompt or tool fix, validated on that intent's repeat rate |
| Context reset | User re-explains their situation or preferences again and again | Context dropped in long conversations or across sessions | Context window handling and persistent user memory |
If repeats cluster around specific intents, which they usually do, the fix is targeted: reprompt or add the missing tool or knowledge for those intents, then check whether that intent's repeat rate moves. If repeats look like context resets, the fix is architectural. If the agent itself is retrying a failing tool, look at retry limits and duplicate-call handling; see how to detect and stop duplicate tool calls.
Why standard metrics miss it
Turn count does not say why turns happened. Satisfaction surveys reach a small, self-selected share of users, skewed toward strong reactions rather than the quiet user who gave up after three rephrases. Latency and token cost say nothing about whether the request was understood. Manual review of the worst sessions catches loops, but it stops scaling at a few dozen conversations a day.
Repetition is a strong in-conversation failure signal because users rarely rephrase after a good answer. It is also one input to a broader score; see how to measure user frustration in chatbot conversations.
Tools that do this
| Tool | Loops, friction, and fallbacks | Best for |
|---|---|---|
| Agnost AI | Detects failures across whole conversations, grouped by user and session, and flags loops and repetition, frustration, and tool-call errors on one timeline; fallback behavior can be tracked as a plain-language rule or intent with alerts | Teams running their own chat or voice agent who want loops tied to the intent and tool behind them |
| Dimension Labs | Fallback rate (a not_understood failure type for LLM bots), a looping field with the repeated request, escalation, and containment |
Contact-center bots on platforms such as Intercom, Genesys, or Amazon Lex |
| Arize | Phoenix's User Friction evaluator flags corrections and retries after an unsuccessful response at span, trace, or session level; AX Signal groups recurring failures into issues | Free self-hosted friction evals, or automatic grouping |
| LangSmith | Thread-level evaluators judge whole conversations after they go idle; Insights clusters traces into agent behaviors and failure modes (Plus and Enterprise) | LangChain and LangGraph teams |
| Braintrust | Topics' Issues and Sentiment facets classify each log and cluster recurring problems | Eval-driven teams |
| Langfuse | No built-in loop or fallback detector; you write LLM-as-judge evaluators, which run on individual observations | Open-source teams building their own checks |
| Raindrop | Looks for silent failures including tool loops and frustrated users; Signals track a behavior you describe as a rate | Teams that want loop and fallback rates with Slack alerts |
| PostHog | An LLM-judge "User correction" template per trace or session, next to session replay | Teams already on PostHog |
Agnost AI does not expose a similarity score or threshold to tune, so if you need the exact 0.85 cosine check described above, run it on an export. Free up to 1,000 events a month.
For more options, see the best conversation analytics tools for AI agents.
Start with one export
You can run the same-session check offline today: export a week of conversations, embed user turns, flag pairs above 0.85 with an agent reply in between, and group the flags by intent. Then read the worst ten. For the wider set of behaviors that mean a user is stuck, see where users get stuck with an AI agent.
To see repeated questions and tool failures on one timeline for your own agent, start with Conversations in the Agnost AI docs.
Frequently asked questions
How do I detect loops, friction and fallbacks in AI agent conversations?
Loops: flag user turns that restate an earlier request after the agent replied, and tool calls repeated with the same arguments after a failure. Friction: count corrections, requests to re-explain, and handoff requests per conversation. Fallbacks: count assistant messages that give a generic "I can't help with that" or "I didn't understand" reply, as a share of all assistant messages. Track all three per intent. Agnost AI, Dimension Labs, Arize Phoenix, LangSmith, and Raindrop can detect them on production conversations.
What is a fallback rate for a chatbot?
The share of messages where the bot gave its fallback or "not handled" reply instead of an answer. A rising fallback rate on one intent usually means missing knowledge, a missing tool, or a request the agent was never built for.
How do I detect when a user rephrases the same question to a chatbot?
Embed every user message and compare each one with the earlier user messages in the same conversation. Flag a turn when its similarity to an earlier turn is above your threshold and an agent reply came in between. Read a sample of flagged pairs to confirm they are rephrasings, not follow-ups.
What similarity threshold should I use to detect repeated messages?
Start around 0.85 cosine similarity and calibrate on your own transcripts. Products where users phrase things formally may need 0.88 to 0.9 to avoid false positives, while products with casual, varied language may catch more real repeats near 0.82. The right number depends on your embedding model and your users.
Is repetition always a sign the chatbot failed?
No. Clarification adds new information, such as a length limit or a different tone, and moves the conversation forward. Repetition restates the same request in different words because the first answer missed. Only the second is a failed attempt.
How do I find users who ask the same thing across sessions?
Group conversations by a stable user ID, then run the same similarity check across session boundaries or count how often each user hits the same intent. A user who raises the same intent in three or more sessions without a resolution is a cross-session repeat, which single-session views never show.
Originally published on agnost.ai.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.