Skip to content

pet clinic agent issue #200

@sguruvar

Description

@sguruvar

@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:

  1. 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

  2. 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:

  1. Update Agent Prompts:
    • Configure agents to explicitly state when products aren't available
    • Add validation to prevent recommendations for unsupported pets

  2. Fix Error Handling:
    • Implement proper fallback responses when nutrition service returns 404
    • Add circuit breaker patterns for failed service calls

  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions