Most travel apps are designed for popularity and convenience, often directing users to crowded, carbon-intensive destinations.
In this tutorial you will learn how to do that Create a multi-agent trip planner with Google ADK this instead recommends highly relevant, more sustainable alternatives as inviting options rather than prescriptive choices.
The implementation is based on TRACKour research prototype accepted at SIGIR 2026 (Banerjee et al.)that combines research with a production-ready engineering workflow.
![imagen[1]-[Tutorial] Building a Multi-Agent Travel Planner with Google ADK For Windows 7,8,10,11-Winpcsoft.com](https://winpcsoft.com/wp-content/plugins/wp-fastest-cache-premium/pro/images/blank.gif)
The backend is created with Google’s Agent Development Kit (ADK). and driven by Géminis 2.5 Destellocon Chainlit is used for the frontend.
In this article, we will focus exclusively on the backend architecture as it is the most interesting component.
Below we explain the core design of the multi-agent and provide a lightweight, running prototype to illustrate the concept.
Nota: The paper’s original GCP demo was moved to Hugging Face Spaces due to a Chainlit security update. Details can be found at the end of this post.
The architecture
To influence user decisions without restricting autonomy, TRACE generates two parallel recommendations and evaluates the trade-offs:
- A basic recommendation: Optimized solely for user relevance.
- A sustainability-conscious recommendation: Balanced in terms of carbon footprint and population density.
A Counterfactual Explanation Agent (CFE). then compares the two options. It highlights the sustainable choice as the primary recommendation, while keeping the popular baseline visible as an alternative. This transparent comparison serves as a gentle cognitive nudge.
┌──▶ Baseline RecSys ──┐
│ (Relevance Only)
│ │
User Query ───────┤ ├──▶ CFE Agent (Compare & Nudge)
│ │
└──▶ Context RecSys ───┘
(Sustainable)
The production pipeline
This orchestration is handled efficiently in the TRACE backend via parallel agent execution. Here is a simplified view of the pipeline orchestration (backend/adk/assembly/pipeline.py):
importar asincio
from google.adk.agents import ParallelAgent, LlmAgent, SequentialAgent
async def create_pipeline():
# Load agents in parallel
ic_agent, rec_baseline_agent, ca_recsys_agent = await asyncio.gather(
get_ic_agent(),
get_recsys_agent(has_context=False), # Baseline: Relevance only
get_recsys_agent(has_context=True), # Context-aware: Sustainable
)
# Sequence intent classification followed by context-aware recommendation
sequential = SequentialAgent(
name="SequentialPipeline",
sub_agents=[ic_agent, ca_recsys_agent]
)
# Run the sustainable recommendation path and the baseline path concurrently
parallel = ParallelAgent(
name="ParallelRecAgents",
sub_agents=[sequential, rec_baseline_agent]
)
# Consolidate both recommendations into a single counterfactual output
cfe = LlmAgent(
name="CFEAgent",
model="gemini-2.5-flash",
instruction=ENV.get_template("cfe_combination.jinja2").render(),
output_schema=CFEOutput
)
return SequentialAgent(name="CRSPipeline", sub_agents=[parallel, cfe])
The design is entirely based on three core ADK concepts: SequentialAgent, ParallelAgent and structured data validation via Output_schema (supported by Pydantic to ensure strict JSON schemas).
Construction of a lightweight prototype
To demonstrate the structural logic of TRACE, we can create a minimal, local version that runs with a standard Gemini API key (without requiring external databases like Firestore).
Project setup
Purchase a free API key from Google AI Studio and then initialize your on-premises environment:
mkdir trace-mini && cd trace-mini
python -m venv .venv && fuente .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install google-adk
mkdir trace_agent
echo "from . import agent" > trace_agent/__init__.py
printf "GOOGLE_GENAI_USE_VERTEXAI=FALSE\nGOOGLE_API_KEY=your_key_here\n" > .env
The agent implementation
Save the following agent configuration as Trace_agent/agent.py:
from __future__ import annotations
from typing import Optional
desde pydantic importar modelo base, Field
from google.adk.agents import Agent, ParallelAgent, SequentialAgent
MODEL: str = "gemini-2.5-flash"
class Recommendation(son modelos):
recommendation: str = Field(..., description="List of cities")
explanation: str = Field(..., description="A single-sentence justification for the choice.")
class CFEOutput(son modelos):
recommendation_shown: cadena
is_recommendation_sustainable: bool
explanation_shown: cadena
alternative_recommendation: Optional[cadena] = None
# Agent 1: Relevance-focused baseline
baseline = Agent(
model=MODEL,
name="baseline_recsys",
output_schema=Recommendation,
output_key="baseline_rec",
description="Recommends a city strictly matching user preferences.",
instruction=f"Recommend the best city for the user's request, ignoring sustainability. Available options: {CITIES}",
) # this is a sample instruction which can be updated on a need basis
# Agent 2: Sustainability-focused recommender
green = Agent(
model=MODEL,
name="context_recsys",
output_schema=Recommendation,
output_key="green_rec",
description="Recommends a city balancing relevance and environmental/social impact.",
instruction=f"Recommend the best city that fits the user's intent but is historically less crowded and lower-carbon. Available options: {CITIES}",
) # this is a sample instruction which can be updated on a need basis
# Agent 3: The CFE synthesis agent
cfe = Agent(
model=MODEL,
name="CFEAgent",
output_schema=CFEOutput,
description="Compares both recommendations and formulates a gentle behavioral nudge.",
instruction=(
"Relevance-only recommendation: {baseline_rec}\nSustainable recommendation: {green_rec}\n\n"
"Present the sustainable option (recommendation_shown) if it meets the user's core intent. "
"Explain it warmly as a comparative alternative: 'what if you chose X instead of Y'-highlighting "
"a similar cultural experience with fewer crowds and lower carbon impact. "
"Populate alternative_recommendation with the baseline city. Do not lecture the user."
),
)# this is a sample instruction which can be updated on a need basis; for exact prompts used in the paper, check resources
# Root pipeline orchestration
root_agent = SequentialAgent(
name="CRSPipeline",
sub_agents=[
ParallelAgent(name="ParallelRecAgents", sub_agents=[base, green]),
cfe
],
)
Run the agent
Launch the native ADK web playground to interact with your agents:
adk web In the UI, select “trace_agent” and try entering a query like this:
“A lively canal city with rich art, historic architecture and great food – I’m thinking of Amsterdam.”
You will see both referral programs running at the same time. The CFE agent will evaluate both and make gentle suggestions Ghent o Bruges as a more environmentally friendly “what if” alternative Amsterdam transparently available as the base option you originally weighed against.
Why this paradigm is successful
Forcing sustainable choices on users by eliminating popular options entirely is a paternalistic approach that often drives users to look elsewhere. TRACE succeeds by validating the user’s initial preference and providing a direct head-to-head comparison. By reducing the friction of finding greener alternatives, behavioral science and AI agents work together to make sustainable choice the easy choice.
📢 Note on live sandbox migration
The original GCP-hosted demo referenced in the document is currently offline due to a vulnerability in the Chainlit UI framework. To maintain Zero Trust security, the entire system was migrated Embrace facial spaces.
After unpacking, the space is used Gemma-3-27b for zero-shot and light agent decisions. To experience the full production-grade ADK parallel agent pipeline as described in the document, feel free to enter your own Gemini API key directly into the user interface. Read the full text Hugging Face README for more detailed implementation details.
resources
- Research work: TRACK (SIGIR ’26)
- Interactive Sandbox: TRACE Face Space Hugging Chatbot
- Code repository: Source code
- Project website: https://ashmibanerjee.github.io/trace-chatbot
✨ Si te gusta el articulo, por favor suscribir a mi último.
Para ponerse en contacto, contáctame en LinkedIn o sobre ashmibanerjee.com.
Divulgación de uso de GenAI: Se utilizaron modelos GenAI para comprobar el blog en busca de inconsistencias gramaticales y refinar el texto para mayor claridad.. Los autores asumen total responsabilidad por el contenido presentado en este blog..
![]()
[Tutorial] “Building a Multi-Agent Travel Planner with Google ADK” was originally published in Google Developer Experts on Medium, donde la gente continúa la discusión resaltando y respondiendo a esta historia.
![[Tutorial] Building a Multi-Agent Travel Planner with Google ADK For Windows 7,8,10,11-Winpcsoft.com](https://winpcsoft.com/wp-content/uploads/2026/07/19ZDWpAHmIGHekx3oEx7mGQ.png)