Agent Frameworks & ADK
This domain accounts for 25% of the exam and tests your ability to design, build, and evaluate multi-agent systems using Google ADK, LangGraph, CrewAI, and related orchestration patterns. Questions assess both conceptual understanding (when to use which framework or agent type) and practical knowledge (exact APIs, persistence mechanisms, communication patterns, and evaluation metrics). Expect scenario-based questions requiring you to select the correct agent type, tool, or memory strategy for a given requirement.
Google Agent Development Kit (ADK): Agents, Tools, Sessions, Runners
Google ADK is an open-source Python framework for building, orchestrating, and deploying LLM-powered agents. Its four core abstractions are agents, tools, sessions, and runners.
Core Abstractions
| Abstraction | Role | Key Class |
|---|---|---|
| Agent | Defines behavior, model, tools, instructions | LlmAgent, SequentialAgent, etc. |
| Tool | Callable action the agent can invoke | FunctionTool, AgentTool, built-ins |
| Session | Stateful container for a conversation turn sequence | Session (managed by SessionService) |
| Runner | Executes an agent against a session, handles the event loop | Runner |
Sessions and SessionService
A Session holds events (the turn history), state (a mutable dict), and metadata (session_id, app_name, user_id). The SessionService is the interface for creating, reading, and updating sessions. ADK provides three implementations:
| Service | Backend | Use Case |
|---|---|---|
InMemorySessionService | RAM | Development, single-process testing |
DatabaseSessionService | SQL (SQLite/Postgres) | Production persistence |
VertexAiSessionService | Vertex AI managed | Managed cloud deployment |
Runner
The Runner ties an agent to a SessionService and an ArtifactService. You invoke runner.run(session_id, message) or the async runner.run_async(...). The Runner orchestrates the agent loop: call LLM → parse tool calls → execute tools → append events → repeat until no tool calls remain.
Common traps:
- Confusing
Session.state(mutable per-session dict) withSession.events(immutable turn log). - Using
InMemorySessionServicein production — it loses all state on restart. - Thinking the
Runneris per-request; it is created once and reused across sessions. - Forgetting that
runner.run()is synchronous and blocks;runner.run_async()is required in async applications.
ADK Agent Types: LlmAgent, SequentialAgent, ParallelAgent, LoopAgent
ADK provides four primary agent types. Choosing the correct type is a frequent exam question.
| Agent Type | Execution Pattern | When to Use |
|---|---|---|
LlmAgent | Single LLM call with optional tool loop | General-purpose reasoning, tool use |
SequentialAgent | Runs sub-agents in order, output of each passed to next | Pipelines with ordered, dependent steps |
ParallelAgent | Runs sub-agents concurrently, collects all results | Independent tasks that can be parallelized |
LoopAgent | Repeats a sub-agent until a termination condition | Iterative refinement, retry loops |
Bold decision rule: Use SequentialAgent when step N requires step N-1's output. Use ParallelAgent when sub-tasks are independent. Use LoopAgent when you need iterative improvement with a stopping criterion.
LoopAgent requires a max_iterations parameter to prevent infinite loops. The loop terminates when either the sub-agent signals completion via a special tool call (exit_loop) or max_iterations is reached.
Common traps:
- Choosing
ParallelAgentwhen tasks have dependencies — it does not sequence execution. - Forgetting
max_iterationsonLoopAgent— without it, you risk infinite loops (though ADK enforces a default limit). - Assuming
SequentialAgenthas an LLM itself — it is a pure orchestrator with no model. - Confusing
SequentialAgentoutput passing (state-based) with direct argument injection.
Worked scenario: A pipeline must (1) extract entities from a document, then (2) look up each entity in a database, then (3) generate a summary. The sub-tasks are ordered and dependent.
→ Correct choice: SequentialAgent with three LlmAgent sub-agents. ParallelAgent is wrong because step 2 depends on step 1's output.
Agent type selection decision tree:
Choose the right ADK agent type based on execution requirements.
Sign in free to read the full guide
11 more sections (about 2,836 words) continue below. The first domain's study guide is free for every AI Advanced learner with a free account.