All skills
google avatar

/adk-architecture

@f7a1cd4
by googlegoogle/adk-python22k stars
4,084

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

This session only. Nothing lands on disk.

referencesinterface-base-agent.md

≈522 tokens on demand. Your agent reads this file only when SKILL.md points to it.

BaseAgent

BaseAgent is the abstract base for every agent. It extends BaseNode, so an agent is a node with agent-specific lifecycle on top: callbacks, error handling, invocation instrumentation, and an agent tree.

What to override

Override _run_async_impl(ctx) for text conversation, and _run_live_impl(ctx) for live audio/video. Both receive an InvocationContext. Every built-in composite agent — LlmAgent, SequentialAgent, LoopAgent, ParallelAgent — implements these two and nothing else.

Do not override _run_impl. BaseAgent already overrides it (marked @override) as the bridge from node execution into run_async, which is what applies the before/after callbacks, the error callback and the invocation metrics. Replacing it silently drops all of that.

Workflow calls node.run()          (BaseNode, @final)
  └─ BaseAgent._run_impl           (bridge — do not override)
      └─ BaseAgent.run_async       (callbacks, instrumentation, error handling)
          └─ your _run_async_impl  ← override point

LlmAgent is the exception that proves the rule: it overrides _run_impl too, in order to run through a dedicated node wrapper. That is framework-internal.

Key attributes to configure

  • name — must be a valid Python identifier, unique within the agent tree, and cannot be "user".
  • description — capability description used by the model for delegation.
  • sub_agents — child agents for hierarchical delegation. Duplicate names across the tree are rejected at validation time.
  • before_agent_callback / after_agent_callback — lifecycle hooks. Both accept a list; the canonical forms are exposed as canonical_before_agent_callbacks / canonical_after_agent_callbacks.

Author attribution

When an agent runs as a workflow node, _run_impl copies each event's author onto ctx.event_author so the enclosing NodeRunner does not overwrite it with the parent workflow's name. Events therefore stay attributed to the agent that actually produced them.

Source: SKILL.md on GitHub

No alerts7d3 checks · Risk SAFE
  • Gen Agent Trust Hub7d

    This skill consists of comprehensive architectural documentation for the Agent Development Kit (ADK). It provides technical guidance on the framework's node execution model, context scoping, and observability patterns. No security considerations were identified as the content is purely informational and follows standard developer documentation practices.

  • Socket7d

    No alerts

  • Snyk7d

    Risk: LOW · No issues

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

Last checked against GitHub yesterday.

Activeupdated last week

README badge

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