Index of every page on this site: llms.txt
All skills
google avatar

/adk-architecture

@37de74d
by googlegoogle/adk-python22k stars
4,392
Run it yourself

Explains how the ADK runtime fits together: the node and graph execution model, Context and Event flow, checkpoint and resume, tracing, and the rules governing the public API surface. Use when answering "how does X work" about ADK internals, tracing where an event or a piece of state comes from, deciding where a new capability belongs, reviewing a change to BaseNode, Workflow, Runner, Agent, Event or Context, working out why a node re-ran or stayed waiting after a resume, or judging whether a change breaks the public API. Don't use for assembling an agent from existing pieces (use adk-agent-builder), diagnosing one failing run or test (use adk-debug), or formatting and naming conventions (use adk-style).

Use this Skill: https://skilld.dev/gh/google/adk-python/adk-architecture

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈183 tokens for metadata: the name and description. ≈1.1k when used: this file. ≈17k more on demand in 14 files.

Description uses 9.2% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈732 characters, or 9.2%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

ADK Architecture

The runtime is a graph of nodes. BaseNode is the unit of execution. Workflow is a node that schedules other nodes along declared edges. NodeRunner executes exactly one node. Runner owns the invocation and the session. Agents are nodes too — BaseAgent extends BaseNode.

A node communicates with its parent through a per-execution Context, and with the session through Events it yields. Those are two separate channels: ctx carries the result upward, events carry persistence and streaming.

Read the source before relying on any signature here. These notes drift; the code does not. Paths below are relative to src/google/adk/.

Pick a reference

Question Reference
What must a node implement? What may it yield? Which config fields exist? BaseNode
How does the graph schedule nodes, dedup dynamic children, propagate interrupts? Workflow
How does a caller start an invocation? Runner
What is Agent, and which methods do I call on it? Agent
I am subclassing an agent — what do I override? BaseAgent
What is on an Event, and what may I assume about its lifetime? Event
What does a node read and write on ctx? Context
Who creates the child Context, stamps events, retries, catches errors? NodeRunner
Why are Runner, NodeRunner and Workflow three separate things? Runner roles
How does a human-in-the-loop pause and resume work for one node? Checkpoint and resume
How does a whole workflow survive a pause, and what does is_resumable change? Workflow resumability
How are spans created, and what attributes do they carry? Observability
Why does the model not see the raw event log? LLM context orchestration
Is this change a breaking change? Where does a new export belong? API principles

Where the code lives

Concept Module
BaseNode, START workflow/_base_node.py
Workflow, _LoopState workflow/_workflow.py
Graph, edge compilation workflow/_graph.py
NodeRunner workflow/_node_runner.py
DynamicNodeScheduler, DynamicNodeState, DynamicNodeRun workflow/_dynamic_node_scheduler.py
ReplayManager (resume scan) workflow/utils/_replay_manager.py
check_interception (replay fast-forward) workflow/utils/_replay_interceptor.py
NodeInterruptedError, NodeTimeoutError workflow/_errors.py
Context, ctx.run_node() agents/context.py
ReadonlyContext agents/readonly_context.py
InvocationContext agents/invocation_context.py
BaseAgent, LlmAgent (aliased Agent) agents/base_agent.py, agents/llm_agent.py
BaseLlmFlow, SingleFlow, AutoFlow, flows/llm_flows/ subpackages (context/, prompt/, tools/, extensions/, core/) flows/llm_flows/
Event, NodeInfo events/event.py
EventActions events/event_actions.py
Branch paths (parent.child@1) events/_branch_path.py
Node paths (wf@1/child@2) events/_node_path_builder.py
Runner, InMemoryRunner runners.py
LiveRequestQueue, LiveRequest live/live_request_queue.py
Node spans, TelemetryContext telemetry/node_tracing.py
ResumabilityConfig apps/_configs.py

Everything under workflow/ is a leading-underscore module. Treat the module paths, and any name workflow/__init__.py does not re-export, as internal — they can change without a major version bump. The names it does re-export (BaseNode, Workflow, START and the rest of its __all__) are public API, so a change to them can be a breaking change.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts13d3 checks · Risk SAFE
  • Gen Agent Trust Hub13d

    This skill provides technical documentation and architecture references for the ADK (Agent Development Kit). It describes internal components, lifecycle management, and API design principles without containing any executable code or risky patterns.

  • Socket13d

    No alerts

  • Snyk13d

    Risk: LOW · No issues

Signed by skilld at 37de74d. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 4 days ago

README badge

README badge for google/adk-python/adk-architecture