All Lessons

A fintech startup is building a customer support agent that processes refund requests. The agent uses the Claude API with tool use for looking up orders, checking payment status, and processing refunds. In production, the agent gets stuck in an infinite loop when a customer says "I need help", it calls get_customer_info repeatedly with slight variations on the customer's name, never reaching a terminal response. The engineering team notices API costs are 10x what they budgeted for this agent. What is the most likely cause and fix for this issue?

1 / 3
advanced 25 min

Agent Loops

Loading lesson content...

An agent keeps calling a search tool repeatedly with slightly different queries, never deciding it has enough information. What's happening?

1 / 2

An agent in production handles simple tasks in 2 tool calls but complex tasks take 50+ calls, risking timeout and cost overruns. How to architect for this?

1 / 1