-
Notifications
You must be signed in to change notification settings - Fork 65
Description
@awsapm can you triage this issue
Problem: Agent Hallucination Despite Service Errors
Your nutrition agent is recommending products for pets that don't exist in your database, even after receiving error responses from the nutrition service.
Key Evidence from Logs:
"Do we have ferret-specific kibble in stock? What brands do we recommend for ferrets?"
Tool Result: "Nutrition info for ferret: Error: Nutrition service could not find information for pet: ferret"
Despite this error, the agent continues providing recommendations.
Supported vs. Unsupported Pet Types:
✅ Available Products (200 responses):
• Dog (1,201 requests)
• Cat (1,149 requests)
• Bird (782 requests)
• Hamster (644 requests)
• Snake (627 requests)
• Lizard (406 requests)
❌ Unavailable Products (404 responses):
• Rabbit (1,520 requests - highest failure!)
• Turtle (369 requests)
• Ferret (369 requests)
• Guinea pig (348 requests)
• Parrot (182 requests)
• Bearded dragon (167 requests)
• Fish (120 requests)
Critical System Issues:
-
Agent Error Handling Failure:
• Pet clinic agent: 100% error rate, 70.27% fault rate
• Nutrition agent: 13.46% error rate, 1,425 error occurrences
• Bedrock throttling exceptions causing timeouts -
Agent Hallucination:
• Agents provide recommendations despite receiving "Error: Nutrition service could not find information" responses
• No proper error handling when nutrition data is unavailable
Immediate Fixes:
-
Update Agent Prompts:
• Configure agents to explicitly state when products aren't available
• Add validation to prevent recommendations for unsupported pets -
Fix Error Handling:
• Implement proper fallback responses when nutrition service returns 404
• Add circuit breaker patterns for failed service calls -
Database Alignment:
• Either add nutrition data for missing pets (rabbit, ferret, turtle, etc.)
• Or update agent knowledge to only include supported pets
The root cause is that your agents are hallucinating recommendations instead of properly handling service errors when nutrition data is unavailable.