tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Generative AI > Google Gemini API > ADK Agent Self-Improvement with Feedback Loops

ADK Agent Self-Improvement with Feedback Loops

Author: Venkata Sudhakar

Agent self-improvement uses feedback signals - thumbs up/down, explicit ratings, or correction messages - to refine the agent instruction over time. Rather than retraining the model, a meta-agent periodically analyses accumulated feedback and rewrites the system prompt to address recurring failure patterns. ShopMax India uses this to iteratively improve their product recommendation agent based on customer acceptance rates.

The pattern has three components: a feedback collector that stores ratings and corrections in Firestore, a feedback analyser that runs weekly and identifies patterns in negative feedback, and a prompt updater that rewrites the agent instruction based on the analysis.

The below example shows how ShopMax India implements the feedback collection and prompt refinement cycle.


The weekly prompt refinement job that analyses feedback and updates the agent,


It gives the following output,

Feedback recorded: rating=2
Feedback recorded: rating=2

Prompt refined using 2 negative feedbacks
New prompt: You are a product recommendation agent for ShopMax India.
Always mention EMI options and warranty when recommending products.
For student budgets assume Rs 25,000-40,000 unless stated otherwise.

Schedule the refinement job weekly using Cloud Scheduler. Store prompt versions in Firestore with timestamps so you can roll back if a new prompt performs worse. Track the average rating per week in BigQuery to measure whether self-improvement is working - ShopMax India improved average ratings from 3.2 to 4.1 over 8 weeks of automated refinement.


 
  


  
bl  br