Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
55 changes: 10 additions & 45 deletions docs/get-started/index.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,23 @@
# Get Started
# Get started

Agent Development Kit (ADK) is designed to empower developers
to build, manage, evaluate and deploy AI-powered agents. It provides a robust
and flexible environment for creating both conversational and non-conversational
agents, capable of handling complex tasks and workflows.
Agent Development Kit (ADK) is designed to empower developers to quickly build,
manage, evaluate and deploy AI-powered agents. These quick start guides get you
set up and running a simple agent in less than 20 minutes.

<div class="grid cards" markdown>

- :material-console-line: **Installation**
- :fontawesome-brands-python:{ .lg .middle } **Python Quickstart**

---
Create your first Python ADK agent in minutes.

Install `google-adk` for Python or Java and get up and running in minutes.
[:octicons-arrow-right-24: Start with Python](/adk-docs/get-started/python) <br>

[:octicons-arrow-right-24: More information](installation.md)

- :material-console-line: **Quickstart**

---

Create your first ADK agent with tools in minutes.

[:octicons-arrow-right-24: More information](quickstart.md)

- :material-console-line: **Quickstart (streaming)**

---

Create your first streaming ADK agent.

[:octicons-arrow-right-24: More information](streaming/quickstart-streaming.md)

- :material-console-line: **Tutorial**
- :fontawesome-brands-java:{ .lg .middle } **Java Quickstart**

---
Create your first Java ADK agent in minutes.

Create your first ADK multi-agent.

[:octicons-arrow-right-24: More information](../tutorials/index.md)

- :material-rocket-launch-outline: **Discover sample agents**

---

Discover sample agents for retail, travel, customer service, and more!

