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.

referencesarchitecture-llm-context-orchestration.md

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

LLM context orchestration from events

Source versus view

The event stream and the LLM context are not the same thing:

  • Events are the ground truth. Immutable records of what happened — user messages, model responses, tool calls, results. They are the audit log and the persistence state.
  • LLM context is an orchestrated view. What gets sent to a model is not a dump of the event log. It is filtered and transformed for the role, task and branch of the agent currently running.

Treating the two as interchangeable is the root of most "why did the model see that?" bugs.

Delegation

A coordinator hands work to a sub-agent with the transfer_to_agent tool, which sets actions.transfer_to_agent on the event rather than calling the sub-agent inline. The alternative is AgentTool, which wraps an agent so it is invoked as an ordinary tool and returns its result to the caller.

Either way the sub-agent does not inherit the coordinator's full transcript verbatim; it is given the task framing plus whatever history its branch exposes.

Branch isolation

Events from every node and branch share one session, in chronological order. Isolation comes from the branch field, a dot-separated path built by _BranchPath: create_sub_branch('parent', name='child', run_id='1') yields 'parent.child@1'. A node running on a sub-branch sees only events on its own path, which is what keeps parallel siblings from polluting each other.

Event.isolation_scope is a separate, coarser tag — NodeRunner stamps it from ctx.isolation_scope when the event does not carry one already.

History trimming and compaction

Long histories overflow the context window and drag stale retry loops back into the prompt. When the app sets events_compaction_config, the Runner compacts events after the invocation. Because compaction rewrites aged history, do not store transient status on an event and expect to read it back later.

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