Agents
Build autonomous AI agents for reasoning, tool usage, and multi-agent coordination in ADK-TS
Agents are the foundational building blocks of the ADK-TS framework. They represent autonomous AI programs that can understand instructions, make decisions, use tools, and coordinate with other agents to accomplish complex tasks. Every agent extends from the BaseAgent class and implements specific execution patterns for different use cases.
What You'll Learn in This Section
This section covers everything you need to know about building and working with agents in ADK-TS:
- Core agent types - From simple LLM agents to complex multi-agent systems
- Orchestration patterns - How to coordinate multiple agents using workflows
- Agent architecture - Understanding the base classes and inheritance hierarchy
- Practical implementation - Using
AgentBuilderfor rapid development - Advanced patterns - Custom agents, multi-agent coordination, and specialized behaviors
Agent Types Overview
ADK-TS provides several agent types, each optimized for specific use cases:
🤖 LLM Agents
AI-powered agents that use language models for reasoning, conversation, tool usage, and complex decision-making
⚡ Workflow Agents
Orchestration agents for structured processes: Sequential pipelines, Parallel execution, and Loop patterns
🏗️ Custom Agents
Build highly specialized agents with custom business logic by extending the BaseAgent class
🌐 Multi-Agent Systems
Coordinate teams of specialized agents with delegation, communication, and distributed task management
Essential Tools & Configuration
🔧 Agent Builder
Fluent, chainable API for rapid agent creation with built-in session management and configuration
🧠 Models & Providers
Configure LLM models from Google Gemini, OpenAI, Anthropic, and more with flexible integration options
Understanding Agent Architecture
All agents in ADK-TS follow a common architecture:
- BaseAgent - Abstract foundation providing lifecycle management, callbacks, and hierarchy support
- Agent Hierarchy - Agents can have sub-agents, creating parent-child relationships for delegation
- Event-Driven Execution - Agents communicate through events in the ADK-TS runtime
- Tool Integration - Agents can use tools to extend their capabilities beyond text generation
Key Concepts
- Agent Names must be unique identifiers (no spaces, start with letter/underscore)
- Sub-agents enable delegation and specialization within your agent system
- Callbacks provide hooks into agent execution for monitoring and control
- Sessions maintain conversation state and memory across agent interactions
Choosing the Right Agent Type
Selecting the appropriate agent type depends on your specific use case and requirements. Most developers start with LLM Agents for conversational AI and reasoning tasks, then move to more specialized types as their needs grow.
Decision Framework:
- Need AI reasoning and conversation? → LLM Agent (most common choice)
- Sequential processing → Sequential Agent (one step after another)
- Independent parallel tasks → Parallel Agent (simultaneous execution)
- Iterative improvement → Loop Agent (retry until success/condition)
- Complex coordination → Multi-Agent System (specialized roles)
- Custom business logic → Custom Agent (extend BaseAgent directly)
Common Patterns by Use Case
The following table maps real-world scenarios to the most appropriate agent types. This helps you quickly identify which agent pattern fits your specific requirements:
| Use Case | Recommended Agent Type | Why |
|---|---|---|
| Chatbot/Assistant | LLM Agent | Conversational AI with reasoning |
| Data Pipeline | Sequential Agent | Step-by-step data processing |
| Content Generation | Parallel Agent | Generate multiple pieces simultaneously |
| Quality Assurance | Loop Agent | Iterate until quality standards met |
| Customer Support | Multi-Agent | Route to specialized departments |
| API Integration | Custom Agent | Specific business logic and error handling |
Development Pattern
Once you've chosen your agent type, most development follows this pattern:
- Configure the agent with models, instructions, and tools
- Add sub-agents if you need specialization or delegation
- Test and iterate using the built-in evaluation tools
- Scale up by adding more agents or switching to multi-agent patterns
Next Steps
Ready to start building agents? Here's the recommended learning path:
🚀 Build Your First LLM Agent
Master the fundamentals with hands-on examples using the most popular agent type
⚡ Master the Agent Builder
Learn the fluent API for rapid agent creation, configuration, and deployment
🧠 Set Up Models & Providers
Configure Gemini, OpenAI, Claude, and other LLM providers with environment setup
⚡ Create Workflow Orchestration
Build sequential pipelines, parallel processing, and loop patterns for complex workflows
🌐 Design Multi-Agent Systems
Coordinate specialized agents with delegation, routing, and distributed task management
🎯 Develop Custom Agent Types
Extend BaseAgent to create specialized agents for unique business requirements
How is this guide?