Multi-Agent Gift Recommendation Engine Powered by Google ADK & Gemini
This post is my submission for DEV Education Track: Build Multi-Agent Systems with ADK. Finding the...
*This post is my submission for [DEV Education Track: Build Multi-Agent Systems with ADK](https://dev.to/deved/build-multi-agent-systems).*
*Finding the perfect, thoughtful gift shouldn't feel like a chore.*
Whether it's for a birthday, anniversary, or holiday, we all experience gift-buying paralysis:
- **Generic suggestions**: "Just buy them a mug or a generic gift card."
- **Budget anxiety**: Falling in love with an idea only to find out it costs 3x what you planned to spend.
- **Missing the subtle nuances**: Forgetting that someone dislikes clutter, lives in a tiny apartment, or prefers practical experiences over physical objects.
To solve this, I built **GiftAdvisor**. It is an intelligent, consumer-friendly gift recommendation system built with **Google Agent Development Kit (ADK)**, **Gemini (`gemini-3.1-flash-lite`)**, and deployed seamlessly to **Google Cloud Run**.
---
Live Demo & Links
- **Live Cloud Run App**: [https://gift-advisor-1008832068452.us-central1.run.app](https://gift-advisor-1008832068452.us-central1.run.app)
- **GitHub Repository**: [https://github.com/inusha-thathsara/Multi-Agent-Gift-Idea-Generator-with-Google-ADK](https://github.com/inusha-thathsara/Multi-Agent-Gift-Idea-Generator-with-Google-ADK)
---
What I Built
**GiftAdvisor** transforms unstructured descriptions of a person into tailored, ranked, and strictly budget-compliant gift recommendations.
Instead of dumping everything into a single monolithic prompt, GiftAdvisor splits the cognitive load across **three specialized AI agents** orchestrated via Google ADK:
1. **Profile Analyzer Agent**: Understands the human behind the prompt (lifestyle, hobbies, aesthetic preferences, and explicit *anti-preferences*). 2. **Idea Finder Agent**: Brainstorms creative, thoughtful candidate gifts across multiple categories with estimated market prices. 3. **Budget Filter Agent**: Audits estimated prices, filters out anything exceeding the user's hard budget limit, swaps in budget-friendly alternatives, and delivers a ranked curation.
Key Highlights & Features
- **Pure Multi-Agent Pipeline**: Built using Google ADK's `LlmAgent`, `SequentialAgent`, and `InMemorySessionService`.
- **Zero-Overhead Scale-to-Zero**: Deployed to Google Cloud Run with `min-instances=0` (scales to zero when idle for $0.00 base cost).
- **Modern Glassmorphism UI**: Intuitive dark-mode consumer interface with 1-click preset profiles, interactive budget slider, and live pipeline stage tracking.
- **Comprehensive Export System**: Export recommendations with 1 click to Markdown (`.md`), JSON (`.json`), Clipboard, or Print / Save as PDF.
---
Cloud Run Embed
{% cloudrun https://gift-advisor-1008832068452.us-central1.run.app %}
---
1. Profile Analyzer Agent (`ProfileAnalyzerAgent`)
- **Role**: Empathy & Persona Architect.
- **What it does**: Ingests raw user inputs (e.g., *"My 29yo sister loves specialty pour-over coffee and houseplants, but lives in a small apartment"*). It extracts core interests, lifestyle dimensions, emotional tone, and most importantly, **anti-preferences** (e.g., *no large items, avoid generic mugs*).
- **ADK Output Key**: `recipient_profile`
profile_analyzer_agent = LlmAgent(
name="ProfileAnalyzerAgent",
model=model_name,
instruction="""
You are an expert gift persona analyzer.
Analyze the recipient's description, occasion, and relationship.
Extract key traits, hobbies, lifestyle context, and explicit anti-preferences (what to avoid).
Save your structured analysis to session state key 'recipient_profile'.
""",
output_key="recipient_profile",
)2. Idea Finder Agent (`IdeaFinderAgent`)
- **Role**: Creative Ideation Specialist.
- **What it does**: Reads `{recipient_profile}` from the session state and ideates 6–10 candidate ideas across diverse categories (e.g., *Experiential, Practical Everyday, Consumable / Artisan, Sentimental*). It attaches realistic estimated market prices to every item.
- **ADK Output Key**: `candidate_gift_ideas`
idea_finder_agent = LlmAgent(
name="IdeaFinderAgent",
model=model_name,
instruction="""
You are a creative gift brainstormer.
Given the recipient profile:
{recipient_profile}
Brainstorm 6 to 10 distinct, creative gift ideas across multiple categories.
For each idea, provide a realistic estimated market price.
Save your candidate ideas to session state key 'candidate_gift_ideas'.
""",
output_key="candidate_gift_ideas",
)3. Budget Filter Agent (`BudgetFilterAgent`)
- **Role**: Financial Auditor & Final Curator.
- **What it does**: Reads `{candidate_gift_ideas}`, `{budget_limit}`, and `{currency}`. It validates each candidate against the budget ceiling. Any item that exceeds the budget is logged in an **Elimination Audit** and replaced with a budget-friendly alternative. The agent then organizes recommendations into budget tiers (*Splurge, Sweet Spot, Budget Friendly*) with specific buying advice.
- **ADK Output Key**: `final_gift_recommendations`
budget_filter_agent = LlmAgent(
name="BudgetFilterAgent",
model=model_name,
instruction="""
You are a meticulous gift budget auditor and curator.
Budget Limit: {budget_limit} {currency}
Candidate Ideas:
{candidate_gift_ideas}
1. Audit each idea against the budget ceiling.
2. Eliminate items that exceed the limit and suggest budget-friendly alternatives.
3. Present the Top 3-5 Recommended Gifts formatted into budget tiers with rationale.
Save the final report to session state key 'final_gift_recommendations'.
""",
output_key="final_gift_recommendations",
)4. Orchestration with `SequentialAgent`
Google ADK makes chaining agents intuitive using `SequentialAgent`. State flows from one agent's `output_key` directly into the next agent's prompt template variables:
gift_advisor_pipeline = SequentialAgent(
name="GiftAdvisorPipeline",
sub_agents=[
profile_analyzer_agent,
idea_finder_agent,
budget_filter_agent,
],
)---
Implementation & Architecture
Backend Tech Stack
- **Framework**: Python 3.12, FastAPI, Uvicorn
- **Agent Framework**: `google-adk` (Agent Development Kit v2.7.0)
- **Model**: `gemini-3.1-flash-lite` (via `google-genai`)
- **Deployment**: Google Cloud Run (Containerized via Docker)
Cloud Run Production Optimization
To keep running costs near $0.00 while maintaining rapid startup times:
- **`min-instances = 0`**: Cloud Run spins down to zero instances when no traffic is being served.
- **`memory = 512MiB` & `cpu = 1 vCPU`**: Lightweight footprint optimized for async FastAPI and Google ADK orchestration.
- **`gemini-3.1-flash-lite`**: Ultra-fast latency with minimal token consumption.
---
Key Learnings
1. **Separation of Concerns Prevents Hallucination**: When asking a single LLM prompt to analyze personality, brainstorm 10 items, and filter by budget simultaneously, it often ignores budget limits or produces bland suggestions. By decoupling *Analysis* -> *Ideation* -> *Budget Auditing* into separate ADK agents, each agent performs its task with significantly higher precision.
2. **Session State is the Superpower of ADK**: Using `InMemorySessionService` and prompt variable injection (`{recipient_profile}`, `{candidate_gift_ideas}`) made passing structured context between agents clean, traceable, and modular.
3. **Cloud Run + Gemini is a Perfect Match**: Deploying containerized Python agent applications to Cloud Run gives you an instant HTTPS public API with scale-to-zero economics. No idle server bills, automatic TLS certificates, and global scaling out of the box.
---
Conclusion & What's Next
Building **GiftAdvisor** with Google ADK demonstrated how accessible and clean multi-agent orchestration has become in Python.
Future Ideas
- **Live Search Tool Integration**: Connecting Google Search grounding or SerpAPI to pull real-time e-commerce links and stock availability.
- **Group Gift Mode**: Splitting a high-ticket budget across multiple contributors with automated per-person share calculations.
---