|
| 1 | +# Google ADK Documentation |
| 2 | + |
| 3 | +Welcome to the comprehensive documentation for the Google Agent Development Kit (ADK)! This documentation provides detailed information about all public APIs, functions, and components, along with practical examples and usage instructions. |
| 4 | + |
| 5 | +## Documentation Overview |
| 6 | + |
| 7 | +This documentation is organized into several specialized guides to help you understand and use Google ADK effectively: |
| 8 | + |
| 9 | +### 📚 Core Documentation |
| 10 | + |
| 11 | +#### [**User Guide**](user-guide.md) |
| 12 | +**Start here if you're new to Google ADK!** |
| 13 | + |
| 14 | +A comprehensive getting-started guide that covers: |
| 15 | +- Installation and setup instructions |
| 16 | +- Core concepts and terminology |
| 17 | +- Building your first agent step-by-step |
| 18 | +- Working with tools and multi-agent systems |
| 19 | +- Best practices and troubleshooting |
| 20 | + |
| 21 | +Perfect for developers new to agent development or those transitioning from other frameworks. |
| 22 | + |
| 23 | +#### [**API Reference**](api-reference.md) |
| 24 | +**Complete reference for all public APIs** |
| 25 | + |
| 26 | +Detailed documentation for all classes, functions, and interfaces: |
| 27 | +- Core classes (`Agent`, `Runner`) |
| 28 | +- Tools and toolsets (`BaseTool`, built-in tools) |
| 29 | +- Models and LLM integration (`Gemini`, `BaseLlm`) |
| 30 | +- Sessions and state management |
| 31 | +- Type aliases and callback functions |
| 32 | + |
| 33 | +Essential for developers who need detailed API information while building applications. |
| 34 | + |
| 35 | +#### [**Tools Guide**](tools-guide.md) |
| 36 | +**Comprehensive guide to ADK's tool ecosystem** |
| 37 | + |
| 38 | +Everything you need to know about tools: |
| 39 | +- Built-in tools (Google Search, Enterprise Search, etc.) |
| 40 | +- Creating custom tools and toolsets |
| 41 | +- Tool configuration and best practices |
| 42 | +- Integration patterns with APIs and databases |
| 43 | +- Advanced tool development techniques |
| 44 | + |
| 45 | +Perfect for developers building custom tools or integrating external services. |
| 46 | + |
| 47 | +#### [**Examples**](examples.md) |
| 48 | +**Practical examples and usage patterns** |
| 49 | + |
| 50 | +Real-world examples covering: |
| 51 | +- Basic agent examples with progressive complexity |
| 52 | +- Multi-agent systems and coordination patterns |
| 53 | +- Tool integration (REST APIs, databases) |
| 54 | +- Advanced patterns (streaming, state management) |
| 55 | +- Production deployment examples |
| 56 | +- Complete application examples |
| 57 | + |
| 58 | +Ideal for learning through practical examples and understanding implementation patterns. |
| 59 | + |
| 60 | +#### [**Utilities Guide**](utilities-guide.md) |
| 61 | +**Helper functions and utility classes** |
| 62 | + |
| 63 | +Documentation for ADK's utility modules: |
| 64 | +- Model name utilities (parsing, validation) |
| 65 | +- Feature decorators (experimental, WIP features) |
| 66 | +- Instruction utilities (template processing) |
| 67 | +- Variant utilities (Google LLM variants) |
| 68 | +- Usage examples and composition patterns |
| 69 | + |
| 70 | +Useful for advanced developers who want to leverage ADK's utility functions. |
| 71 | + |
| 72 | +--- |
| 73 | + |
| 74 | +## Quick Start |
| 75 | + |
| 76 | +### Installation |
| 77 | + |
| 78 | +```bash |
| 79 | +# Install Google ADK |
| 80 | +pip install google-adk |
| 81 | + |
| 82 | +# For development version with latest features |
| 83 | +pip install git+https://github.com/google/adk-python.git@main |
| 84 | +``` |
| 85 | + |
| 86 | +### Hello World Example |
| 87 | + |
| 88 | +```python |
| 89 | +from google.adk import Agent, Runner |
| 90 | +from google.adk.sessions import InMemorySessionService |
| 91 | + |
| 92 | +# Create a simple agent |
| 93 | +agent = Agent( |
| 94 | + name="hello_agent", |
| 95 | + model="gemini-2.0-flash", |
| 96 | + instruction="You are a helpful assistant. Be friendly and concise." |
| 97 | +) |
| 98 | + |
| 99 | +# Set up and run |
| 100 | +session_service = InMemorySessionService() |
| 101 | +runner = Runner( |
| 102 | + app_name="hello_world", |
| 103 | + agent=agent, |
| 104 | + session_service=session_service |
| 105 | +) |
| 106 | + |
| 107 | +# Interact with the agent |
| 108 | +for event in runner.run( |
| 109 | + user_id="user123", |
| 110 | + session_id="session456", |
| 111 | + new_message="Hello! What can you help me with?" |
| 112 | +): |
| 113 | + if event.type == "model_response": |
| 114 | + print(f"Agent: {event.data.get('text', '')}") |
| 115 | +``` |
| 116 | + |
| 117 | +For more detailed examples, see the [User Guide](user-guide.md) and [Examples](examples.md). |
| 118 | + |
| 119 | +--- |
| 120 | + |
| 121 | +## Architecture Overview |
| 122 | + |
| 123 | +Google ADK is built around four core concepts: |
| 124 | + |
| 125 | +### 🤖 Agents |
| 126 | +The primary building blocks that encapsulate: |
| 127 | +- **Model**: The LLM (e.g., Gemini) that powers the agent |
| 128 | +- **Instructions**: Behavioral guidelines and personality |
| 129 | +- **Tools**: Capabilities and external integrations |
| 130 | +- **Context**: Conversation state and memory |
| 131 | + |
| 132 | +### 🛠️ Tools |
| 133 | +Extensible capabilities that provide: |
| 134 | +- External API access |
| 135 | +- Database operations |
| 136 | +- Custom business logic |
| 137 | +- Inter-agent communication |
| 138 | + |
| 139 | +### 💾 Sessions |
| 140 | +State management for: |
| 141 | +- Conversation history |
| 142 | +- User and session identification |
| 143 | +- Context preservation |
| 144 | +- State persistence |
| 145 | + |
| 146 | +### 🏃 Runners |
| 147 | +Execution orchestration including: |
| 148 | +- Message processing |
| 149 | +- Event generation |
| 150 | +- Service coordination |
| 151 | +- Error handling and recovery |
| 152 | + |
| 153 | +--- |
| 154 | + |
| 155 | +## Key Features |
| 156 | + |
| 157 | +### 🔧 **Code-First Development** |
| 158 | +Define agents, tools, and workflows directly in Python with full type safety and IDE support. |
| 159 | + |
| 160 | +```python |
| 161 | +from google.adk import Agent |
| 162 | +from google.adk.tools import google_search, FunctionTool |
| 163 | + |
| 164 | +def calculate_tip(bill: float, percentage: float = 15.0) -> dict: |
| 165 | + """Calculate tip amount.""" |
| 166 | + tip = bill * (percentage / 100) |
| 167 | + return {"tip": tip, "total": bill + tip} |
| 168 | + |
| 169 | +agent = Agent( |
| 170 | + name="helpful_assistant", |
| 171 | + model="gemini-2.0-flash", |
| 172 | + instruction="You are a helpful assistant with search and calculation capabilities.", |
| 173 | + tools=[google_search, FunctionTool(func=calculate_tip)] |
| 174 | +) |
| 175 | +``` |
| 176 | + |
| 177 | +### 🌐 **Rich Tool Ecosystem** |
| 178 | +Extensive collection of pre-built tools plus easy custom tool creation: |
| 179 | + |
| 180 | +```python |
| 181 | +from google.adk.tools import ( |
| 182 | + google_search, # Web search |
| 183 | + enterprise_web_search, # Enterprise search |
| 184 | + url_context, # Web page analysis |
| 185 | + load_memory, # Memory management |
| 186 | + AgentTool, # Inter-agent communication |
| 187 | + VertexAiSearchTool # Custom search |
| 188 | +) |
| 189 | +``` |
| 190 | + |
| 191 | +### 🤝 **Multi-Agent Systems** |
| 192 | +Build complex workflows with specialized agents: |
| 193 | + |
| 194 | +```python |
| 195 | +# Specialized agents |
| 196 | +researcher = Agent(name="researcher", tools=[google_search], ...) |
| 197 | +writer = Agent(name="writer", ...) |
| 198 | +editor = Agent(name="editor", ...) |
| 199 | + |
| 200 | +# Coordinator agent |
| 201 | +coordinator = Agent( |
| 202 | + name="content_team", |
| 203 | + tools=[AgentTool(agent=researcher), AgentTool(agent=writer), AgentTool(agent=editor)] |
| 204 | +) |
| 205 | +``` |
| 206 | + |
| 207 | +### 🚀 **Production Ready** |
| 208 | +Deploy anywhere with built-in support for: |
| 209 | +- FastAPI web services |
| 210 | +- Docker containerization |
| 211 | +- Cloud Run deployment |
| 212 | +- Vertex AI integration |
| 213 | +- Horizontal scaling |
| 214 | + |
| 215 | +### 🔄 **Model Agnostic** |
| 216 | +While optimized for Gemini, ADK supports various LLMs: |
| 217 | + |
| 218 | +```python |
| 219 | +# Gemini models (recommended) |
| 220 | +agent1 = Agent(model="gemini-2.0-flash", ...) |
| 221 | +agent2 = Agent(model="gemini-1.5-pro", ...) |
| 222 | + |
| 223 | +# Custom model integration |
| 224 | +from google.adk.models import BaseLlm |
| 225 | +custom_model = CustomLLM() |
| 226 | +agent3 = Agent(model=custom_model, ...) |
| 227 | +``` |
| 228 | + |
| 229 | +--- |
| 230 | + |
| 231 | +## Common Use Cases |
| 232 | + |
| 233 | +### 💬 **Conversational AI** |
| 234 | +Build sophisticated chatbots and virtual assistants with memory, tools, and personality. |
| 235 | + |
| 236 | +### 🔍 **Research and Analysis** |
| 237 | +Create agents that can search, analyze, and synthesize information from multiple sources. |
| 238 | + |
| 239 | +### 🏢 **Enterprise Automation** |
| 240 | +Automate business processes with agents that integrate with internal systems and APIs. |
| 241 | + |
| 242 | +### 📝 **Content Creation** |
| 243 | +Build multi-agent workflows for research, writing, editing, and publishing content. |
| 244 | + |
| 245 | +### 🎯 **Specialized Assistants** |
| 246 | +Create domain-specific assistants for coding, data analysis, customer support, etc. |
| 247 | + |
| 248 | +### 🌐 **API Integration** |
| 249 | +Connect AI agents to external services, databases, and enterprise systems. |
| 250 | + |
| 251 | +--- |
| 252 | + |
| 253 | +## Getting Help |
| 254 | + |
| 255 | +### 📖 **Documentation Navigation** |
| 256 | + |
| 257 | +1. **New to ADK?** → Start with the [User Guide](user-guide.md) |
| 258 | +2. **Building tools?** → Check the [Tools Guide](tools-guide.md) |
| 259 | +3. **Need API details?** → See the [API Reference](api-reference.md) |
| 260 | +4. **Want examples?** → Browse the [Examples](examples.md) |
| 261 | +5. **Using utilities?** → Read the [Utilities Guide](utilities-guide.md) |
| 262 | + |
| 263 | +### 🔗 **External Resources** |
| 264 | + |
| 265 | +- **[Official Documentation](https://google.github.io/adk-docs)** - Complete documentation website |
| 266 | +- **[Sample Projects](https://github.com/google/adk-samples)** - Example applications and templates |
| 267 | +- **[ADK Web Interface](https://github.com/google/adk-web)** - Browser-based development UI |
| 268 | +- **[Community Forum](https://www.reddit.com/r/agentdevelopmentkit/)** - Community discussions and support |
| 269 | + |
| 270 | +### 🐛 **Troubleshooting** |
| 271 | + |
| 272 | +Common issues and solutions are covered in the [User Guide's Troubleshooting section](user-guide.md#troubleshooting). |
| 273 | + |
| 274 | +For bugs and feature requests: |
| 275 | +- **Python ADK**: [GitHub Issues](https://github.com/google/adk-python/issues) |
| 276 | +- **Documentation**: [Documentation Issues](https://github.com/google/adk-docs/issues) |
| 277 | + |
| 278 | +--- |
| 279 | + |
| 280 | +## Version Information |
| 281 | + |
| 282 | +This documentation covers **Google ADK Python** and is compatible with: |
| 283 | +- **Python**: 3.9, 3.10, 3.11, 3.12, 3.13 |
| 284 | +- **Google Cloud**: All regions supporting Gemini |
| 285 | +- **Vertex AI**: Agent Engine integration |
| 286 | +- **Deployment**: Cloud Run, containers, local development |
| 287 | + |
| 288 | +--- |
| 289 | + |
| 290 | +## Contributing |
| 291 | + |
| 292 | +We welcome contributions to both ADK and its documentation! See: |
| 293 | +- [Contributing Guidelines](https://google.github.io/adk-docs/contributing-guide/) |
| 294 | +- [Code Contributing Guidelines](https://github.com/google/adk-python/blob/main/CONTRIBUTING.md) |
| 295 | + |
| 296 | +--- |
| 297 | + |
| 298 | +## License |
| 299 | + |
| 300 | +Google ADK is licensed under the Apache 2.0 License. See the [LICENSE](https://github.com/google/adk-python/blob/main/LICENSE) file for details. |
| 301 | + |
| 302 | +--- |
| 303 | + |
| 304 | +**Happy Agent Building!** 🚀 |
| 305 | + |
| 306 | +*This documentation was generated to provide comprehensive coverage of Google ADK's public APIs, functions, and components. For the most up-to-date information, visit the [official documentation](https://google.github.io/adk-docs).* |
0 commit comments