Copy-paste solutions for common ADK (Agent Development Kit) tasks
ADK by Example provides working code examples organized by what you need to accomplish, not by ADK features.
Instead of reading through documentation to understand concepts, find exactly what you need:
- π "I need my agent to search Google" β Here's the code
- π "I need to call my REST API" β Copy this example
- π’ "I need to deploy to Cloud Run" β Follow these steps
- π€ "I need multiple agents working together" β Use this pattern
Think of it as Stack Overflow's best answers, but organized and tested.
Visit https://lavinigam-gcp.github.io/adk-by-example/ to:
- π Search by what you need: "I want to search Google", "deploy my agent"
- π Dark mode support: Automatically detects your system preference
- π± Mobile-friendly: Responsive design works on all devices
- β‘ Quick actions: One-click copy for all commands
- βΏ Accessible: WCAG 2.1 AA compliant with keyboard navigation
- π·οΈ Smart filtering: Filter by category and search simultaneously
# Clone the repository
git clone https://github.com/lavinigam-gcp/adk-by-example.git
cd adk-by-example
# Set up your environment
cp .env.example .env
# Edit .env and add your GOOGLE_API_KEY (minimum requirement)# Navigate to examples directory
cd examples
# Start ADK web interface
adk web
# Select any agent from the dropdown and start chatting!# Option 1: Copy specific example
cp -r examples/01-getting-started/first-agent ~/my-project/
# Option 2: Use as reference and build your own
cat examples/03-adding-capabilities/search-google/agent.py| Example | Description | Difficulty |
|---|---|---|
first-agent |
Working agent in 10 lines of code | β |
understand-basics |
Agent with detailed comments explaining each part | β |
use-config-yaml |
No-code agent using YAML configuration | β |
| Example | Description | Difficulty |
|---|---|---|
use-gemini-free |
Quick start with free Google AI Studio key | β |
use-vertex-ai |
Production setup with Google Cloud | ββ |
use-claude |
Integrate Anthropic's Claude | ββ |
local-ollama |
Run models locally for offline development | ββ |
| Example | Description | Difficulty |
|---|---|---|
search-google |
Add web search capability to your agent | β |
call-rest-api |
Integrate with any REST API | ββ |
query-bigquery |
Query BigQuery databases | ββ |
execute-code |
Run Python code safely | βββ |
| Example | Description | Difficulty |
|---|---|---|
route-to-experts |
Coordinator routing to specialist agents | ββ |
process-pipeline |
Sequential processing pipeline | ββ |
parallel-research |
Concurrent agent execution | βββ |
review-loop |
Critic-refiner pattern | βββ |
| Example | Description | Difficulty |
|---|---|---|
chat-with-history |
Maintain conversation history | β |
share-between-agents |
Share data between agents | ββ |
persist-to-firestore |
Store state in database | ββ |
| Example | Description | Difficulty |
|---|---|---|
deploy-cloud-run |
Deploy to Cloud Run | ββ |
add-monitoring |
Add telemetry and monitoring | ββ |
handle-errors |
Robust error handling | ββ |
rate-limiting |
Implement rate limits | βββ |
| Example | Description | Difficulty |
|---|---|---|
stream-responses |
Real-time streaming output | βββ |
human-approval |
Human-in-the-loop pattern | βββ |
custom-workflow |
Complex orchestration logic | βββ |
# You only need one API key to start
GOOGLE_API_KEY=your-key-here # Get free at https://aistudio.google.com/app/apikeySee .env.example for all available configuration options.
adk-by-example/
βββ examples/ # All runnable examples
β βββ 01-getting-started/ # Beginner examples
β βββ 02-connecting-llms/ # Model integrations
β βββ 03-adding-capabilities/ # Tools and APIs
β βββ 04-orchestrating-agents/# Multi-agent patterns
β βββ 05-managing-context/ # State management
β βββ 06-going-production/ # Deployment
β βββ 07-advanced-patterns/ # Complex scenarios
βββ website/ # Documentation site
βββ scripts/ # Utility scripts
β βββ validate_examples.py # Test all examples
β βββ create_example.py # Scaffold new example
βββ .env.example # Environment template
βββ README.md # You are here
| Resource | Focus | Best For | Format |
|---|---|---|---|
| ADK by Example | Solving specific problems | "I need to..." scenarios | Copy-paste code |
| Official Docs | Understanding ADK concepts | Learning how ADK works | Reference guide |
| Code Samples | Demonstrating features | Exploring capabilities | Complex demos |
| Tutorials | Step-by-step learning | Deep understanding | Long-form guides |
- JTBD-First: Organized by what developers need to do, not by features
- Copy-Paste Ready: Every example works immediately after cloning
- Minimal Setup: Single
.envfile configuration for all examples - Real-World Focus: Examples solve actual problems, not toy demos
- Progressive Learning: Start simple, link to more complex variations
- Well-Tested: All examples verified with
adk webcommand - Grounded in Reality: Every example based on official ADK samples
Problem: "Agent not showing in adk web"
- Solution: Ensure
__init__.pyexists in the example folder
Problem: "Import errors when running"
- Solution: Run from the
examples/directory, not from individual example folders
Problem: "API key errors"
- Solution: Check
.envfile exists and contains validGOOGLE_API_KEY
- π Official ADK Documentation
- π¬ GitHub Issues
- π Contributing Guide
- Phase 1: Repository structure and foundation (β Complete)
- Phase 2: Getting Started category with 6 examples (β Complete)
- Phase 3: Production-ready website with advanced search (β
Complete)
- JTBD-focused search with smart query processing
- Dark mode with system preference detection
- Full accessibility (WCAG 2.1 AA)
- Mobile-responsive design
- Category filtering and URL persistence
- Phase 4: 30+ JTBD examples across all 7 categories (23% complete - 7/30)
- Phase 5: Community contributions and integrations
- Phase 6: Video tutorials for complex patterns
We welcome contributions! See CONTRIBUTING.md for guidelines.
Quick contribution ideas:
- π Report issues with examples
- π Improve documentation
- π― Suggest new JTBD scenarios
- π§ Submit your own examples
MIT License - see LICENSE file. Use these examples freely in your projects!
- Built on top of Google's ADK
- Inspired by Go by Example
- Powered by Gemini
Made with β€οΈ for the ADK community
β Star this repo if you find it helpful!
π Browse examples online