Die meisten Reise-Apps sind auf Beliebtheit und Komfort ausgelegt, Benutzer werden oft auf überfüllte Orte verwiesen, 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.

Bild[1]-[Anleitung] Building a Multi-Agent Travel Planner with Google ADK For Windows 7,8,10,11-Winpcsoft.com
Overview of the TRACE architecture

The backend is created with Google’s Agent Development Kit (ADK). and driven by Zwillinge 2.5 Blitzmit 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.

Notiz: 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:

  1. A basic recommendation: Optimized solely for user relevance.
  2. 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):

Asynchron importieren
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), # Grundlinie: 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 && Quelle .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
aus pydantic import BaseModel, Field
von google.adk.agents Import Agent, ParallelAgent, SequentialAgent
MODEL: str = "gemini-2.5-flash"
class Recommendation(Sie sind Modelle):
recommendation: str = Field(..., description="List of cities")
explanation: str = Field(..., description="A single-sentence justification for the choice.")
class CFEOutput(Sie sind Modelle):
recommendation_shown: str
is_recommendation_sustainable: bool
explanation_shown: str
alternative_recommendation: Optional[str] = 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=[baseline, 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 oder 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

Wenn Ihnen der Artikel gefällt, Bitte abonnieren zu meinem neuesten.
Um Kontakt aufzunehmen, Kontaktieren Sie mich unter
LinkedIn oder ungefähr ashmibanerjee.com.

Offenlegung der GenAI-Nutzung: GenAI-Modelle wurden verwendet, um den Blog auf grammatikalische Inkonsistenzen zu überprüfen und den Text auf Klarheit zu verfeinern. Die Autoren tragen die volle Verantwortung für die in diesem Blog präsentierten Inhalte.

blank


[Anleitung] “Building a Multi-Agent Travel Planner with Google ADK” was originally published in Google Developer Experts on Medium, wo die Leute die Diskussion fortsetzen, indem sie diese Geschichte hervorheben und darauf reagieren.