“google-adk”
Token Counting Utilities and Accurate Usage Estimation in Google ADK
Master pre-flight token counting, multimodal token calculation, and exact cost estimation using the google-genai SDK and Google ADK utilities.
Evaluating LLM Recall Degradation at Context Boundaries in Google ADK
In-depth analysis of the 'Lost in the Middle' phenomenon and needle-in-a-haystack recall degradation across large context windows in Gemini 3.8 and Google ADK.
Monitoring Context Window Utilization and Prompt Bloat with ADK Tracing
How to trace token accumulation, detect prompt bloat, and instrument telemetry across long-running Google ADK agent sessions using OpenTelemetry and Cloud Trace.
Cache Invalidation Patterns: When and How to Invalidate Cached Prompts in Google ADK
Master cache invalidation strategies for Gemini 3.8 and Google ADK prompt caches, avoiding stale state and optimizing cache hit rates.
Ephemeral Document Loading: Ingesting 500-Page PDFs Direct into Gemini Context in Google ADK
How to leverage Gemini 3.8 large context windows to load 500-page enterprise PDFs ephemerally into Google ADK without chunking or vector database infrastructure.
Managing Context Budgets Across Parallel Agent Fan-Outs in Google ADK
Architectural patterns for allocating, tracking, and aggregating token budgets across concurrent sub-agents in Google Agent Development Kit fan-out workflows.
Automated Prompt Optimization: Using LLMs to Compress Verbose Prompts in Google ADK
How to use automated prompt compression pipelines to eliminate redundant instructions, minimize token burn, and maintain agent behavioral fidelity in Google ADK.
Compressing Structured Data (JSON/CSV) to Maximize Context Efficiency in Google ADK
Techniques for compressing large tabular datasets, JSON documents, and CSV exports to maximize token efficiency and minimize latency in Google ADK agents.
Preventing Context Contamination Across Specialized Sub-Agents in Google ADK
Learn how to isolate scratchpads, isolate working memory, and prevent state pollution across multi-agent fleets in Google Agent Development Kit.
Dynamic Context Assembly: Injecting RAG Chunks Just-in-Time in Google ADK
Master just-in-time context assembly in Google ADK agents to dynamically query, rank, and inject relevant RAG passages into prompt windows without token bloat.
Google ADK Artifacts: How to Use and Apply Them in AI Agents in Multiple Ways
A practical guide to ADK's ArtifactService — what artifacts are, how to wire them into a Runner, and seven real patterns for applying them in AI agents: pipeline handoffs, attachments, tool outputs, cross-session files, workspaces, versioning, and compliance.
Google ADK: Needle-in-a-Haystack Benchmarks for Agents with 1M+ Token Contexts
Build a depth-swept needle-in-a-haystack suite for ADK agents: corpus generation, eval datasets, pytest harness, and the ADK-specific ways retrieval silently fails.
Google ADK: Selective History Pruning with include_contents='none' vs 'default'
A hands-on tutorial for ADK's include_contents switch: when an agent should see full history, when it should see none, and how to split the two across sub-agents.
Google ADK: Sliding Window Turn Management for Long-Running Autonomous Agents
Configure ADK's EventsCompactionConfig sliding-window and token-based compaction so an agent that runs for hundreds of turns keeps latency and cost flat.
Google ADK: Calculating Cost Savings from Cached Tokens on Gemini 3.8
Worked arithmetic for Gemini 3.8 Flash cache hits: 90% input discount, 4,096-token floor, storage fees, and a hit-rate-to-savings table you can apply to your own agent.
Google ADK: Structuring Large Contexts — Optimal Placement of Instructions, Tools, and Data
Where each piece of a large ADK prompt belongs, based on Gemini's fixed serialization order — and what each placement choice costs in cache hits and quality.
Google ADK: ContextCacheConfig in ADK — Reusing Prompts Across Repeated Runs
Turn on ADK's ContextCacheConfig so repeated agent runs reuse cached prompt prefixes. Step-by-step setup, parameter tuning, and how to verify cache hits.
Google ADK: Building an Omnichannel Memory System Across Web, Mobile, and Voice Agents
Design one memory layer serving web chat, mobile push, and live voice agents in ADK — sessions, state prefixes, MemoryService ingestion, and channel-specific trade-offs.
Google ADK: Bridging Redis as a Distributed Caching Layer for ADK Sessions
Put Redis in front of ADK SessionService to cut session-read latency across replicas. A tutorial with a read-through cache wrapper, TTL tuning, and invalidation on append_event.
Google ADK: State Migration Strategies When Upgrading Agent Data Schemas
Version, dual-read, and backfill ADK session state safely. Covers migrate-on-read callbacks, EventActions deltas, and the adk migrate session CLI for v0→v1 databases.
Google ADK: Context Engineering in 2026 — Balancing Large Windows, Cost, and Recall
How to trade off million-token windows against input cost and retrieval accuracy in 2026: prefix caching, ADK compaction, and what to keep out of the window entirely.
Handling Concurrent Session Access: Optimistic Locking and Race Prevention
ADK's DatabaseSessionService uses a real two-tiered locking design — in-process locks plus SELECT ... FOR UPDATE. Here is what that guarantees, and how to build optimistic-locking patterns on top of append_event semantics.
Memory Eviction and Consolidation Strategies: Keeping Memories High-Signal
Consolidation is a real Memory Bank feature (enable_consolidation flips memories.create to memories.generate); eviction is a design pattern you build around ADK's MemoryService. This article shows both honestly.
Memory Bank Integration: Preloading User Profiles with PreloadMemoryTool
Wire VertexAiMemoryBankService into an ADK agent and use the preload_memory tool to inject the user's stored profile at the start of every turn — plus the auto-save callback that keeps memories growing.
Serializing Complex Custom Objects into Session State
State values must be serializable — so how do you track a dataclass, a datetime, or a database record? Convert to plain data, keep identifiers, and hand binary payloads to artifacts.
State Keys and Scope: Isolating Private Sub-Agent Data from Global Session State
State prefixes define scope — and the sub-agent chain shares one InvocationContext, so temp: is not private either. A tutorial on keeping sub-agent scratch isolated from user-, app-, and session-global state.
Cross-Session Long-Term Memory: Storing Facts and Preferences Across User Turns
Give your ADK agent a memory that outlives the chat: the MemoryService write and read paths, the three implementations compared, and the after_agent_callback pattern that remembers conversations automatically.
DatabaseSessionService: Persisting Conversations to PostgreSQL and Cloud SQL
Swap InMemorySessionService for DatabaseSessionService and conversations survive every redeploy — with the right async driver, two-tiered locking for multi-replica deployments, and the v1.22.0 session schema migration.
Analyzing Conversation Drift and State Bloat Over 50+ Turns
Long ADK conversations quietly accumulate stale keys, oversized lists, and duplicated context until latency and accuracy both sag. How to measure drift with real numbers, clean state with explicit deltas, and let context compaction summarize the backlog away.
Encrypting Sensitive State Data at Rest and in Transit
Google Cloud encrypts your ADK session data by default — but what you put in state is your call. A layered guide: AES-256 at rest, TLS in transit, and encrypt-before-state plus Secret Manager at the application layer.
Implementing a User Forget-Me Tool for GDPR/CCPA Compliance in ADK
Right to erasure in an agent app means deleting sessions, artifacts, user-scoped state, and any memory backend copies — with an audit trail. Here is the erase flow built on list_sessions, delete_session, artifact deletion, and honest limits of ADK's MemoryService.
Multi-User Shared Sessions: Collaborative Multi-Party Agent Workspaces
ADK models a session as one user's thread with the agent — there is no built-in multi-party session. This post is honest about that and builds three workable collaboration patterns, with permission boundaries, auditability, and the temp: scope trap spelled out.
Replaying Historical Sessions for Auditing and Offline Debugging
A session is an ordered event log — replay it to rebuild state at any point, generate audit transcripts, and bisect bad invocations, with Runner.rewind_async as the interactive counterpart.
Storing Conversation Attachments and Blobs: Cloud Storage Session Linking
Put uploads and generated files in ADK artifacts backed by GcsArtifactService — versioned, session- or user-scoped, referenced from state instead of stuffed into it.
Session Expiration and TTL Management in High-Traffic Production Apps
ADK core has no built-in per-session TTL — this post shows the production patterns you own instead: scheduled delete_session sweeps, DB-level retention jobs, archival to GCS/BigQuery, and graceful SessionNotFoundError handling.
Managing Session Lifecycle: Creation, Retrieval, Archival, and Deletion
A practical tour of the ADK session lifecycle — the five SessionService operations, how the Runner drives each turn, SessionNotFoundError recovery, and patterns for listing, archiving, and deleting conversations.
Snapshotting and Restoring Agent State Across Distributed Nodes
Because ADK rebuilds session state by replaying each event's state_delta in order, a snapshot is just a serialized event log — and a restore is a replay. This post builds portable snapshots, shows why InMemorySessionService cannot survive a node change, and covers what rewind_async does and does not undo.
Schema Validation on State: Preventing Silent Failures with StateSchemaError
Declare a Pydantic state_schema on your ADK agent and every bad state write fails loudly with StateSchemaError — plus the two failure modes, the colon-key bypass, and the nested-write hole you still have to close yourself.
User Preference Profiling: Automatically Extracting Entity Attributes to State
Use output_key and EventActions.state_delta to extract user preferences into user:-scoped state, read them back with get_user_state, and personalize every future session without re-prompting.
Vector-Based Memory Retrieval: Semantic Recall over Past User Statements
Swap ADK's keyword memory for vector similarity and your agent can answer 'I told you I hate cilantro' without the word 'hate' ever appearing in the query. A hands-on guide to VertexAiRagMemoryService, tool-level search_memory, and when Memory Bank is the better fit.
VertexAiSessionService: Fully-Managed Enterprise Session Storage
Run ADK conversations on Google Cloud's managed Agent Platform: what VertexAiSessionService requires, why app_name must be the Reasoning Engine resource, and how to work around its get_user_state gap.
Distributed Graph Execution: Running Nodes Across Independent Workers
What ADK 2.0 graph workflows actually guarantee about distributed execution today, what you must build yourself, and a candid Cloud Run architecture sketch with limits and caveats.
Document Processing Pipeline: Parsing, Chunking, Extracting, and Storing via Graph
Build a parse → chunk → extract → validate → store document pipeline as an ADK 2.0 graph, with structured contracts between stages, bounded retry for flaky extraction, and scaling notes.
Building an Automated Incident Triage Workflow with ADK 2.0 Graphs
An end-to-end ADK 2.0 graph tutorial that ingests an alert, enriches it with tools, runs LLM severity analysis, and conditionally pages, logs, or auto-resolves — with deterministic routing for on-call safety.
Comparing ADK 2.0 Workflows with LangGraph and Temporal: Architectural Matrix
A fair architectural comparison of ADK 2.0 graph workflows, LangGraph, and Temporal across execution model, state, durability, HITL, visualization, and language support.
Graph Execution Cycles: Designing Bounded Cyclic Graphs and Retry Loops
Build review-retry cycles as back-edges in ADK graph workflows, guarantee termination with attempt counters, and know when a dynamic workflow while loop is the better tool.
RetryConfig in Graph Nodes: Per-Node Retry Policies and Exponential Jitter
Attach RetryConfig and timeout to ADK graph nodes for per-attempt recovery — max_attempts, exponential backoff with jitter, retryable exceptions, and when retries hurt.
Setting Workflow-Level Concurrency Limits with max_concurrency
Bound parallel node execution in ADK with the Workflow max_concurrency field and node-level max_parallel_workers, and see how limits interact with retries and rate limits.
Defining Input, Output, and State Schemas with Pydantic for Workflows
Use Pydantic BaseModel input_schema and output_schema on ADK agents and workflow nodes to enforce typed data contracts between steps, and learn when a schema beats session state.
Managing Workflow State: Scoped Node Updates and Immutable State Deltas
How ADK workflow state really works — Event(state=...) writes, ctx.state, key prefixes, committed deltas, and how to avoid the mutation bugs that parallel branches create.
Streaming Graph Progress: Emitting Node Progress Events to Frontend Clients
Learn how to yield user-facing progress events from ADK 2.0 graph nodes, stream them from the Runner to clients over SSE or websockets, and keep node output separate from what the user sees.
Dynamic Edge Computation: Computing Target Nodes at Runtime
When static conditional edges are not enough, compute target nodes at runtime with dynamic workflows, ctx.run_node, and Event(route=...) routing — and know which tool to choose.
Sub-Workflows: Nesting Workflows Inside Parent Workflow Graphs
Compose a Workflow as a node inside a parent graph, define the data contract across the boundary, and decide when to nest, flatten, or hand off to a dynamic or collaborative orchestrator.
Resuming Interrupted Workflows: rerun_on_resume and Idempotency Guarantees
Understand re-entry vs handoff semantics with rerun_on_resume, how ADK checkpoints completed child nodes, and how to write node bodies that stay correct across crash and human-input resumes.
Visualizing Workflow Graphs: Exporting Topologies to Mermaid and Graphviz
Inspect ADK workflow graphs in the developer Web UI and Visual Builder, then generate Mermaid flowcharts and Graphviz DOT from your edge declarations for docs and code review.
Workflow Timeouts and Cancellation Semantics for Long-Running Tasks
Configure per-node timeouts and retry policies in ADK graph workflows, understand what NodeTimeoutError does to a run, and learn how cancellation propagates through a running invocation.
Best Practices for Designing Clean, Maintainable, and Auditable Agent Graphs
A practical guide to designing ADK graph workflows that stay readable and reviewable: single-purpose nodes, typed boundaries, deterministic/LLM separation, isolated tests, and an audit trail from events and state deltas.
InMemorySessionService: Quick Prototyping and Ephemeral Multi-Turn State
What a SessionService is, how to set up InMemorySessionService for multi-turn conversations in local development, its data-loss caveats, how to test against it, and when to graduate to DatabaseSessionService or VertexAiSessionService.
State vs Memory vs Sessions: Deconstructing Persistence in ADK
A conceptual map of ADK persistence: sessions as conversation containers, state as a scoped key-value scratchpad, memory as cross-session knowledge, and artifacts for bulk data — with a decision table for when to use each.
Error Handling and Dead Letter Queues in ADK Workflows
Catch node failures in ADK graph workflows with RetryConfig and timeouts, then build a dead-letter branch that records the error payload for replay and alerting.
Memory Footprint Optimization in Complex Large-Scale Workflow Graphs
How to keep per-invocation memory low in ADK graph workflows: pass data along edges instead of state, offload big payloads to artifacts, prune temp keys, and compact a growing event history.
Dynamic Node Scheduling and Output Waiting with wait_for_output
How ADK schedules dynamic workflow nodes with ctx.run_node, and how wait_for_output keeps a node WAITING until it actually emits a real output.
Fan-Out and Fan-In Topologies: Executing Parallel Graph Branches
Build parallel ADK graph workflows with multiple START edges and JoinNode barriers, and learn the rules that keep fan-in from deadlocking in production.
Parameter Resolution in Workflow Nodes: ctx, node_input, and State Injection
How ADK resolves a workflow node's function arguments from node_input, ctx, and session state, including parameter_binding modes and coercion rules.
Conditional Edge Routing: Directing Graph Execution Based on Node Output
Learn how ADK graph workflows dispatch execution with router nodes, Event(route=...), DEFAULT_ROUTE, and dict-based edge maps for deterministic branching.
Node Types in ADK Workflows: FunctionNode, LlmAgent, and ToolNode Auto-Wrapping
How ADK coerces callables, agents, and tools into graph nodes: FunctionNode, LlmAgent cloning, and automatic tool wrapping explained with the rules.
Building Your First Graph Workflow with ADK 2.0 in Python
Step-by-step ADK 2.0 tutorial: build, run, and debug a Python graph workflow that classifies tickets, routes in code, and fans out with a JoinNode.
Core Graph Primitives: Nodes, Edges, and the Built-In START Entrypoint
A hands-on tour of ADK graph primitives: what counts as a node, how edge rows and routes work, and why the built-in START sentinel anchors every graph.
Introduction to ADK 2.0 Workflows: Why Graph-Based Execution Matters
ADK 2.0 adds graph, dynamic, and collaborative workflows. Learn why moving orchestration out of prompts and into deterministic node-and-edge execution pays off.
Agentic Data Cleaning Pipeline: Validator, Formatter, and Enricher
Build a three-stage Google ADK data cleaning pipeline with a deterministic validator, an LLM formatter, and a tool-equipped enricher sharing session state.
Simulating Multi-Stakeholder Negotiations with Specialized Role Agents
Run realistic multi-party negotiations in Google ADK by giving each stakeholder its own role agent, private constraints, and a shared offer ledger.
Building a Code Refactoring Swarm: Analyzer, Transformer, and Test Runner
Build an ADK agent swarm that analyzes, rewrites, and test-verifies a Python module in a retry loop with Analyzer, Transformer, and Test Runner agents.
Combining Deterministic Python Logic with Probabilistic Agent Handoffs
Blend guaranteed Python checks with LLM-driven handoffs in Google ADK: custom BaseAgent policy gates, session state as the contract, and bounded workflow loops.
Passing Artifacts Between Pipeline Stages Without Polluting Prompts
Move files, images, and large outputs between ADK pipeline stages using artifacts, so session state holds pointers and prompts stay free of raw payloads.
Handling Sub-Agent Failures: Partial Success and Circuit Breakers
Make ADK multi-agent runs survive failure: record partial success in session state, add a circuit breaker around flaky sub-agents, and retry only transient errors.
State Compression Between Pipeline Stages to Minimize Token Waste
Cut token cost in ADK pipelines by compressing what each stage writes to session state, isolating stages from history, and passing distilled handoffs instead of raw transcripts.
Building an Autonomous Research Team: Planner, Searcher, Synthesizer, and Editor
Build a four-agent ADK research team—planner, searcher, synthesizer, and editor—that splits a topic, shares findings through session state, and delivers a cited report.
Event Filtering and Redirection Between Autonomous Sub-Agents
Filter Google ADK's event stream by author, type, and finality, then redirect control between sub-agents with transfer signals and tool actions.
Orchestrating Diverse LLM Models Across Different Sub-Agent Roles
Assign the right model to each sub-agent role in Google ADK using string IDs, LiteLlm connectors, planners, and per-agent generation config.
State Leakage: Ensuring Sub-Agents Don't Contaminate Global Context
Keep sub-agent writes isolated in Google ADK with state prefixes, temp scope, branch isolation, and include_contents to stop context leakage.
Routing Inquiries: Building a Smart Dispatcher for Customer Support Tiers
Build a tier-aware dispatcher in Google ADK that classifies support inquiries and routes them to Tier 1, Tier 2, or VIP agents with state guards.
Preventing Infinite Delegation Loops: Setting max_turns and Hop Limits
Protect your Google ADK agent swarms from runaway token costs and conversational deadlocks by implementing max_turns, hop counters, and circuit breakers.
Dynamic Task Decomposition: Agents That Break Goals into Sub-Agent Assignments
How to build autonomous planner agents in Google ADK that break high-level objectives into structured sub-tasks and dynamically dispatch assignments to specialized worker agents.
Voting and Consensus Mechanisms Across Parallel Evaluator Agents
Mitigate model variance and hallucinations in critical AI decisions using parallel evaluator agents, majority voting, and Borda count consensus in Google ADK.
Agent Reflection and Critique: Building an Author-Reviewer Duet
Implement the Author-Reviewer reflection pattern in Google ADK using LoopAgent, structured rubric evaluations, and iterative critique loops.
Supervisor vs Peer-to-Peer Agent Topologies: Architecture Trade-Offs
A deep architectural comparison of Centralized Supervisor versus Decentralized Peer-to-Peer agent topologies in Google ADK across latency, token cost, and auditability.
Controlling Agent Transfer Rules: disallow_transfer_to_parent and peers
Enforce strict organizational boundaries in multi-agent fleets by configuring disallow_transfer_to_parent and disallow_transfer_to_peers in Google ADK.
The Coordinator/Specialist Pattern: Dynamic Sub-Agent Delegation with sub_agents
Implement hierarchical multi-agent delegation in Google ADK using the Coordinator/Specialist pattern and sub_agents routing.
LoopAgent: Iterative Refinement and Bounded Self-Correcting Loops
Build self-correcting agent loops with Google ADK's LoopAgent, bounded iteration limits, and EventActions escalation to achieve flawless task outputs.
ParallelAgent Fan-Out: Concurrent Sub-Agent Processing with Aggregation
Learn how to use Google ADK's ParallelAgent to execute multiple specialist agents concurrently, minimize total turnaround latency, and aggregate outputs.
SequentialAgent Pipeline: Chaining Deterministic Multi-Stage Workflows
Master Google ADK's SequentialAgent to build deterministic, multi-stage pipelines that pass context, transform data, and enforce predictable business logic.
Designing Reusable Toolsets: Packaging ADK Tools as Standalone Python Packages
How to package, version, and distribute reusable Google ADK tools as standalone Python libraries using pyproject.toml, hatchling, and clean Toolset interfaces.
Tool Metrics and Performance: Tracking Execution Latency and Failure Rates
Instrument Google ADK tool executions with OpenTelemetry and custom callbacks to monitor execution latency, error taxonomy, and degraded upstream dependencies.
Securing Tool Arguments: Sanitizing Inputs Against Command Injection
A comprehensive security guide on hardening Google ADK tool arguments against indirect prompt injection, OS command execution, SQL injection, and path traversal.
Web Scraping Tools: Headless Browser Extraction with Playwright
How to build resilient headless browser web scraping tools for Google ADK agents using Playwright, HTML-to-Markdown conversion, and token optimization.
Geocoding and Map Search Tools with Google Maps Platform
Equip Google ADK agents with spatial intelligence by integrating Google Maps Platform Geocoding, Places API, and Distance Matrix tools.
Building an Email Ingestion and Dispatch Tool with IMAP/SMTP
How to build safe, production-grade email ingestion and dispatch tools for Google ADK agents using Python's standard imaplib and smtplib.
Integrating Slack, Discord, and Telegram Webhooks as Agent Notification Tools
Equip your Google ADK agents with multi-channel outbound notification capabilities using Slack incoming webhooks, Discord embeds, and Telegram bot APIs.
Integrating Google Drive and Workspace APIs as ADK Tools
A step-by-step tutorial on connecting Google Drive, Docs, and Sheets to Google ADK agents using the Google Workspace APIs and official Python client libraries.
Building a Calculator and Math Toolset with Exact Precision
Why LLMs struggle with arithmetic and how to build deterministic, exact-precision math toolsets for Google ADK agents using Python's decimal module and safe AST parsing.
OAuth2 Token Management inside Tools: Authenticating User API Requests
Learn how to securely manage, refresh, and inject user OAuth2 tokens inside Google ADK tools to authenticate third-party API calls on behalf of end users.
Handling Binary Payloads: Returning Images, PDFs, and Audio from Tools
How to handle non-text outputs from ADK tools — choosing between inline base64 data parts, artifact storage services, and signed Cloud Storage URLs.
Multi-Step Tool Chains: Tools That Call Other Subordinate Tools
When and how to compose composite tools in ADK — bundling multi-step validation, fetching, and transformation pipelines into single atomic operations.
Caching Tool Responses to Eliminate Duplicate Expensive API Calls
How to eliminate redundant API calls and cut agent latency by implementing deterministic tool caching with in-memory LRUs, Redis backends, and cache-busting keys.
Rate-Limiting External Tool Calls to Protect Upstream Services
How to safeguard third-party APIs and downstream services by enforcing token-bucket rate limits, concurrency semaphores, and exponential backoff inside ADK tools.
Mocking Tools in Unit Tests: Building Predictable Agent Test Suites
How to isolate ADK agents from external side-effects using tool mocking, fake declarations, unittest.mock patches, and deterministic assertion harnesses in CI.
Tool Output Formatting: Markdown vs Structured Dictionaries for LLM Consumption
Choose what a tool actually returns: structured dicts with status and summary beat Markdown for chaining and callbacks, while prose belongs in the agent's final answer.
Pagination and Batch Processing Patterns for High-Volume Tools
Stop flooding the context: cap page sizes, switch from offset to cursor pagination, fan out bounded batches, and hand the model resumable state instead of raw row dumps.
Webhook Dispatcher Tools: Sending Outbound Events from Agent Actions
Build an ADK tool that fires outbound webhooks safely: signed HMAC payloads, endpoint allow-lists, idempotency keys, bounded retries, and a delivery status the model can act on.
GraphQL API Integration as Dynamic ADK Tools
Turn a GraphQL API into typed ADK tools: introspect the schema at build time, expose named operations with variables, batch requests, and shape responses for the model.
Database Querying Tools: Building Safe Read-Only SQL Agents
Layer a SQL tool so an ADK agent can explore data but never modify it: a read-only connection, a statement gate, an identifier allow-list, parameter binding, and a bounded result payload.
File System and Disk I/O Tools: Safe Workspace Isolation for Agents
Build ADK file tools that stay inside a per-session workspace: path confinement, traversal defense, artifact-backed storage, quotas, and an auditable cleanup policy.
Sandboxed Python Execution: Securing Dynamic Code Tools with E2B or Docker
Give agents a Python interpreter without handing them your server: sandbox options from E2B microVMs to hardened Docker, plus the ADK tool wrapper and the residual risks.
Tool Authorization and Permission Gates: Validating Caller Roles
Four places to enforce authorization in ADK — schema, in-tool policy, before_tool_callback, and plugins — plus identity choices and denial messages the model can act on.
Dynamic Tool Registration: Adding and Removing Tools Mid-Session
How ADK resolves an agent's tools per invocation, and the four ways to change the tool set at runtime: toolsets, list mutation, callback gating, and sub-agent routing.
Injecting Session and Context into Tools: Accessing State Inside Functions
How ADK injects ToolContext into a function tool, what the session, user, app, and temp state prefixes each mean, and the serialization and event rules that keep state consistent.
Long-Running Tools: Managing Asynchronous Jobs and Polling Patterns
Handle jobs that outlive a turn with LongRunningFunctionTool — pause semantics, event.long_running_tool_ids, resuming with FunctionResponse, and when to poll instead.
Building an MCP Client Toolset for Local and Stdio MCP Servers
Run local stdio MCP servers as agent tools — StdioConnectionParams, subprocess lifecycle, tool curation, diagnostics, and how it compares to using an MCP session directly.
Connecting MCP Servers to ADK Agents
Attach any MCP server to an ADK agent with McpToolset — transport choices, connection lifecycle, auth, resources, and how the three MCP integration patterns differ.
Enterprise REST API Integration: Auto-Generating Tools from OpenAPI Specs
Turn an OpenAPI 3.x document into callable ADK tools with OpenAPIToolset — how names and schemas are derived, how auth and headers are applied, and when to curate instead.
Built-in Tools: Web Grounding with Google Search Grounding Tool
Wire ADK's built-in google_search tool into an agent, understand the grounding data flow, read groundingMetadata for citations, and meet the display and billing rules that come with it.
Built-in Code Execution: Sandboxing Model-Written Python in ADK
Letting Gemini write and run Python inside an ADK agent: how the code_executor pipeline works, choosing between BuiltInCodeExecutor, Container, GKE, Vertex AI, and Cloud Run sandboxes, configuration options, and the limitations that bite.
Handling Tool Errors and Raising Recoverable Exceptions to the LLM
What the model actually sees when a tool fails, how to distinguish recoverable from terminal errors, writing error messages that produce a correct retry, sanitising output, and partial success patterns.
Synchronous vs Asynchronous Tool Implementations: When to Use async def
Blocking tools stall the event loop and your latency budget. How ADK executes sync and async tools, when async actually helps, fan-out with gather, CPU-bound work, timeouts and cancellation, and a decision guide.
Pydantic BaseModels as Tool Arguments: Enforcing Complex Validations
Passing Pydantic models into ADK tool signatures: how nested schemas reach the model, field constraints and validators, error messages the model can repair from, and separating the wire schema from your domain model.
Defining Function Tools in ADK: Type Hints, Docstrings, and Validation
How a plain Python function becomes an ADK tool — what the schema generator reads, the required-vs-optional rules, docstring structure as the model's contract, return conventions, and the failure modes that make tools misbehave.
Cost Optimization Strategies: Token Budgeting and Cache-Aware Prompting
The economics of an agent turn — input, cached, and output tokens — plus per-turn and per-session budgets, cache-aware prompt design, history pruning as cost control, and a measurement loop that produces real savings.
Managing Cold Starts and Model Warm-Up in Serverless Agent Functions
Why agent functions on Cloud Run take so long to wake up, how to measure cold vs warm latency honestly, and the concrete levers — min instances, concurrency, connection pools, startup CPU — that keep first requests fast.
Model Context Protocol vs Direct Function Calling: Trade-Offs for ADK Agents
A rigorous comparison of MCP and native function calling — latency, discovery, governance, security surface, portability, and testing — plus a decision table for when to use each, and how ADK lets you combine both.
Deploying Quantized Open Models (GGUF/AWQ) with Local ADK Runners
What GGUF and AWQ quantization actually trade away, choosing a quant level from VRAM and quality targets, running Ollama behind an OpenAI-compatible endpoint, and wiring the local model into an ADK agent with realistic expectations.
Structured JSON vs Markdown vs Tool Calls: Evaluating Extraction Reliability
A head-to-head comparison of three ways to get structured data out of a model — response schema, markdown-embedded JSON, and native function calling — with the failure modes of each and an eval harness to measure extraction accuracy.
Fallback Model Chains: Cascading from Primary to Secondary LLM
Design a primary→secondary→tertiary model chain with the right triggers, a wrapper you can put in front of an ADK agent, circuit breakers and health scoring, prompt compatibility across tiers, and the latency and cost trade-offs.
Benchmarking Gemini 3.8 Flash Latency and Cost Across Agent Workloads
Build a benchmark harness that measures TTFT, throughput, tool overhead, and cost per turn for Flash-class workloads, read percentiles honestly, and turn the results into routing and budget decisions.
Specifying Custom Model Credentials and Service Accounts in ADK
API keys vs user OAuth vs service accounts, how the Gen AI client picks its credentials, workload identity on Cloud Run, least-privilege IAM roles, per-tenant credential isolation, and keeping secrets out of prompts and code.
Controlling Hallucinations via Model Grounding Flags and Thresholds
Grounding as an engineering control: Google Search grounding, grounding with private data, retrieval thresholds, citation verification, and a layered defense that treats hallucination as a measurable rate rather than a vibe.
System Instruction Optimization: Meta-Prompting for Deterministic Tool Calling
Turn tool selection from hopeful guessing into a decision table: structuring the system instruction, decision rules and negative examples, few-shot tool transcripts, meta-prompting as an iteration loop, and evals that keep it honest.
Fine-Tuned Gemini Adapters: Deploying Custom Tuned Models in ADK
Supervised tuning end to end: preparing a JSONL dataset, launching and monitoring a tuning job with the Gen AI SDK, pointing an ADK agent at the tuned endpoint, and judging whether tuning beat prompting and retrieval.
Handling Rate Limits (429) and Quota Exhaustion with Exponential Backoff
Classifying 429s and RESOURCE_EXHAUSTED errors, implementing exponential backoff with full jitter, a reusable async retry helper for ADK tools and runners, and when retrying makes things worse.
Streaming Token Delays and TTFT Optimization in ADK
What time-to-first-token actually measures in an agent turn, where the delay comes from, and a concrete measurement and optimization playbook for ADK streaming — prompt size, model tier, region, thinking budgets, and transport.
Multimodal Inputs in ADK: Passing Images, Audio, and Video to LlmAgent
How to send images, PDFs, audio, and video into an ADK agent turn with google-genai Parts — inline bytes vs the Files API vs Cloud Storage URIs, token costs, and the streaming and tool patterns around them.
Thinking Models in ADK: Reasoning Budgets, Thought Traces, and Cost Control
How to use Gemini thinking models in ADK — BuiltInPlanner, ThinkingConfig include_thoughts and thinking_budget, when to spend more reasoning, and how to keep the meter under control.
Stop Sequences: Early Generation Termination in ADK
How stop sequences cut generation at exactly the right point — configuration, multi-sequence rules, structured-output interplay, and when a stop sequence beats prompt instructions.
Max Output Tokens and Truncation Strategies for ADK Agents
Choosing max_output_tokens per task, recognizing and handling truncated generations, and the prompt and config patterns that keep agent outputs complete and bounded.
Self-Hosted Low-Latency Inference: vLLM Endpoints for ADK Agents
Deploying vLLM as an OpenAI-compatible endpoint and wiring it into ADK — launch flags for tool calling, performance tuning, scaling, and when vLLM beats Ollama or cloud APIs.
Running Local Models in ADK with Ollama and LiteLLM
Pointing ADK agents at Ollama-hosted open models — the ollama_chat provider requirement, OLLAMA_API_BASE, model choice, and what local inference changes about your agent.
Connecting Third-Party Models to ADK with LiteLLM: Claude, OpenAI, Mistral
How ADK's LiteLLM connector exposes Claude, GPT, Mistral, and 100+ providers to agents — setup, model naming, configuration gotchas, and cross-provider routing patterns.
Dynamic Model Routing in ADK by Task Complexity
Building a router that sends each task to the right model — complexity signals, ADK's routing primitives, failover with error context, and evaluation to keep routing honest.
Structured Outputs in ADK: Pydantic Output Schemas and output_key
How to get typed, validated JSON out of an ADK agent — Pydantic output_schema, output_key, parsing behavior, error handling, and when to use structured output vs plain text.
GenerateContentConfig in Depth: Temperature, Top-P, Top-K, and Seed
What each sampling parameter actually does inside Gemini generation — temperature, top-p, top-k, and seed — how they interact, and how to set them per task in ADK.
Gemini 3.8 Flash vs Pro: Choosing the Right Model Tier for Your ADK Agent
A practical comparison of Gemini 3.8 Flash and Pro tiers in ADK — speed, reasoning depth, cost, and where each belongs across an agent's subtasks.
Enterprise ADK Assistants: Balancing Reliability, Latency, and Cost
A production checklist for enterprise ADK deployments — the three-way trade-off between reliability, latency, and cost, with concrete levers for each and metrics to watch.
ADK Design Patterns: Single Agent, Pipeline, and Swarm Topologies
How to choose and implement the right multi-agent topology in ADK — when one agent wins, when a pipeline fits, and when a supervisor swarm earns its complexity.
Production Python for ADK Projects: uv, ruff, and mypy Setups That Scale
A pragmatic toolchain for ADK codebases — uv for fast environments, ruff for linting and formatting, mypy for typing agents and tools — with configs tuned for agent projects.
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.
Headless and Background Agents in ADK: Async Queues and Trigger Runtimes
Running ADK agents without a user in the loop — trigger endpoints, ambient agents, concurrency and retry knobs, idempotent handlers, and queueing patterns for background work.
The InvocationContext Lifecycle and Thread Safety in ADK
What InvocationContext actually owns, when it is created and torn down, how the narrower context types relate to it, and the concurrency rules that keep sessions consistent.
Agent Exceptions and Graceful Fallback Strategies in ADK
Where exceptions actually surface in an ADK run — tools, callbacks, model calls — and how to design fallbacks that degrade quality deliberately instead of crashing the conversation.
Global Timeouts and Execution Deadlines in ADK Agents
How to bound agent runtime end to end — RunConfig call limits, asyncio timeouts around the runner, ambient-agent trigger deadlines, and layered watchdogs that fail predictably.
Dependency Injection in ADK: Supplying Services and Adapters to Agents
A practical guide to wiring services, model adapters, and tool dependencies into Google ADK — from constructor injection and the App class to scoped per-request services.
Managing Multi-Tenant ADK Instances: Isolating App Names and User Scopes
How ADK's (app_name, user_id, session_id) triple becomes a real tenancy boundary — scoping sessions, state, artifacts, and services so one tenant can never read another's data.
Extending the Runner Pipeline with Custom Middlewares and Hooks
Extend the ADK Runner pipeline with agent callbacks and BasePlugin hooks: return-value semantics, precedence rules, error hooks, and registering plugins on the App object.
Customizing Agent Output Serialization: From Markdown to Raw JSON
Force structured agent output with output_schema and output_key, capture parsed values in session state, and reformat raw LLM text with after_model_callback and --jsonl.
Handling Streaming Chunks and Partial Responses in ADK Runners
Partial events, token chunks, and final responses in ADK: how the Runner treats partial=True, how to accumulate text from run_async, and when state deltas get committed.
The Event Object Explained: Parts, Actions, State Delta, and Metadata
A field-by-field tour of google.adk.events.Event: content parts, EventActions with state and artifact deltas, control signals, metadata, and is_final_response().
Running ADK Headless: CLI Streaming and Non-Interactive Batch Modes
Run Google ADK with no browser: adk run one-shot queries, --replay batch files, --jsonl output, CI timeouts, and token-level SSE through the adk api_server /run_sse endpoint.
Exploring the ADK Developer Web UI: Local Inspection, Chat, and Graph Visualizer
Start adk web, chat with your agent, inspect sessions, state, and events, and use the agent structure graph view — with ports, flags, storage defaults, and telemetry.
Configuring Environment Variables and Secret Handling in ADK Projects
A practical guide to .env variables in ADK and agents-cli projects: GEMINI_API_KEY vs GOOGLE_* Vertex settings, ADC auth, deploy-time secrets, and telemetry flags.
ADK Versioning and Roadmap: Migrating from ADK 1.x to ADK 2.0
ADK 2.0 GA dates, the Workflow Runtime breaking changes, and a concrete migration path from google-adk 1.x — event schema, BaseNode, retries, and version pinning.
Managing Agent Identity and Persona Constraints in ADK
How ADK's LlmAgent name, description, instruction, and schema fields define agent identity, persona, and hard behavioral constraints — and where each boundary sits.
Configuring System Instructions: Dynamic Prompt Templating with State Injection
Learn how ADK's LlmAgent instruction templating injects session state with {key} syntax, when to use {key?} and InstructionProvider, and how to update state safely.
Building Non-LLM Base Agents: Deterministic Rules and Custom BaseAgent Subclasses
Not every agent needs a model. Subclass BaseAgent, implement _run_async_impl, and ship deterministic validators, escalators, and guards that run without a single LLM call.
Synchronous vs Asynchronous Agent Execution with Runner.run and Runner.run_async
Runner.run_async is ADK's primary entry point; Runner.run is a sync convenience backed by a background thread. Learn the exact signatures, internals, and when each fits.
The Role of RunConfig in Controlling Agent Execution and Modalities
RunConfig decides how every ADK run behaves — streaming mode, speech and response modalities, context loading, LLM call caps, and live-agent knobs. Here is how to set each one.
ADK Event Loop Deep Dive: How Events, Actions, and State Transitions Flow
A guided tour of ADK's event loop: how the Runner and your agents trade Events, when state_delta commits, why dirty reads happen, and how partial streaming events work.
Project Scaffolding Best Practices: Structuring Modular ADK Applications
Scaffold modular ADK projects with agents-cli: pick adk create or the full app/tests layout, keep root_agent importable, and wire evals, manifest, and env from day one.
Understanding the ADK Anatomy: Agents, Runners, Sessions, Events, and Tools
A guided tour of ADK's runtime anatomy: LlmAgent, Runner, Session, Event and Tools, plus the yield/pause/resume event loop that ties them together.
Your First ADK Agent: Building a Minimal Working Agent in Under 20 Lines
Build a working Google ADK agent in under 20 lines: one root_agent definition, a Gemini model, and two commands to run it from CLI or dev UI.
Installing and Setting Up the ADK Environment with Python 3.11+ and uv
Set up a Google ADK development environment from scratch: Python 3.11+, the google-adk package, constraints files, adk create, your API key and first run.
ADK vs LangChain, CrewAI, AutoGen, and OpenAI Agents SDK: Comparative Architecture
An architectural comparison of ADK, LangChain/LangGraph, CrewAI, AutoGen and the OpenAI Agents SDK: agent definition, orchestration, state, runtime, streaming, evals.
What is Google Agent Development Kit (ADK)? Architecture, Mission and Design Philosophy
Google's Agent Development Kit is an open-source, code-first framework for building, evaluating and deploying production AI agents across five languages.
Building a Self-Organizing Agent Swarm with Google ADK
How to build a declarative, self-expanding multi-agent system with Google ADK that spawns and persists its own specialists at runtime.
Architecting a Zero-Trust AI File Assistant: Google ADK, Keycloak OIDC, and MinIO STS in Practice
Solve the Confused Deputy problem in LLM tool calling by enforcing isolation at the storage layer with Google ADK, Keycloak OIDC, and MinIO STS.
Building the Same Agent in Three SDKs: A Portability Case Study
Build one support triage agent three times — OpenAI Agents SDK, Google ADK, and LangGraph — then extract a portability checklist for isolating SDK-specific code.
Building an Agent Swarm with Google ADK: Multi-Agent Systems Done Right
Learn how to build an agent swarm or multi-agent system with Google's Agent Development Kit (ADK) using deterministic workflow wrappers, shared session scratchpads, and Agent-to-Agent (A2A) RPC calls.
Google ADK Workflows: From ReAct Loops to Graph Execution
How one ADK agent's think-act-observe loop generalizes into Sequential, Parallel and Loop agents, session state, and ADK 2.0 graph workflows.
Realtime Voice Agents with Google ADK: Building Low-Latency Conversational AI
Build production-ready voice agents using Google Agent Development Kit with streaming audio, tool calling, and natural turn-taking.
Orchestrator-Worker Decomposition: Splitting Complex Tasks Across Agents
Decompose complex multi-step goals into structured worker sub-tasks using the Google Agent Development Kit (ADK) Orchestrator-Worker pattern.
The Agent SDK Landscape Deep Dive: LangGraph, CrewAI, MAF, ADK
A comprehensive comparison of the leading AI agent frameworks in 2026: LangGraph, CrewAI, Microsoft Agent Framework, and Google ADK, with practical guidance on choosing the right one.
Demystifying Graph Engineering in the Age of AI Agents
An overview of graph engineering for AI agents, covering harness, loop, and graph concepts, why it differs from knowledge graphs, and how fan-out, join, and router nodes power reliable agentic workflows.
Google ADK 2.0: Graph Workflows for Deterministic Agent Orchestration
Stop asking the LLM to do routing. ADK 2.0 graph workflows turn agent orchestration into deterministic code—cutting latency, token costs, and hallucinated execution paths.
Building a Multi-Agent System with Google ADK
Move from single-prompt chatbots to a team of collaborating agents. Use Google ADK hierarchy, workflow agents, and session state to orchestrate a research-and-write pipeline.
The Sub-Agent Pattern: Delegating to Specialized Gemini 3 Workers
Single-LLM workflows suffer context saturation. Learn the sub-agent pattern: coordinator plus specialized Gemini 3 workers with scoped context, routing, and model tiering.
Automated CI/CD Regression Evaluation for ADK Agents
Implement an automated Python quality gate for ADK agents in CI/CD pipelines to prevent trajectory regressions and enforce pass-rate thresholds before deployment.
Building a Dispatcher Agent with Specialized Subagents
Implement dynamic triage and intent-based routing using Google ADK dispatcher agents and specialized subagents for billing, tech support, and beyond.
Building an Eval Test Suite for ADK Agents
Move from vibes-based testing to structured evaluation for ADK agents, tracking tool call accuracy, trajectory efficiency, and LLM-as-a-judge quality scoring.
Building an Approval & Refund Graph Workflow with ADK 2.0
Step-by-step tutorial for constructing an auditable, graph-based refund processing workflow using ADK 2.0 and Python conditional routing.
Building Custom Async Function Tools in Google ADK
Learn how to build non-blocking asynchronous function tools in Google ADK to handle database queries, REST APIs, and external microservices with high performance.
One-Command CI/CD Deployment for ADK with GitHub Actions
Set up an end-to-end GitHub Actions workflow that executes tests, runs ADK evaluation quality gates, builds multi-stage Docker images, and deploys to Cloud Run.
Connecting MCP Tool Servers to ADK Agents
Connect Google ADK agents to Model Context Protocol (MCP) tool servers to seamlessly access pre-built integrations like SQLite, GitHub, Slack, and Google Drive without writing custom wrappers.
Containerizing & Deploying ADK Agents to Cloud Run
Learn how to package your Google ADK agent harnesses into lightweight Docker containers using uv and deploy them as auto-scaling microservices on Google Cloud Run.
Cross-Language Agent Communication via A2A Protocol
Connect Python ADK agents with remote microservices and workers written in Go or Java using the Agent-to-Agent (A2A) HTTP standard protocol.
End-to-End OpenTelemetry Tracing for ADK Agents
Instrument Google ADK agent harnesses with OpenTelemetry to capture full-trajectory execution traces, tool latencies, and token metrics.
Getting Started with ADK 2.0 Graph Workflows
Explore ADK 2.0 Graph Workflows to combine LLM reasoning with deterministic Python routing for complex, auditable enterprise AI agent architectures.
Implementing Human-in-the-Loop Approval Gates in ADK
Safeguard high-value actions in Google ADK using Human-in-the-Loop (HITL) interrupt gates and before-tool callbacks.
Monitoring ADK Agent Fleets with BigQuery Analytics
Learn how to stream structured telemetry from your Google ADK agent fleets into BigQuery for SQL-based cost tracking, latency analysis, and quality evaluation.
Parallel Code Review & Security Audit with ADK
Build an automated code review harness combining ParallelAgent auditors for security and performance with a SequentialAgent synthesizer in Google ADK.
Safety Guardrails & Token Budgeting for ADK Agents
Implement multi-layered safety guardrails, PII redaction, token budgets, and error-rate circuit breakers in Google ADK agent harnesses.
Sequential & Parallel Agent Pipelines in Google ADK
Master multi-agent orchestration primitives in Google ADK using SequentialAgent for ordered pipelines and ParallelAgent for concurrent execution.
Session Rewind & Error Recovery for ADK Agents
Learn how to use session rewind in Google ADK to roll back conversation context upon tool failures, prompt injections, or policy violations without losing session state.
Stateful Multi-Turn Conversations with ADK's DatabaseSessionService
Build production-grade, stateful AI agents in Google ADK using DatabaseSessionService to persist shopping cart state, user preferences, and history across process restarts.
What Is an Agent Harness? Core vs. Scaffolding in Production AI Systems
Understand the essential architectural difference between an AI agent core and its production agent harness, and why frameworks like Google ADK are critical for building reliable agentic applications.
Your First ADK Agent Harness: Hello World with agents-cli
Build a complete, runnable agent harness using Google ADK, featuring custom function tools, session callbacks, and the Runner abstraction.
Mastering the Agents CLI: Your Gateway to Enterprise-Grade AI Agents
Learn how to build, evaluate, and deploy enterprise-ready AI agents using the Google Agents CLI (ADK).
The "Context Caching" Revolution: Optimizing Costs for Gemini 3 Multi-Agent Clusters
Discover how Gemini 3’s context caching is fundamentally changing the economics of multi-agent systems by drastically reducing token costs and latency through the Google ADK.
MLflow Observability for Google ADK
Learn how to use MLflow Tracing to observe and debug Google ADK agents and tools using OpenTelemetry.
Integrating vLLM with Google ADK: A High-Performance Local LLM Guide
Learn how to leverage vLLM to host high-performance local LLMs and integrate them seamlessly with Google ADK using LiteLLM.
Multi-Agent Technical Book Publishing System: Automating the Lifecycle with Google ADK
Explore a production-grade implementation for automating the lifecycle of a technical book using the Google Agent Developer Kit (ADK), featuring a layered cognitive approach with specialized agents.
Understanding Parallel Agents in Google ADK
Learn how Parallel Agents in Google ADK leverage concurrency to speed up complex workflows and manage independent sub-agents efficiently.
Introduction to Agent-to-Agent (A2A) Protocol in Google ADK
Explore the Agent2Agent (A2A) Protocol in Google ADK, understanding when to use remote agents over local sub-agents to build scalable, multi-agent systems.
Exploring the Ecosystem of Google ADK Integrations
A comprehensive overview of the tools and integrations available in the Google Agent Development Kit (ADK) to supercharge your AI agents.
Loop Agent in Google ADK
An in-depth look at the Loop Agent in Google ADK, a workflow agent that executes sub-agents iteratively for tasks requiring repetition and refinement.