← Back to browser
ai-ml

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:

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

---

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

---

Cloud Run Embed

{% cloudrun https://gift-advisor-1008832068452.us-central1.run.app %}

---

1. Profile Analyzer Agent (`ProfileAnalyzerAgent`)

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`)

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`)

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

Cloud Run Production Optimization

To keep running costs near $0.00 while maintaining rapid startup times:

---

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

---

Have questions about this article?

Ask DocuMind