Explain all the agent types in Google ADK (LlmAgent, SequentialAgent, ParallelAgent, LoopAgent, CustomAgent) with flow diagrams.
Answer
Agent Types in Google ADK

Google ADK provides 5 agent types organized into 3 categories: LLM Agents, Workflow Agents, and Custom Agents.
Agent Type Hierarchy
1. LLM Agent (textLlmAgent
/ textAgent
)
LlmAgentAgentThe primary agent type - powered by an LLM for reasoning, tool use, and delegation.
pythonfrom google.adk.agents import Agent research_agent = Agent( name="research_agent", model="gemini-2.5-flash", instruction="You are a research assistant. Use tools to find information.", description="Researches topics and provides detailed answers", tools=[google_search, summarize_doc], output_key="research_result", sub_agents=[writer_agent], )
| Parameter | Type | Description |
|---|---|---|
text | text | Unique agent identifier |
text | text | LLM to use |
text | text | System prompt (supports text |
text | text | Used by parent agents for delegation |
text | text | Tools available to this agent |
text | text | Save output to session state |
text | text | Child agents for delegation |
text | text | Planning strategy |
2. Sequential Agent

Executes sub-agents one after another in order. No LLM for flow control.
pythonfrom google.adk.agents import SequentialAgent rag_pipeline = SequentialAgent( name="rag_pipeline", sub_agents=[ loader_agent, # Step 1: Load documents chunker_agent, # Step 2: Chunk text embedder_agent, # Step 3: Embed indexer_agent, # Step 4: Store in vector DB ] )
Use case: ETL pipelines, RAG ingestion, step-by-step workflows.
3. Parallel Agent

Executes sub-agents concurrently. Each child gets a distinct branch context.
pythonfrom google.adk.agents import ParallelAgent multi_search = ParallelAgent( name="multi_source_search", sub_agents=[ web_search_agent, arxiv_search_agent, internal_docs_agent, ] )
Important: Use distinct state keys per agent to avoid race conditions.
Use case: Multi-source search, parallel API calls, fan-out.
4. Loop Agent

Executes sub-agents sequentially in a loop until
max_iterationsescalate=Truepythonfrom google.adk.agents import LoopAgent refiner = LoopAgent( name="draft_refiner", max_iterations=5, sub_agents=[ writer_agent, # Write a draft reviewer_agent, # Review and provide feedback ] )
Use case: Iterative refinement, polling, self-correcting agents.
5. Custom Agent

Extend
BaseAgentpythonfrom google.adk.agents import BaseAgent from google.adk.agents.invocation_context import InvocationContext class ConditionalAgent(BaseAgent): def __init__(self, name, tech_agent, general_agent, **kwargs): super().__init__( name=name, sub_agents=[tech_agent, general_agent], **kwargs ) self.tech_agent = tech_agent self.general_agent = general_agent async def _run_async_impl(self, ctx: InvocationContext): query = ctx.session.state.get("user_query", "") if any(kw in query.lower() for kw in ["code", "api", "bug"]): target = self.tech_agent else: target = self.general_agent async for event in target.run_async(ctx): yield event
Choosing the Right Agent Type
Summary
| Agent Type | Flow Control | LLM Used? | Best For |
|---|---|---|---|
| LlmAgent | Dynamic, LLM-driven | Yes | Reasoning, tool use, delegation |
| SequentialAgent | Fixed order | No | Pipelines, ETL |
| ParallelAgent | Concurrent | No | Fan-out, multi-search |
| LoopAgent | Repeat | No | Iterative refinement |
| Custom Agent | Your logic | Optional | Conditional routing, complex flows |
Learn more at Agent Types and Workflow Agents.