examples/

directory
v2.0.0-...-c9ed136 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2026 License: Apache-2.0

README

ADK GO samples

This folder hosts examples to test different features. The examples are usually minimal and simplistic to test one or a few scenarios.

Note: This is different from the google/adk-samples repo, which hosts more complex e2e samples for customers to use or modify directly.

Launcher

In many examples you can see such lines:

l := full.NewLauncher()
err = l.ParseAndRun(ctx, config, os.Args[1:], universal.ErrorOnUnparsedArgs)
if err != nil {
    log.Fatalf("run failed: %v\n\n%s", err, l.FormatSyntax())
}

it allows to decide, which launching options are supported in the run-time. full.NewLauncher() includes all major ways you can run the example:

  • console
  • restapi
  • a2a
  • webui (it can run standalone or with restapi or a2a).

Run go run ./example/quickstart/main.go help for details

As an alternative, you may want to use prod.NewLauncher() which only builds-in restapi and a2a launchers.

Directories

Path Synopsis
Package main provides an example ADK agent that uses A2A.
Package main provides an example ADK agent that uses A2A.
Package provides a quickstart for Agent Engine deployment
Package provides a quickstart for Agent Engine deployment
Package provides a quickstart ADK agent.
Package provides a quickstart ADK agent.
sequential command
Package main provides an example of using sequential agents with real-time bidirectional streaming.
Package main provides an example of using sequential agents with real-time bidirectional streaming.
streamingtool command
Package provides a quickstart ADK agent.
Package provides a quickstart ADK agent.
Package provides an example ADK agent that uses MCP tools.
Package provides an example ADK agent that uses MCP tools.
multiagent
collaboration command
Package main demonstrates a collaborative agent team that uses all three LLM agent modes together: the root llmagent.ModeChat coordinator delegates to a llmagent.ModeSingleTurn sub-agent for autonomous lookups and to a llmagent.ModeTask sub-agent for multi-turn data collection.
Package main demonstrates a collaborative agent team that uses all three LLM agent modes together: the root llmagent.ModeChat coordinator delegates to a llmagent.ModeSingleTurn sub-agent for autonomous lookups and to a llmagent.ModeTask sub-agent for multi-turn data collection.
single_turn command
Package main demonstrates how a "single_turn" mode agent can act as an autonomous sub-agent to an LLM agent, utilizing schemas and tools without ever interacting with the user.
Package main demonstrates how a "single_turn" mode agent can act as an autonomous sub-agent to an LLM agent, utilizing schemas and tools without ever interacting with the user.
task_sub_agent command
Package main demonstrates how a "task mode" agent can act as a sub-agent to an LLM agent, effectively extracting structured data from a conversational flow.
Package main demonstrates how a "task mode" agent can act as a sub-agent to an LLM agent, effectively extracting structured data from a conversational flow.
Package provides a quickstart ADK agent.
Package provides a quickstart ADK agent.
Package provides an example ADK REST API server with an ADK agent.
Package provides an example ADK REST API server with an ADK agent.
Package provides an example of using skills via skill toolset.
Package provides an example of using skills via skill toolset.
Package provides a quickstart ADK agent with telemetry.
Package provides a quickstart ADK agent with telemetry.
Package provides an example console app for tool confirmation.
Package provides an example console app for tool confirmation.
tools
loadartifacts command
Package provides an example ADK agent that loads and describes artifacts.
Package provides an example ADK agent that loads and describes artifacts.
loadmemory command
Package main provides an example ADK agent that uses the load_memory and preload_memory tools to retrieve memories from previous conversations.
Package main provides an example ADK agent that uses the load_memory and preload_memory tools to retrieve memories from previous conversations.
multipletools command
Package demonstrates a workaround for using Google Search tool with other tools.
Package demonstrates a workaround for using Google Search tool with other tools.
imagegenerator command
Package main demonstrates how to create an agent that can generate images using Vertex AI's Imagen model, save them as artifacts, and then save them to the local filesystem.
Package main demonstrates how to create an agent that can generate images using Vertex AI's Imagen model, save them as artifacts, and then save them to the local filesystem.
vertexengine command
web
agents
Package agents contains sample agents to demonstate ADK Web Capabilities.
Package agents contains sample agents to demonstate ADK Web Capabilities.
workflow
basic command
complex command
Command complex demonstrates a fan-out / fan-in research pipeline built on the graph workflow engine: three researcher agents run concurrently, a JoinNode barrier gathers their findings, a function node formats them, and a single-turn synthesis agent merges everything into one structured report.
Command complex demonstrates a fan-out / fan-in research pipeline built on the graph workflow engine: three researcher agents run concurrently, a JoinNode barrier gathers their findings, a function node formats them, and a single-turn synthesis agent merges everything into one structured report.
dynamic/basic command
Dynamic workflow example: a parent dynamic node orchestrates a single child via workflow.RunNode.
Dynamic workflow example: a parent dynamic node orchestrates a single child via workflow.RunNode.
dynamic/hitl command
Dynamic workflow + HITL example: a dynamic orchestrator pauses for human input via workflow.RunNode, then resumes and greets the user.
Dynamic workflow + HITL example: a dynamic orchestrator pauses for human input via workflow.RunNode, then resumes and greets the user.
dynamic/llm command
Dynamic workflow + LLM example: a dynamic orchestrator calls a single LlmAgent-backed node via workflow.RunNode.
Dynamic workflow + LLM example: a dynamic orchestrator calls a single LlmAgent-backed node via workflow.RunNode.
hitl_rerun command
hitl_rerun shows the re-entry HITL pattern: a single emitting FunctionNode both pauses for input and produces the final output.
hitl_rerun shows the re-entry HITL pattern: a single emitting FunctionNode both pauses for input and produces the final output.
hitl_simple command
hitl_simple is the minimal end-to-end HITL workflow for verifying the console launcher's pause/resume support.
hitl_simple is the minimal end-to-end HITL workflow for verifying the console launcher's pause/resume support.
routing/int command
Command int demonstrates numeric routing with workflow.IntRoute / workflow.MultiRoute: a node rolls a random integer 1..10 and the engine dispatches to one of three branches based on the value.
Command int demonstrates numeric routing with workflow.IntRoute / workflow.MultiRoute: a node rolls a random integer 1..10 and the engine dispatches to one of three branches based on the value.
routing/llm command
Command llm demonstrates LLM-driven routing: an LLM agent classifies the user's message into one word, and a downstream node turns that into an Event.Routes value dispatched via workflow.StringRoute.
Command llm demonstrates LLM-driven routing: an LLM agent classifies the user's message into one word, and a downstream node turns that into an Event.Routes value dispatched via workflow.StringRoute.
routing/string command
Command string demonstrates string routing with workflow.StringRoute: a node classifies the user's message into a category and the engine dispatches to one of three branches.
Command string demonstrates string routing with workflow.StringRoute: a node classifies the user's message into a category and the engine dispatches to one of three branches.
workflowagents
loop command
Package demonstrates a workflow agent that runs a loop agent.
Package demonstrates a workflow agent that runs a loop agent.
parallel command
Package demonstrates a workflow agent that runs sub-agents in parallel.
Package demonstrates a workflow agent that runs sub-agents in parallel.
sequential command
Package demonstrates a workflow agent that runs sub-agents sequentially.
Package demonstrates a workflow agent that runs sub-agents sequentially.
sequentialCode command
Package demonstrates a coding workflow agent that runs sub-agents sequentially.
Package demonstrates a coding workflow agent that runs sub-agents sequentially.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL