Skip to content

gdsc-osaka/create-multi-agent

Repository files navigation

Dynamic Travel Planning Agent

ADK 2.1 Graph Workflow と A2A specialist agents を使った「Dynamic Research + Multi-Agent Evaluation 型 旅行計画AIエージェント」です。ユーザーの旅行希望から候補を6案作り、候補ごとに検索リサーチし、費用・快適性・リスク・体験価値を統合評価します。ユーザーには上位3案を提示し、選ばれた案だけを詳細旅程と旅しおり画像にします。

Architecture

Coordinator Agent (port 8100)
  |- analyst
  |- clarification RequestInput (最大2回)
  |- strategist
  |- research_candidate[] + google_search (fan-out / fan-in)
  |- multi_agent_evaluation
  |- Comfort Agent     (RemoteA2aAgent, port 8101)
  |- Risk Agent        (RemoteA2aAgent, port 8102)
  |- Experience Agent  (RemoteA2aAgent, port 8103)
  |- coordinator recommendation (top 3)
  |- user selection / replan RequestInput
  |- BuildSelectedOptionContext FunctionNode
  |- planner
  |- illustrator_prompt_writer
  `- illustrator

research_agent の結果は会話コンテキストに依存せず、join 後に session.state["research_reports"]option_id keyed dict として保存します。planner には State 全体ではなく session.state["selected_option_context"] だけを渡します。

Setup

Install uv first.

make setup
cp .env.example .env

Required environment variables:

# Google AI Studio
GOOGLE_API_KEY=...

Optional environment variables:

COMFORT_A2A_URL=http://localhost:8101
RISK_A2A_URL=http://localhost:8102
EXPERIENCE_A2A_URL=http://localhost:8103

Run

Start the remote evaluation specialists, coordinator, and ADK Web:

make run

Or run them separately:

make run-specialists
make run-coordinator
make web

ADK Web listens on http://localhost:8080.

AG-UI clients can connect to the coordinator through a separate streaming endpoint:

make run-ag-ui

The AG-UI server listens on http://localhost:8200 and accepts POST /ag-ui requests using the Agent User Interaction Protocol event stream format.

Agent cards:

http://localhost:8100/.well-known/agent-card.json
http://localhost:8101/.well-known/agent-card.json
http://localhost:8102/.well-known/agent-card.json
http://localhost:8103/.well-known/agent-card.json

Deploy

Deploy the three A2A evaluation specialists first, then the coordinator with their Agent Runtime A2A card URLs injected:

export GOOGLE_CLOUD_PROJECT=create-multi-agent
export GOOGLE_CLOUD_LOCATION=us-central1
make deploy-all

The deployed Reasoning Engine display names are prefixed with Travel Planning. To inspect or remove deployed resources created by this repo:

./scripts/cleanup_all.sh --dry-run
./scripts/cleanup_all.sh

Sample Input

東京から静かな田舎に行きたいです。公共交通で行けて、温泉があると嬉しいです。予算は3万円以内です。

State

The workflow stores these intermediate artifacts in session.state:

  • raw_user_query: 元のユーザー入力
  • travel_request: analyst が作った TravelRequest
  • clarification_rounds: RequestInput の実行回数
  • travel_options: strategist が作った TravelOption[]
  • research_reports: option_id keyed ResearchReport dict
  • coordinator_recommendation: 上位3案の推薦順位、比較サマリー、評価軸の調停理由
  • selected_option_id: ユーザーが選んだ候補ID
  • selected_option_context: planner に渡す候補限定コンテキスト
  • itinerary_markdown: planner が作成した詳細な旅程
  • illustrator_prompt: 旅しおり表紙画像を生成するための prompt

Repository Layout

agents/coordinator/agent.py           全体の Graph Workflow wiring
agents/coordinator/intake.py          ユーザー希望の構造化と clarification
agents/coordinator/candidates.py      候補生成、検索 research fan-out / fan-in
agents/coordinator/evaluation.py      RemoteA2aAgent specialist 呼び出しと統合評価
agents/coordinator/recommendation.py  推薦、ユーザー選択、詳細旅程、画像生成
agents/comfort/                       RemoteA2aAgent 用 comfort specialist
agents/risk/                          RemoteA2aAgent 用 risk specialist
agents/experience/                    RemoteA2aAgent 用 experience specialist

Implemented

  • ADK Graph Workflow による旅行計画フロー
  • Dynamic Workflow 風の research fan-out / fan-in
  • RequestInput による不足情報確認と候補選択
  • session.state への構造化中間成果物保存
  • google_search tool を使う候補別 research agents
  • RemoteA2aAgent による comfort / risk / experience 評価
  • coordinator agent による費用分析と specialist 評価の統合推薦
  • 条件変更時の再提案ルート
  • planner の markdown 旅程生成と state 保存
  • illustrator prompt writer agent
  • gemini-3-pro-image を使う illustrator agent

Not Implemented / Stretch Goals

  • メール送信
  • 長期 Memory 保存
  • 宿泊予約、交通予約、施設営業日の確定 API 連携
  • 画像生成結果をファイル化して配布用 PDF しおりに組版する処理
  • 候補再提案時の高度な条件差分管理

Development

make lint
make lock

この hands-on example にはリポジトリ内テストスイートはありません。自動チェックは make lint を使います。既存の決定論的なサポート業務テスト、data/src/ は旅行計画エージェント化に伴い削除済みです。

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors