|
|
ADK Personalization Engine
Author: Venkata Sudhakar
A personalization engine adapts the agent's behaviour to each customer segment. For ShopMax India, a budget-conscious buyer in Tier 2 cities should receive different product recommendations than a premium electronics buyer in Bangalore. This tutorial shows how to segment customers and inject segment-specific context into ADK agents at runtime.
The approach classifies each user into a segment based on their profile data, then selects a matching persona instruction. The agent uses this instruction to adjust tone, product price range, and recommendation style - all without changing the underlying model or tools.
It gives the following output,
[u_ananya] For a premium Bangalore buyer, I recommend the Samsung Galaxy S24 Ultra
at Rs 1,34,999 with 200MP camera and Galaxy AI features, or the iPhone 15 Pro
at Rs 1,34,900. Both come with 1-year ShopMax India warranty and priority service.
[u_suresh] Great value options for Nagpur: the Redmi Note 13 at Rs 16,999 offers
a 108MP camera and 5000mAh battery. Available on 0% EMI over 6 months - just
Rs 2,833/month. The Realme Narzo 60 at Rs 14,999 is also excellent value.
[u_meena] For smart value in Mumbai, the OnePlus 12R at Rs 39,999 gives flagship
performance at mid-range pricing with Snapdragon 8 Gen 2. The Pixel 8a at
Rs 52,999 offers 7 years of updates - great long-term investment.
Each customer receives a different recommendation tailored to their segment - Ananya gets flagship suggestions, Suresh gets budget picks with EMI details, and Meena gets mid-range value options. The same query, three different personalised responses, using the same model and tools but different instructions built at runtime.
In production, derive segments dynamically from BigQuery purchase history rather than a static profile store. Run a daily batch job that re-segments customers based on their last 90 days of spend, then write the segment label to Firestore. The agent reads this label at session start and selects the matching instruction - ensuring segmentation stays current as customer behaviour evolves.
|
|