A multi-agent Google ADK system running durably on Temporal with the
googleadk contrib
integration. A coordinator root agent delegates the user's request to one of two
specialist SubAgents:
- a
weatherspecialist that owns theget_weathertool (an ordinary Temporal activity exposed viagoogleadk.ActivityAsTool), and - a
jokesspecialist.
The coordinator picks a specialist by emitting ADK's built-in transfer_to_agent
call. That transfer is resolved in-workflow — it is not a separate Temporal
workflow or a network round-trip — so the whole delegation is deterministic and
replayable. Only the per-agent model calls and the get_weather tool cross the
Activity boundary.
Each agent is given a distinct model name (gemini-2.0-flash-coordinator,
-weather, -jokes) so tests can register and script a separate FakeModel per
agent; in production all three names resolve to the same real Gemini model behind
googleadk.InvokeModel.
- A running Temporal server
(e.g.
temporal server start-dev). - A Gemini API key from https://aistudio.google.com/apikey, exported worker-side.
-
Start a Temporal server (see prerequisites).
-
In a second terminal, start the worker:
export GEMINI_API_KEY=...
go run googleadk/multiagent/worker/main.go- In a third terminal, run the starter:
go run googleadk/multiagent/starter/main.goThe starter asks a weather question; the coordinator transfers to the weather
specialist, which calls get_weather and answers. In the Temporal UI you will see
one googleadk.InvokeModel Activity per agent turn plus the get_weather Activity.
workflow_test.go scripts each agent's FakeModel (coordinator transfers to
weather; the weather specialist calls get_weather then answers) and asserts the
transfer took effect, so it needs no API key or network:
go test ./googleadk/multiagent/...