Skip to content

Conversation

@github-actions
Copy link
Contributor

Problem

Investigation revealed 13.9% error rate (5,884 404 errors out of 42,261 requests) in the nutrition service due to incomplete pet type catalog coverage. The agent was making requests for pet types not in the database, causing legitimate 404 responses and poor user experience.

Solution

This PR implements the recommended fixes from the investigation:

1. Expand Pet Type Catalog (pet-nutrition-service/db-seed.js)

  • Added 5 missing pet types: rabbit, guinea pig, ferret, turtle, fish
  • Each includes appropriate nutrition facts and branded product recommendations
  • Maintains consistency with existing data structure

2. Improve Agent Error Handling (pet_clinic_ai_agents/nutrition_agent/nutrition_agent.py)

  • Added pre-validation of pet types before API calls
  • Explicit handling of 404 responses with clear messaging
  • Directs customers to contact clinic for unlisted pets
  • Prevents fallback to training data for unsupported animals
  • Updated system prompt to reinforce proper error handling

Impact

  • Reduces 404 error rate by expanding catalog coverage
  • Improves user experience with clear messaging for unsupported pets
  • Prevents misleading responses from agent training data
  • Maintains service reliability with proper error handling

Testing

  • Validates pet type before API calls
  • Handles both pre-validation and API 404 responses
  • Provides consistent messaging for unsupported pet types

Fixes the nutrition service issues identified in the investigation.

- Add missing pet types: rabbit, guinea pig, ferret, turtle, fish
- Addresses 13.9% error rate from agent requests for unsupported pet types
- Improves agent fallback behavior by providing comprehensive catalog coverage
- Add explicit validation for supported pet types before API calls
- Provide clear messaging when pet type is not in clinic catalog
- Direct customers to contact clinic for unlisted pets
- Prevents fallback to training data for unsupported animals
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant