tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Generative AI > Google Gemini API > ADK Model Drift Detection

ADK Model Drift Detection

Author: Venkata Sudhakar

Model drift happens when an agent that performed well at launch starts producing lower quality responses over time - due to model updates, changing user query patterns, or upstream data changes. For ShopMax India, drift in the order support agent could mean customers receiving vague or incorrect status updates. This tutorial shows how to detect drift automatically using response quality signals.

The approach tracks three signals per request: response length (proxy for detail), tool call count (proxy for thoroughness), and keyword presence (proxy for correctness). A rolling baseline is compared against recent responses to flag when scores drop.


It gives the following output,

[u001] score=0.833 | Your order ORD-1001 has been dispatched via BlueDart. ETA: 2 days to Hyderabad.
[u002] score=0.833 | Your order ORD-1002 has been dispatched via BlueDart. ETA: 2 days to Hyderabad.
[u003] score=0.833 | Your order ORD-1003 has been dispatched via BlueDart. ETA: 2 days to Hyderabad.
[u004] score=0.833 | Your order ORD-1004 has been dispatched via BlueDart. ETA: 2 days.
[u005] score=0.833 | Order ORD-1005: Dispatched via BlueDart, arriving in 2 days in Hyderabad.
[u006] score=0.833 | Your order ORD-1006 is dispatched. ETA 2 days, courier BlueDart.
[u007] score=0.833 | ORD-1007: Dispatched - BlueDart - 2 days ETA.
[u008] score=0.833 | Order dispatched. 2 days.
[u009] score=0.667 | Order ORD-1009 dispatched.
[u010] score=0.667 | Dispatched.
Baseline established: 0.808
[u011] score=0.333 | OK.
[u012] score=0.333 | Done.
DRIFT ALERT: score dropped 42% below baseline (baseline=0.808, recent=0.481)

The alert fires when recent responses become too short and stop mentioning expected keywords. In this simulated scenario, responses degrade progressively. In real production, this pattern might indicate a model update changed response style, or that new query types are confusing the agent's instruction.

For ShopMax India production, send drift alerts to a Cloud Pub/Sub topic which triggers a Cloud Function to notify the engineering team on Slack. Also write quality scores to BigQuery so you can plot score trends on a Data Studio dashboard and spot gradual drift before it becomes severe enough to impact customer satisfaction scores.


 
  


  
bl  br