Skip to content
AI Productivity Insights

Tutorial · 3 min read

Building AI Agents with Google ADK

Build AI Agents with Google ADK

Create customizable steps that streamline financial research workflows and generate investment memos—by building your own Agent Runtime from scratch and connecting a Gemini-powered analyst to the ADK Web Dashboard

45 minutes

Intermediate

Agent Runtime / ADK

Updated: Jan 15, 2026

Prerequisites

Before you begin, ensure you have the following prerequisites and technical requirements in place to successfully implement the ADK Agent:

What You’ll Build

By the end of this guide, you will have:

  • ✓ A structured ADK Agent Project running locally.
  • ✓ A custom “Eyes” Tool that parses PDF documents with page-level citations.
  • ✓ A “Brain” configured with a Senior Analyst persona and strict protocols.
  • ✓ A fully functional “Flight Control” Dashboard (via adk web) to debug agent reasoning traces.

Step-By-Step Implementation Walk Through:

(1) Create a new directory named "agent-adk" in your C:\ drive by running the command: mkdir agent-adk

(2) Open Visual Studio Code, click File, and select Open Folder.

Screenshot of Visual Studio Code with the File menu open and Open Folder highlighted, the first step in opening the project folder.

(3) Select the folder “agent-adk”

Screenshot of the Open Folder dialog in Visual Studio Code on the C: drive, with the agent-adk folder selected and a Select Folder button.

(4) Select “New Terminal” from the Menu.

Screenshot of Visual Studio Code with the Terminal menu open and New Terminal highlighted, which opens a PowerShell terminal in the project folder.

(5) Type the following commands in your terminal:

PS C:>agent-adk>python -m venv .venv and press Enter

PS C:>agent-adk>.venv\Scripts\activate (For Windows) or source .venv\bin\activate (For Mac) and press Enter(.venv) and press Enter

(.venv) PS C:>agent-adk>pip install google-adk pypdf and press Enter

(.venv) PS C:>agent-adk>adk create finance_analyst

(6) You will create two files inside the finance_analyst folder.

Step 1: The Eyes (tools.py)

This script handles the “vision” part of the agent. It reads the PDF and inserts the crucial “Page Markers” that allow the AI to cite sources.

File Location: AGENT-ADK/finance_analyst/tools.py

Step 2: The Brain (agent.py)

This defines the “Employee.” We use the root_agent variable (required by ADK) and attach our tool.

File Location: AGENT-ADK/finance_analyst/agent.py

(7) Create a new file called “.env” in Visual Studio Code and replace the placeholder GOOGLE_API_KEY = “YOUR_API_KEY” with your actual API key.

Screenshot of the .env file in the finance_analyst folder in Visual Studio Code, with one line, GOOGLE_API_KEY, whose value is hidden, and the terminal command adk create finance_analyst below.

(8) This is what your folder will look like when we are done. We create a parent folder (agent-adk) to hold the project, and a sub-folder (finance_analyst) for the actual agent code.

Diagram of the project folder: agent-adk is the parent folder, and its finance_analyst agent module holds the .env file for API keys, an init file that makes it a package, agent.py as the brain and tools.py as the eyes.

(9) Type the following commands in your terminal:

(.venv) PS C:\agent-adk> adk web

Screenshot of agent.py in Visual Studio Code, defining a Senior Wall Street Analyst persona that must use the parse_earnings_report tool and cite a page for every fact. The terminal runs adk web, and the ADK Web Server starts at http://127.0.0.1:8000.

(10) What just happened? By running a single command, you spun up a “Flight Control” dashboard that provides far more than just a chat interface:

  1. The X-Ray Trace: On the left panel, you don’t just see the answer; you see the cognitive steps. You can watch the exact moment the agent decides to call parse_earnings_report.

  2. State Inspection: You can view the raw JSON state of the agent’s memory, allowing you to debug exactly what context was retained or lost.

  3. Zero Boilerplate: We went from “Concept” to “Interactive UI” without writing a single line of frontend code.

  4. The Result: Navigate to http://localhost:8000. You will see your Finance Analyst ready to work. Download the file “nvidia_10k.pdf” and attach it to the chat, and press Enter

    Simply ask it to “Analyze the risks in the Nvidia PDF” and press Enter—watch it analyze the document in real time.

Screenshot of the Agent Development Kit Dev UI with the finance_analyst agent. Asked to analyze the risks in an attached nvidia_10k.pdf, it summarizes regulatory, geopolitical and supply chain risks from the Form 10-K, citing the page for each point.

Key Takeaways: What We Learned

  • Build in Parts, Not One Big Chunk: Instead of writing one giant, messy script, we split the agent into three clear parts: The Eyes (reading files), The Brain (thinking), and The Face (the website). This makes it much easier to fix and upgrade later.
  • Give the AI Strict Rules: The difference between a creative writer and a serious analyst is the Instructions. By telling the AI, “You must cite page numbers,” we forced it to be accurate and truthful instead of just making things up.
  • Tools Are Easy to Add: We didn’t need complicated code to let the agent read PDFs. We just wrote a simple Python function, and the ADK framework did the rest. It’s like plugging a USB device into a computer—it just works.
  • Skip the Boring Coding: In the past, we had to write hundreds of lines of code just to make a chat box appear on the screen. With the adk web command, we got a full professional dashboard instantly. This lets us focus on making the AI smarter, not building menus and buttons.
  • Good Data = Good Answers: The AI didn’t magically know the page numbers. We helped it by adding “Page Markers” when we read the PDF. This proves that preparing your data correctly is still the most important step in building a smart agent.

Newsletter

Get AI productivity insights delivered

Practical AI guides, tutorials, and fresh insights in your inbox.