ÿÿ Customer Agent: Loop Detection | Future AGI Docs

Customer Agent: Loop Detection

Detects if a customer agent is stuck asking the same question repeatedly or circling back in loops during a conversation.

Customer Agent Loop Detection checks whether an agent gets stuck repeating itself, asking for the same information or cycling through the same responses instead of moving the conversation forward. Run it to catch agents that trap users in dead ends.

What it does

Customer Agent Loop Detection is an LLM-as-Judge eval. It reads the full conversation and scores how often the agent gets stuck in a loop.

Input

Required InputTypeDescription
conversationstringThe full conversation history between the customer and agent

Output

FieldTypeDescription
Resultnever / occasionally / frequently / alwaysIndicates how often the agent gets stuck in a loop
ReasonstringA plain-language explanation of the loop detection assessment

Run it from code

Call evaluate() with the template name and the eval’s required inputs. It returns the score and the reason.

Note

Before running: install the SDK and set FI_API_KEY / FI_SECRET_KEY. The model argument in the snippets is the evaluator model Future AGI uses to run the eval; turing_flash is a fast default.

from fi.evals import evaluate

result = evaluate(
    "customer_agent_loop_detection",
    conversation="User: I need help with my bill.\nAgent: Can you provide your account number?\nUser: It's 12345.\nAgent: Can you provide your account number?\nUser: I already told you, it's 12345.\nAgent: Can you provide your account number?",
    model="turing_flash",
)

print(result.score)
print(result.reason)
import { evaluate } from "@future-agi/ai-evaluation";

const result = await evaluate(
  "customer_agent_loop_detection",
  {
    conversation: "User: I need help with my bill.\nAgent: Can you provide your account number?\nUser: It's 12345.\nAgent: Can you provide your account number?\nUser: I already told you, it's 12345.\nAgent: Can you provide your account number?"
  },
  { modelName: "turing_flash" }
);

console.log(result);

When to use

Run Customer Agent Loop Detection on any customer-facing agent conversation where repetition would frustrate the user.

  • Support bots that collect information across turns, to confirm they don’t re-ask for details already given
  • Voice and chat agents prone to falling back to the same scripted response when confused
  • Long-running conversations where you need to catch the agent circling back instead of progressing

What to do when Customer Agent Loop Detection fails

Review the conversation flow to identify where repetition occurs, and add state tracking so the agent remembers previously collected information instead of re-asking for it. Implement fallback logic for cases where user input isn’t recognized, instead of defaulting to the same question.

Test with diverse user inputs to surface edge cases that trigger loops before they reach production.

Was this page helpful?

Questions & Discussion

ÿÿÿÿ