๐ฏ Tutorial 1: Your First ADK Agent โ
Welcome to your first step in the Google ADK journey! This tutorial introduces you to the fundamental concept of creating a simple AI agent using Google's Agent Development Kit.
๐ฏ What You'll Learn โ
- Basic Agent Creation: How to create your first ADK agent
- ADK Workflow: Understanding the agent lifecycle
- Simple Text Processing: Basic input/output handling
- Agent Configuration: Essential parameters and settings
๐ง Core Concept: What is an ADK Agent? โ
An ADK agent is a programmable AI assistant that can:
- Process user inputs (text, images, etc.)
- Use AI models (like Gemini) to understand and respond
- Perform specific tasks based on your instructions
- Return structured or unstructured responses
Think of it as creating a smart function that uses AI to handle complex tasks.
๐ง Key Components โ
1. LlmAgent Class โ
The main building block for creating AI agents in ADK:
python
from google.adk.agents import LlmAgent2. Essential Parameters โ
name: Unique identifier for your agentmodel: The AI model to use (e.g., "gemini-3-flash-preview")description: What your agent doesinstruction: How your agent should behave
3. Basic Workflow โ
- Input: User sends a message
- Processing: Agent uses AI model to understand and respond
- Output: Agent returns a response
๐ Tutorial Overview โ
In this tutorial, we'll create a Creative Writing Agent that:
- Helps users develop story ideas and characters
- Provides writing prompts and inspiration
- Assists with plot structure and pacing
- Demonstrates basic ADK functionality
๐ Project Structure โ
1_starter_agent/
โโโ README.md # This file - concept explanation
โโโ requirements.txt # Dependencies
โโโ creative_writing_agent/ # Agent implementation
โโโ __init__.py # Makes it a Python package
โโโ agent.py # Main agent code๐ฏ Learning Objectives โ
By the end of this tutorial, you'll understand:
- โ How to create a basic ADK agent
- โ Essential agent parameters and their purpose
- โ How to run and test your agent
- โ Basic ADK workflow and lifecycle
๐ Getting Started โ
Set up your environment:
bash# Make sure you have your Google AI API key # Get your API key from: https://aistudio.google.com/Install dependencies:
bash# Install required packages pip install -r requirements.txtRun the creative writing agent:
bash# Start the ADK web interface adk web # In the web interface, select: creative_writing_agentTest your agent:
- Try asking for story ideas: "I want to write a story about a magical forest"
- Get character help: "Help me create a protagonist for my sci-fi story"
- Request writing prompts: "Give me a creative writing prompt"
- Ask for plot advice: "How can I structure my story's climax?"
๐ Next Steps โ
After completing this tutorial, you'll be ready for:
- Tutorial 2: Model agnostic Agent - create agents that work with different AI models
- Tutorial 3: Structured Output Agent - Learn to create type-safe, structured responses
- Tutorial 4: Tool Using Agent - Add custom tools and functions to your agent
๐ก Pro Tips โ
- Start Simple: Begin with basic functionality and add complexity gradually
- Test Often: Use the ADK web interface to test your agents
- Read Instructions: Clear instructions lead to better agent behavior
- Experiment: Try different models and parameters to see the differences