[:octicons-arrow-right-24: Discover adk-samples](https://github.com/google/adk-samples){:target="_blank"}

- :material-graph: **About**

---

Learn about the key components of building and deploying ADK agents.

[:octicons-arrow-right-24: More information](about.md)
[:octicons-arrow-right-24: Start with Java](/adk-docs/get-started/java.md) <br>

</div>
131 changes: 131 additions & 0 deletions docs/get-started/java.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# Java Quickstart for ADK

This guide shows you how to get up and running with the Agent Development Kit
for Java. Before you start, make sure you have the following installed:

* Java 17 or later
* Maven 3.9 or later

## Installation

Add the following dependency to your `pom.xml` file:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fully required deps are listed in https://google.github.io/adk-docs/get-started/installation/, so we would need to expand on this step and/or link to the full pom.xml file.


```xml
<dependencies>
<dependency>
<groupId>com.google.adk</groupId>
<artifactId>adk-core</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
```

## Set up your API key

This starter project uses the Gemini API, which requires an API key. If you
don't already have Gemini API key, create a key in Google AI Studio on the
[API Keys](https://aistudio.google.com/app/apikey) page.

In a terminal window, write your API key into an `.env` file as an environment variable:

=== "Windows"

```shell
echo 'GOOGLE_API_KEY="YOUR_API_KEY"' > .env
```

=== "MacOS / Linux"

```shell
echo 'export GOOGLE_API_KEY="YOUR_API_KEY"' > .env
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo 'export GOOGLE_API_KEY="YOUR_API_KEY"' > .env
echo 'GOOGLE_API_KEY="YOUR_API_KEY"' > .env

These are read in as key-value pairs, so no need to export to the current environment.

```

## Create an agent project

Run the `adk create` command to start a new agent project.

```shell
adk create my_agent --language java
```


### Explore the agent project

The created agent project has the following structure, with the `MyAgent.java`
file containing the main control code for the agent.

```shell
my_agent/
src/main/java/com/example/MyAgent.java # main agent code.
pom.xml # project configuration.
.env # API keys or project IDs
```

The `MyAgent.java` file contains a `main` method which is the entry point for
the agent. You can also define tools for the agent to use. The following
example includes an additional `getCurrentTime` tool for use by the agent:

```java
import com.google.adk.agents.Agent;
import com.google.adk.tools.FunctionTool;

import java.util.Map;

public class MyAgent {

public static void main(String[] args) {
var timeTool = new FunctionTool(
"get_current_time",
"Returns the current time in a specified city.",
MyAgent.class,
"getCurrentTime"
);

var agent = Agent.builder()
.setName("time_teller_agent")
.setModel("gemini-1.5-flash")
.setInstruction("You are a helpful assistant that tells the current time in cities. Use the 'get_current_time' tool for this purpose.")
.setDescription("Tells the current time in a specified city.")
.setTools(java.util.List.of(timeTool))
.build();

// TODO: Run the agent
}

public static Map<String, Object> getCurrentTime(String city) {
if (city.equalsIgnoreCase("new york")) {
return Map.of("status", "success", "time", "10:30 AM EST");
}
return Map.of("status", "error", "message", "Time for " + city + " not available.");
}
}
```

## Run your agent

Run your agent using the `adk run` command-line tool.

```shell
adk run my_agent
```

![adk-run.png](../assets/adk-run.png)

### Run agent with web interface

The ADK framework provides web interface you can use to test and interact with
your agent. You can start the web interface using the following terminal

```shell
adk web my_agent
```
This command starts a web server with a chat interface for your agent:

![adk-web-dev-ui-chat.png](../assets/adk-web-dev-ui-chat.png)

## Next: build your agent

Now that you have ADK installed and your first agent running, try building
your own agent with our intermediate build guides:

* [Build your agent](/adk-docs/tutorials/)
121 changes: 121 additions & 0 deletions docs/get-started/python.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Python Quickstart for ADK

This guide shows you how to get up and running with the Agent Development Kit
(ADK) for Python. Before you start, make sure you have the following installed:

* Python 3.9 or later
* `pip` for installing packages

## Installation

Install ADK by running the following command:

```shell
pip install google-adk
```

??? tip "Recommended: create and activate a Python virtual environment"

Create a Python virtual environment:

```shell
python -m venv .venv
```

Activate the Python virtual environment:

=== "Windows CMD"

```shell
.venv\Scripts\activate.bat
```

=== "Windows Powershell"

```shell
.venv\Scripts\Activate.ps1
```

=== "MacOS / Linux"

```shell
source .venv/bin/activate
```

## Create an agent project

Run the `adk create` command to start a new agent project.

```shell
adk create my_agent
```

??? tip "Note: API key required"
The created project uses Gemini, which requires an API key. Create a key in
Google AI Studio on the [API Keys](https://aistudio.google.com/app/apikey) page.
You can also use a Google Cloud project ID with access to the Vertex AI.

### Explore the agent project

The created agent project has the following structure, with the `agent.py`
file containing the main control code for the agent.

```shell
my_agent/
agent.py # main agent code.
.env # API keys or project IDs
__init__.py
```

The `agent.py` file contains a `root_agent` definition which is the only
required element of an ADK agent. You can also define tools for the agent to
use. The following example includes an additional `get_current_time` tool for
use by the agent:

```python
from google.adk.agents.llm_agent import Agent

# Mock tool implementation
def get_current_time(city: str) -> dict:
"""Returns the current time in a specified city."""
if city.lower() == "new york":
return {"status": "success", "time": "10:30 AM EST"}
return {"status": "error", "message": f"Time for {city} not available."}

root_agent = Agent(
model='gemini-2.5-flash',
name='root_agent',
description="Tells the current time in a specified city.",
instruction="You are a helpful assistant that tells the current time in cities. Use the 'get_current_time' tool for this purpose.",
tools=[get_current_time]
)
```

## Run your agent

Run your agent using the `adk run` command-line tool.

```shell
adk run my_agent
```

![adk-run.png](../assets/adk-run.png)

### Run agent with web interface

The ADK framework provides web interface you can use to test and interact with
your agent. You can start the web interface using the following terminal

```shell
adk web my_agent
```
This command starts a web server with a chat interface for your agent:

![adk-web-dev-ui-chat.png](../assets/adk-web-dev-ui-chat.png)

## Next: build your agent

Now that you have ADK installed and your first agent running, try building
your own agent with our intermediate build guides:

* [Build your agent](/adk-docs/tutorials/)
2 changes: 1 addition & 1 deletion docs/get-started/quickstart.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Quickstart
# Build a multi-tool agent

This quickstart guides you through installing the Agent Development Kit (ADK),
setting up a basic agent with multiple tools, and running it locally either in the terminal or in the interactive, browser-based dev UI.
Expand Down
6 changes: 3 additions & 3 deletions docs/get-started/streaming/index.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Streaming Quickstarts
# Build a streaming agent

The Agent Development Kit (ADK) enables real-time, interactive experiences with your AI agents through streaming. This allows for features like live voice conversations, real-time tool use, and continuous updates from your agent.

This page provides quickstart examples to get you up and running with streaming capabilities in both Python and Java ADK.

<div class.="grid cards" markdown>

- :fontawesome-brands-python:{ .lg .middle } **Python ADK: Streaming Quickstart**
- :fontawesome-brands-python:{ .lg .middle } **Python ADK: Streaming agent**

---
This example demonstrates how to set up a basic streaming interaction with an agent using Python ADK. It typically involves using the `Runner.run_live()` method and handling asynchronous events.
Expand All @@ -16,7 +16,7 @@ This page provides quickstart examples to get you up and running with streaming

<!-- This comment forces a block separation -->

- :fontawesome-brands-java:{ .lg .middle } **Java ADK: Streaming Quickstart**
- :fontawesome-brands-java:{ .lg .middle } **Java ADK: Streaming agent**

---
This example demonstrates how to set up a basic streaming interaction with an agent using Java ADK. It involves using the `Runner.runLive()` method, a `LiveRequestQueue`, and handling the `Flowable<Event>` stream.
Expand Down
2 changes: 1 addition & 1 deletion docs/get-started/streaming/quickstart-streaming-java.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Quickstart (Streaming / Java) {#adk-streaming-quickstart-java}
# Build a streaming agent with Java

This quickstart guide will walk you through the process of creating a basic agent and leveraging ADK Streaming with Java to facilitate low-latency, bidirectional voice interactions.

Expand Down
2 changes: 1 addition & 1 deletion docs/get-started/streaming/quickstart-streaming.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Quickstart (Streaming / Python) {#adk-streaming-quickstart}
# Build a streaming agent with Python

With this quickstart, you'll learn to create a simple agent and use ADK Streaming to enable voice and video communication with it that is low-latency and bidirectional. We will install ADK, set up a basic "Google Search" agent, try running the agent with Streaming with `adk web` tool, and then explain how to build a simple asynchronous web app by yourself using ADK Streaming and [FastAPI](https://fastapi.tiangolo.com/).

Expand Down
Loading