Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/update-python-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.ADK_BOT_GITHUB_TOKEN }}
GOOGLE_CLOUD_PROJECT: ${{ secrets.GOOGLE_CLOUD_PROJECT }}
GOOGLE_CLOUD_LOCATION: ${{ secrets.GOOGLE_CLOUD_LOCATION }}
GOOGLE_GENAI_USE_VERTEXAI: 1
GOOGLE_GENAI_USE_ENTERPRISE: 1
DOC_OWNER: 'google'
DOC_REPO: 'adk-docs'
CODE_OWNER: 'google'
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,7 @@ docs/site
# Ignore a local build but keep the directory
/site/*
!/site/.gitkeep

# Compiled Go example binaries (accidentally committed build artifacts)
/examples/go/index
/examples/go/main
145 changes: 136 additions & 9 deletions docs/2.0/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ hide:

# Welcome to ADK 2.0

<div class="language-support-tag">
<span class="lst-supported">Supported in ADK</span><span class="lst-python">Python v2.0.0</span><span class="lst-go">Go v2.0.0</span>
</div>

ADK 2.0 introduces powerful tools for building sophisticated AI agents, and
helps you structure agents to execute challenging tasks with more control,
predictability, and reliability. ADK 2.0 is available for Python and includes
the following key features:
predictability, and reliability. ADK 2.0 is available for Python and Go and
includes the following key features:

- [**Graph-based workflows**](/graphs/): Build deterministic agent
workflows with more control over how tasks are routed and executed.
Expand All @@ -28,6 +32,10 @@ to build agents with ADK 2.0!

ADK Python 2.0 is released for general availability as of May 19, 2026.

!!! tip "ADK Go v2.0.0 GA release"

ADK Go 2.0 is released for general availability as of June 30, 2026.

## ADK Python 1.x compatibility

ADK 2.0 is designed to be compatible with agents developed with ADK 1.x
Expand All @@ -47,7 +55,7 @@ architecture, your Agents, Tools, and Functions are evaluated as individual
following breaking changes and migration steps to ensure a smooth transition for
your production applications.

### Event Schema & Custom Session Databases
### Event Schema & Custom Session Storage

ADK 2.0 introduces new fields `node_info` and `output` to the core
***Event*** schema to track graph state and workflow outputs.
Expand Down Expand Up @@ -123,8 +131,8 @@ so the framework can evaluate them against your configured ***RetryConfig***,
such as `RetryConfig(max_attempts=3)`. Never catch ***BaseException*** unless
you are explicitly re-raising the exception.

If you encounter additional ADK 1.0 to ADK 2.0 incompatibilities, report them
through the
If you encounter additional ADK Python 1.0 to ADK 2.0 incompatibilities, report
them through the
[issue tracker](https://github.com/google/adk-python/issues/new?template=bug_report.md&labels=v2).


Expand Down Expand Up @@ -176,6 +184,119 @@ To install the latest version of ADK 1.x, follow these steps:
source .venv/bin/activate
```

## ADK Go 1.x compatibility

ADK Go 2.0 is designed to be compatible with agents developed with ADK Go 1.x
releases. However, there are a few breaking changes you should be aware of
before upgrading an ADK Go 1.x project to ADK Go 2.0.

!!! warning "Breaking changes: ADK Go 1.x to 2.0 incompatibilities"

There are several known incompatibilities and breaking changes introduced
with ADK Go v2.0.0. Before upgrading, review these changes and take
mitigation steps, if necessary.

The ADK Go 2.0 release introduces the Workflow Runtime, transitioning ADK Go
from a hierarchical agent executor to a graph-based execution engine. In this
new architecture, your Agents, Tools, and Functions are evaluated as individual
*nodes* within a workflow graph. If you are upgrading from ADK Go 1.x, review
the following breaking changes and migration steps.

### Module import path

ADK Go 2.0 uses a new major version module path. You must update all import
paths in your Go source files and your `go.mod` file.

* **1.x import path:** `google.golang.org/adk`
* **2.0 import path:** `google.golang.org/adk/v2`

**Migration action:** Run `go get google.golang.org/adk/v2` and update
all import statements in your source files from `google.golang.org/adk/...` to
`google.golang.org/adk/v2/...`.

### Agent Execution: Agent interface changes

In ADK Go 1.x, agents implemented the `agent.Agent` interface by providing a
`Run` method. In ADK Go 2.0, agents are evaluated as individual *nodes* within
the new Workflow Graph engine.

* **Execution driver custom overrides:** Custom agent types that override
internal execution behavior may no longer work as expected. The Workflow
Graph engine manages execution scheduling and event emission, and custom
implementations that bypass these mechanisms are silently ignored.

**Migration action:** Move custom execution logic into standardized
`BeforeAgentCallback` and `AfterAgentCallback` hooks to safely inject custom
logic into the execution lifecycle.

### Event Construction: `session.NewEvent` signature change

`session.NewEvent` now requires a `context.Context` as its first argument:

```go
// Before (ADK Go 1.x)
ev := session.NewEvent(ctx.InvocationID())
// or
ev := session.NewEventWithContext(ctx, ctx.InvocationID())

// After (ADK Go 2.0)
ev := session.NewEvent(ctx, ctx.InvocationID())
```

The event ID and timestamp are now obtained through the `platform` package,
so a time or UUID provider installed on `ctx` controls them. This lets workflow
engines produce deterministic, replay-safe events. The previous
parameterless-context form and the temporary `NewEventWithContext` helper are
removed.

**Migration action:** Pass the context already in scope as the first argument
to `session.NewEvent`. Any `context.Context` works — the `ctx` of an agent,
tool, or callback (which embed `context.Context`), a request context, or in
tests, `t.Context()`. If a helper that calls `NewEvent` does not yet receive a
context, add a `ctx context.Context` parameter and thread it down from the
caller. Avoid creating a new `context.Background()` mid-call-chain; reserve
that for `main`, `init`, and top-level test setup.

### Event Schema & Custom Session Storage

ADK Go 2.0 adds five new fields to the core ***Event*** struct to support
graph routing, workflow state, and human-in-the-loop pausing:

| Go field | Serialized name | Purpose |
|---|---|---|
| `IsolationScope string` | `isolationScope` (`json:"isolationScope,omitempty"`) | Restricts which agent contexts see this event in LLM prompt history. |
| `Routes []string` | `Routes` (no JSON tag) | Routing keys emitted by a node to drive conditional edge dispatch. |
| `RequestedInput *RequestInput` | `RequestedInput` (no JSON tag) | Signals that a workflow node is pausing for human input. |
| `Output any` | `Output` (no JSON tag) | Generic data output from a workflow node. |
| `NodeInfo *NodeInfo` | `nodeInfo` (`json:"nodeInfo,omitempty"`) | Workflow-node metadata identifying which node emitted the event. |

* **Custom session storage:** If you have implemented a custom
`session.Service`, such as storing sessions in your own SQL or NoSQL
databases with rigid schemas, your underlying database schema must be
updated to accommodate all five new fields. Inserting a 2.0 ***Event***
into a rigid 1.x database table causes insertion or deserialization
failures. *However, if your custom session service stores events as
serialized JSON blobs, you do not need to update your schema.*

**Migration action:** Update your database schemas and downstream client
validators to expect and store the five new fields on all Event payloads.
Pay particular attention to `Routes`, `RequestedInput`, and `Output`, which
have no JSON struct tags and therefore serialize under their Go field names
exactly as shown above.

If you encounter additional ADK Go 1.0 to ADK 2.0 incompatibilities, report
them through the
[issue tracker](https://github.com/google/adk-go/issues/new?template=bug_report.md&labels=v2).

### Installing ADK Go 1.x {#install-go}

If you want to continue using ADK Go 1.x and are not yet ready to upgrade to
ADK Go 2.0, pin your dependency to the 1.x release line:

```shell
go get google.golang.org/adk@v1
```

## Next steps

Read the developer guides for building agents with ADK 2.0 features:
Expand All @@ -186,8 +307,14 @@ Read the developer guides for building agents with ADK 2.0 features:

Check out these ADK 2.0 code samples for testing and inspiration:

- [**Workflow samples**](https://github.com/google/adk-python/tree/v2/contributing/workflow_samples)
- [**Collaborative task samples**](https://github.com/google/adk-python/tree/v2/contributing/task_samples)
=== "Python"

- [**Workflow samples**](https://github.com/google/adk-python/tree/main/contributing/samples/workflows)
- [**Collaborative task samples**](https://github.com/google/adk-python/tree/main/contributing/samples/multi_agent)

=== "Go"

- [**All workflow agents samples**](https://github.com/google/adk-go/tree/main/examples/workflow)
- [**Collaborative task sample**](https://github.com/google/adk-go/tree/main/examples/multiagent/collaboration)

Thanks for checking out ADK 2.0! We look forward to your
[feedback](https://github.com/google/adk-python/issues/new?template=feature_request.md&labels=v2)!
Thanks for checking out ADK 2.0! We look forward to your feedback — let us know on [ADK Go](https://github.com/google/adk-go/issues/new) or [ADK Python](https://github.com/google/adk-python/issues/new).
4 changes: 2 additions & 2 deletions docs/agents/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ To create an ADK project for use with Agent Config:
1. For Gemini model access through Google API, add a line to the
file with your API key:

GOOGLE_GENAI_USE_VERTEXAI=0
GOOGLE_GENAI_USE_ENTERPRISE=0
GOOGLE_API_KEY=<your-Google-Gemini-API-key>

You can get an API key from the Google AI Studio
[API Keys](https://aistudio.google.com/app/apikey) page.

1. For Gemini model access through Google Cloud, add these lines to the file:

GOOGLE_GENAI_USE_VERTEXAI=1
GOOGLE_GENAI_USE_ENTERPRISE=1
GOOGLE_CLOUD_PROJECT=<your_gcp_project>
GOOGLE_CLOUD_LOCATION=us-central1

Expand Down
25 changes: 25 additions & 0 deletions docs/agents/llm-agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,28 @@ Control whether the agent receives the prior conversation history.
.build();
```

!!! note "Go v2.0.0: agent execution modes"

ADK Go v2.0.0 introduces an explicit `Mode` field on `llmagent.Config` that
controls how the agent runs when used inside a graph-based or dynamic
workflow. Three modes are available:

- **`ModeChat`** (default for an agent used as a sub-agent): The agent
participates in a multi-turn conversation with the user and is reachable
from peer agents via `transfer_to_agent`.
- **`ModeSingleTurn`** (default for an agent used as a node in a
workflow): The agent completes its task in a single turn without
chatting with the user.
- **`ModeTask`**: A task agent that chats with the user to accomplish a
task — in contrast to `ModeSingleTurn`, it can interact with the user
across turns to complete the work.

When you wrap an `llmagent` with `workflow.NewAgentNode`, the workflow
engine automatically sets the mode to `ModeSingleTurn` if no mode is
specified — equivalent to Python's `mode="single_turn"` on an agent used
as a workflow node. For more information on composing agents in graph-based
workflows, see [Graph-based agent workflows](/graphs/).

### Planner

<div class="language-support-tag" title="">
Expand Down Expand Up @@ -795,3 +817,6 @@ the following:
planning (`planner`), controlling agent transfer
(`disallow_transfer_to_parent`, `disallow_transfer_to_peers`), and system-wide
instructions (`global_instruction`). See [Custom agent workflows](/agents/custom-agents/).
* **Graph-based workflows:** Compose LLM agents as steps in deterministic,
graph-based pipelines using [Graph-based agent workflows](/graphs/). In Go v2.0.0, use
`workflow.NewAgentNode` to wrap any LLM agent as a workflow node.
4 changes: 2 additions & 2 deletions docs/agents/models/agent-platform.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ Agent Platform.
**Setup:**

1. **Agent Platform Environment:** Ensure the consolidated Agent Platform setup (ADC, Env
Vars, `GOOGLE_GENAI_USE_VERTEXAI=TRUE`) is complete.
Vars, `GOOGLE_GENAI_USE_ENTERPRISE=TRUE`) is complete.

2. **Install Provider Library:** Install the necessary client library configured
for Agent Platform.
Expand Down Expand Up @@ -278,7 +278,7 @@ Agent Platform offers a curated selection of open-source models, such as Meta Ll
**Setup:**

1. **Agent Platform Environment:** Ensure the consolidated Agent Platform setup (ADC, Env
Vars, `GOOGLE_GENAI_USE_VERTEXAI=TRUE`) is complete.
Vars, `GOOGLE_GENAI_USE_ENTERPRISE=TRUE`) is complete.

2. **Install LiteLLM:**
```shell
Expand Down
6 changes: 3 additions & 3 deletions docs/agents/workflow-agents/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ how and when other agents run, defining the control flow of a process.

!!! note "Alternative: graph-based workflows"

Starting in ADK 2.0, template workflows have been superseded
Starting in ADK 2.0 for Python and Go, template workflows have been superseded

by more flexible workflow structures, including
[graph-based workflows](/workflows/graphs/) and
[dynamic workflows](/workflows/dynamic/).
[graph-based workflows](/graphs/) and
[dynamic workflows](/graphs/dynamic/).
These workflow architectures provide more control, flexibility
and capability to evolve your agent workflows over time.

Expand Down
6 changes: 3 additions & 3 deletions docs/agents/workflow-agents/loop-agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ the ***LoopAgent*** object you define.

!!! note "Alternative: graph-based workflows"

Starting in ADK 2.0, templated workflows have been superseded
Starting in ADK 2.0 for Python and Go, templated workflows have been superseded

by more flexible workflow structures, including
[graph-based workflows](/workflows/graphs/) and
[dynamic workflows](/workflows/dynamic/).
[graph-based workflows](/graphs/) and
[dynamic workflows](/graphs/dynamic/).

### Example scenario

Expand Down
6 changes: 3 additions & 3 deletions docs/agents/workflow-agents/parallel-agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ ultimately managed by the ***ParallelAgent*** object you define.

!!! note "Alternative: graph-based workflows"

Starting in ADK 2.0, templated workflows have been superseded
Starting in ADK 2.0 for Python and Go, templated workflows have been superseded

by more flexible workflow structures, including
[graph-based workflows](/workflows/graphs/) and
[dynamic workflows](/workflows/dynamic/).
[graph-based workflows](/graphs/) and
[dynamic workflows](/graphs/dynamic/).

### How it works

Expand Down
6 changes: 3 additions & 3 deletions docs/agents/workflow-agents/sequential-agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ object you define.

!!! note "Alternative: graph-based workflows"

Starting in ADK 2.0, templated workflows have been superseded
Starting in ADK 2.0 for Python and Go, templated workflows have been superseded

by more flexible workflow structures, including
[graph-based workflows](/workflows/graphs/) and
[dynamic workflows](/workflows/dynamic/).
[graph-based workflows](/graphs/) and
[dynamic workflows](/graphs/dynamic/).

### Example scenario

Expand Down
6 changes: 3 additions & 3 deletions docs/deploy/cloud-run.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Set your environment variables as described in the [Setup and Installation](../g
```bash
export GOOGLE_CLOUD_PROJECT=your-project-id
export GOOGLE_CLOUD_LOCATION=us-central1 # Or your preferred location
export GOOGLE_GENAI_USE_VERTEXAI=True
export GOOGLE_GENAI_USE_ENTERPRISE=True
```

For more information on connecting to Google Cloud from ADK agents, see
Expand Down Expand Up @@ -327,7 +327,7 @@ unless you specify it as deployment setting, such as the `--with_ui` option for
--region $GOOGLE_CLOUD_LOCATION \
--project $GOOGLE_CLOUD_PROJECT \
--allow-unauthenticated \
--set-env-vars="GOOGLE_CLOUD_PROJECT=$GOOGLE_CLOUD_PROJECT,GOOGLE_CLOUD_LOCATION=$GOOGLE_CLOUD_LOCATION,GOOGLE_GENAI_USE_VERTEXAI=$GOOGLE_GENAI_USE_VERTEXAI"
--set-env-vars="GOOGLE_CLOUD_PROJECT=$GOOGLE_CLOUD_PROJECT,GOOGLE_CLOUD_LOCATION=$GOOGLE_CLOUD_LOCATION,GOOGLE_GENAI_USE_ENTERPRISE=$GOOGLE_GENAI_USE_ENTERPRISE"
# Add any other necessary environment variables your agent might need
```

Expand Down Expand Up @@ -570,7 +570,7 @@ unless you specify it as deployment setting, such as the `--with_ui` option for
--region $GOOGLE_CLOUD_LOCATION \
--project $GOOGLE_CLOUD_PROJECT \
--allow-unauthenticated \
--set-env-vars="GOOGLE_CLOUD_PROJECT=$GOOGLE_CLOUD_PROJECT,GOOGLE_CLOUD_LOCATION=$GOOGLE_CLOUD_LOCATION,GOOGLE_GENAI_USE_VERTEXAI=$GOOGLE_GENAI_USE_VERTEXAI"
--set-env-vars="GOOGLE_CLOUD_PROJECT=$GOOGLE_CLOUD_PROJECT,GOOGLE_CLOUD_LOCATION=$GOOGLE_CLOUD_LOCATION,GOOGLE_GENAI_USE_ENTERPRISE=$GOOGLE_GENAI_USE_ENTERPRISE"
# Add any other necessary environment variables your agent might need
```

Expand Down
10 changes: 5 additions & 5 deletions docs/deploy/gke.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

To deploy your agent you will need to have a Kubernetes cluster running on GKE. You can create a cluster using the Google Cloud Console or the `gcloud` command line tool.

In this example we will deploy a simple agent to GKE. The Python agent is a FastAPI application that uses `Gemini Flash` as the LLM. The Go agent uses the ADK launcher and a statically-linked binary in a minimal container. We can use Vertex AI or AI Studio as the LLM provider.
In this example deploys a simple agent to GKE. The Python agent is a FastAPI application that uses `Gemini Flash` as the LLM. The Go agent uses the ADK launcher and a statically-linked binary in a minimal container. We can use Vertex AI or AI Studio as the LLM provider. You can use Agent Platform or AI Studio as the LLM provider with the environment variable `GOOGLE_GENAI_USE_ENTERPRISE`.

## Environment variables

Expand All @@ -17,7 +17,7 @@ Set your environment variables as described in the [Setup and Installation](../g
```bash
export GOOGLE_CLOUD_PROJECT=your-project-id # Your GCP project ID
export GOOGLE_CLOUD_LOCATION=us-central1 # Or your preferred location
export GOOGLE_GENAI_USE_VERTEXAI=true # Set to true if using Agent Platform
export GOOGLE_GENAI_USE_ENTERPRISE=true # Set to true if using Agent Platform
export GOOGLE_CLOUD_PROJECT_NUMBER=$(gcloud projects describe --format json $GOOGLE_CLOUD_PROJECT | jq -r ".projectNumber")
```

Expand Down Expand Up @@ -479,9 +479,9 @@ spec:
value: $GOOGLE_CLOUD_PROJECT
- name: GOOGLE_CLOUD_LOCATION
value: $GOOGLE_CLOUD_LOCATION
- name: GOOGLE_GENAI_USE_VERTEXAI
value: "$GOOGLE_GENAI_USE_VERTEXAI"
# If using AI Studio, set GOOGLE_GENAI_USE_VERTEXAI to false and set the following:
- name: GOOGLE_GENAI_USE_ENTERPRISE
value: "$GOOGLE_GENAI_USE_ENTERPRISE"
# If using AI Studio, set GOOGLE_GENAI_USE_ENTERPRISE to false and set the following:
# - name: GOOGLE_API_KEY
# value: $GOOGLE_API_KEY
# Add any other necessary environment variables your agent might need
Expand Down
Loading
Loading