Installation Guide
This comprehensive guide covers everything you need to install, configure, and deploy the ADK Utils Example project. Whether you’re setting up for local development, production deployment, or contributing to the project, this guide has you covered.Prerequisites
Before installing ADK Utils Example, ensure your system meets these requirements:Required Software
Node.js 18 or Higher
Node.js 18 or Higher
ADK Utils Example requires Node.js 18+ for modern JavaScript features and Next.js 16 compatibility.Check your version:Install or update:
- Download from nodejs.org
- Or use a version manager:
Package Manager (npm, yarn, or pnpm)
Package Manager (npm, yarn, or pnpm)
Choose your preferred package manager:npm - Included with Node.jsyarn - Fast, reliable package managerpnpm - Efficient disk space usage
This guide uses npm in examples, but all commands work with yarn/pnpm equivalents.
Git Version Control
Git Version Control
Optional but Recommended
Ollama
For running AI models locally without cloud dependencies
Visual Studio Code
Recommended IDE with excellent TypeScript support
Gemini API Key
For using Google’s Gemini models instead of Ollama
Docker
For containerized deployment (optional)
Installation Steps
Clone the Repository
Clone the ADK Utils Example repository from GitHub:Alternative: Use GitHub CLIAlternative: Download ZIP
- Visit github.com/YagoLopez/adk-utils-example
- Click “Code” → “Download ZIP”
- Extract and navigate to the directory
Install Dependencies
Install all required packages:This installs:
- Framework: Next.js 16.1.6, React 19.2.4
- AI Core: @google/adk, @yagolopez/adk-utils, ai SDK
- UI Libraries: Tailwind CSS 4, Radix UI, Lucide React
- Dev Tools: TypeScript 5, ESLint, Prettier, Jest
Environment Configuration
While the project works out-of-the-box with Ollama’s cloud endpoint, you may want to configure environment variables for different models or settings.Using Ollama (Default)
The default configuration inapp/agents/agent1.ts:67 uses Ollama’s cloud endpoint:
app/agents/agent1.ts
Using Local Ollama
For local AI inference with privacy and zero latency:Install Ollama
Download and install from ollama.com:
Pull a Model
Download a model for local inference:
Model sizes vary from 400MB (qwen3:0.6b) to 7GB+ (llama2). Choose based on your hardware.
Using Google Gemini
To use Google’s Gemini models instead of Ollama:Get API Key
- Visit Google AI Studio
- Sign in with your Google account
- Create a new API key
- Copy the key (starts with
AIza...)
Create Environment File
Create a Add your Gemini API key:
.env.local file in the project root:.env.local
Configuration Options
Agent Configuration
Customize your agent inapp/agents/agent1.ts:
app/agents/agent1.ts
name- Agent identifiermodel- AI model (Gemini string or OllamaModel instance)description- Agent purpose and capabilitiesinstruction- System prompt and behavior guidelinestools- Array of FunctionTool instances
Rate Limiting
Adjust rate limits inlib/constants.ts:26:
lib/constants.ts
- Development: Set
LIMITto 100 or higher - Production: Keep at 20-50 based on your API quotas
- No limit: Remove rate limiting from
app/page.tsx:29
Custom Tools
Add your own function tools inapp/agents/agent1.ts:
Development Workflow
Available Scripts
The project includes several npm scripts defined inpackage.json:26:
Development Tips
Hot Module Replacement
Hot Module Replacement
Next.js automatically reloads your application when you save changes. No need to restart the server for:
- Component changes
- Style updates
- API route modifications
- Changes to
next.config.ts - Environment variable updates
- Package installations
TypeScript Type Checking
TypeScript Type Checking
Run TypeScript compiler in watch mode:This catches type errors without building.
Debugging
Debugging
Add breakpoints in VS Code:Then open
- Add a
.vscode/launch.jsonfile - Set breakpoints in your code
- Press F5 to start debugging
chrome://inspectEnvironment Variables
Environment Variables
Next.js supports multiple env files:
.env.local- Local development (not committed).env.development- Development defaults.env.production- Production settings
.env.local > .env.development > .envTroubleshooting
Port Already in Use
Port Already in Use
Error:
Port 3000 is already in useSolutions:Module Resolution Errors
Module Resolution Errors
Error:
Cannot find module '@/components/...'Solutions:- Check
tsconfig.jsonhas correct path mapping - Restart TypeScript server in VS Code (Cmd+Shift+P → “Restart TS Server”)
- Clear Next.js cache:
Ollama Connection Failed
Ollama Connection Failed
Error: Solutions:
Failed to connect to Ollama at http://localhost:11434Diagnosis:- Start Ollama:
ollama serve - Pull the model:
ollama pull qwen3:0.6b - Check firewall isn’t blocking port 11434
- Try cloud endpoint instead:
Gemini API Errors
Gemini API Errors
Error:
API key not validSolutions:- Verify
.env.localexists and has correct key - Restart dev server after adding env vars
- Check key at AI Studio
- Ensure billing is enabled for your Google Cloud project
Quota exceeded- You’ve hit the free tier limit
- Upgrade to paid plan or switch to Ollama
Build Errors
Build Errors
Error: Type errors during buildSolutions:
Rate Limit Issues
Rate Limit Issues
Error:
Rate limit exceeded alertSolutions:- Wait for the rate limit window to reset (1 hour by default)
- Increase limit in
lib/constants.ts:26 - Clear browser local storage to reset client-side counter
- For development, disable rate limiting in
app/page.tsx:29
Dependencies Out of Date
Dependencies Out of Date
Check for updates:Update safely:
Production Deployment
Build and Deploy
Create Production Build
.next directory with:- Minified JavaScript and CSS
- Optimized images
- Static and server-side pages
Test Production Build Locally
Alternative Deployment Options
Netlify
Supports Next.js with automatic deployments
Railway
Simple deployment with built-in databases
AWS Amplify
Full AWS integration and scaling
Testing
Run tests for your application
Next Steps
Architecture Overview
Understand how components interact
Agent Tools
Learn about built-in agent tools
API Reference
Explore available APIs and utilities
Configuration
Configure your application
Getting Help
If you encounter issues not covered in this guide:- Check GitHub Issues: github.com/YagoLopez/adk-utils-example/issues
- Create a New Issue: Include error messages, configuration, and steps to reproduce
- Join Discussions: Share your use case and get community help
- Review Documentation: