Google ADK Package Anatomy: Modules, Imports, and What Lives Where
A guided tour of the google-adk package layout — runners, agents, sessions, tools, events, flows, and apps — so you always know which module owns what.
Published on • November 25, 2026
AI Assistant

Open any ADK example and the imports look deceptively small: Agent, Runner, maybe a tool function. Then you need a database session service, or an artifact store, or a workflow primitive, and the import path suddenly matters — google.adk.runners versus google.adk.agents, google.adk.flows versus google.adk.apps. Knowing the package anatomy saves you from the two classic failure modes: importing a private module that moves in the next release, and reaching for the wrong abstraction because you didn’t know it existed.
Here’s the map of the google-adk distribution, organized by responsibility.
The runtime core: runners
google.adk.runners owns execution. The central types:
Runner— the full engine: wires agent, session service, artifact service, memory service, and model wiring together.InMemoryRunner— a convenience subclass preconfigured with in-memory services. Perfect for tests and prototypes; its sessions die with the process, which is exactly the point.RunConfig— per-run knobs:max_llm_calls, streaming mode, session retrieval, context-window compression.
from google.adk.runners import InMemoryRunner, RunConfig
If a class coordinates when things happen during a run, it lives here. Note that Runner is where service injection happens — the seam covered in dependency injection in ADK.
The agent zoo: agents
google.adk.agents is a package of its own containing every agent type:
LlmAgent/Agent— the workhorse: model + instruction + tools + sub-agents.- Workflow agents —
SequentialAgent,ParallelAgent,LoopAgent(in Python these are deprecated in favor of graph workflows — see design patterns). - Specialists — transfer agents, custom-agent base classes, planner-bearing agents.
BaseAgent— the abstract base every agent implements; subclass it for non-LLM orchestration logic.
Sub-packages under agents organize the rest:
| Sub-package | Contains |
|---|---|
agents.llm_agent | LlmAgent implementation |
agents.flows | run-flow orchestration (single-agent vs. multi-agent flows) |
agents.models | model connectors: Gemini, LiteLlm, Ollama, Vllm, routing |
agents.readonly_context | the read-only context projection |
from google.adk.agents import Agent, LlmAgent, BaseAgent
from google.adk.agents.sequential_agent import SequentialAgent # explicit path
Rule of thumb: from google.adk.agents import X for the common types; explicit sub-module paths when you need something specific, so the dependency is visible at a glance.
Conversation storage: sessions
google.adk.sessions owns the three-state of a conversation:
SessionService(abstract) — the contract: create/get/list sessions, append events.InMemorySessionService— dict-backed; default inInMemoryRunner.DatabaseSessionService— persistent storage for real deployments.StateSessionServiceand related variants for state-centric storage.
from google.adk.sessions import InMemorySessionService, DatabaseSessionService
The session triple (app_name, user_id, session_id) is this package’s addressing scheme — the foundation of multi-tenant scoping.
Communication records: events
google.adk.events defines what moves through the system:
Event— content parts plusEventActions(state deltas, artifact references, control signals like transfer/escalation), metadata, andis_final_response().LlmResponse— the raw model output layer beneath events.
from google.adk.events import Event, EventActions
If you’re building analytics, auditing, or replay over a session, this is the module you’ll parse.
Capabilities: tools
google.adk.tools is where agent abilities live:
FunctionTool— wrap any Python function.ToolContext— the per-call context (state, credentials, confirmations).- Built-ins:
load_artifacts,search_memory,list_documents, transfer tools, retrieval tools. AgentTool— expose an entire agent as a tool of another agent.
from google.adk.tools import FunctionTool, ToolContext
Plugins (google.adk.plugins) hook lifecycle events for cross-cutting behavior — approvals, safety checks, telemetry — without embedding them in tools.
Orchestration: flows and graph workflows
google.adk.flows— the run-flow layer deciding how a single turn is processed (AutoFlowfor automatic tool/sub-agent dispatch, single-agent flows for the simple case).- Graph workflows (ADK 2.0) — declarative node/edge graphs, first-class in TypeScript 2.0 and evolving in Python, replacing the deprecated workflow agents for new code.
Application scope: apps and plugins
google.adk.apps provides the App class — application-level configuration, app:* state scope, plugins, caching and compaction configuration, lifecycle hooks. It’s the composition root described in the DI post: build once, inject everywhere.
Supporting cast
| Module | Responsibility |
|---|---|
google.adk.artifacts | ArtifactService — versioned blobs referenced by events |
google.adk.memory | MemoryService — cross-session recall |
google.adk.auth | credential storage, request_credential flows |
google.adk.cli | adk command-line tooling (web UI, API server, eval) |
google.adk.version | version introspection — useful in health endpoints |
Import hygiene rules
- Public paths only. Import from documented modules;
google.adk.*._privateinternals move between releases. - Prefer the factory conveniences.
InMemoryRunnerover hand-assembling four services, until you actually need to swap one. - Declare what you use. Explicit sub-module imports (
agents.models.gemini) document intent better than re-exports that may be reorganized. - Version-pin the package. ADK moves fast; pin
google-adkand check its changelog before upgrading — deprecations (like the workflow agents) appear early with long windows. - One composition module. Assemble runner, services, and app in a single module; import
root_agenteverywhere else. It keeps the dependency graph honest.
Where to go next
With the map in hand, the natural follow-ups are design patterns for composing agents (which module hosts which primitive) and production Python tooling with uv, ruff, and mypy for keeping a codebase this size clean. For the class that stitches several of these modules together at the top, read dependency injection in ADK.