Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.idun-group.com/llms.txt

Use this file to discover all available pages before exploring further.

Google ADK (Agent Development Kit) is Google’s framework for building Gemini-powered agents. Idun Engine wraps ADK agents as production services with AG-UI streaming, guardrails, and observability.
Want to start from working code? The agent templates include ADK examples for tool calling and structured I/O.

Code

agent.py
from google.adk.agents import Agent

root_agent = Agent(
    model="gemini-2.5-flash",
    name="weather_agent",
    description="An agent that answers questions about the weather.",
    instruction="You are a helpful weather assistant. Answer questions about weather conditions.",
)
If you use Vertex AI models, authenticate with gcloud auth application-default login before running the agent.

Config

config.yaml
server:
  api:
    port: 8000

agent:
  type: ADK
  config:
    name: "my-adk-agent"
    agent: "./agent.py:root_agent"
    app_name: "myagent"

How it works

The ADK adapter wraps your raw Agent instance for production serving. Five stages, driven by agent.config in config.yaml:
  1. Load. agent is parsed as <file_path>:<variable_name>. The adapter resolves it via importlib.util.spec_from_file_location, so the value must point at a real .py file (relative or absolute). Unlike LangGraph, module-dotted notation (my_pkg.agent:root_agent) is rejected here.
  2. Wrap. The loaded agent goes into google.adk.apps.App(root_agent=agent, name=app_name), then into ADKAGUIAgent from ag_ui_adk for AG-UI event streaming.
  3. Sessions. A session_service is initialized from config.yaml (in_memory by default, or database, or vertex_ai) and passed into the runner. Session state, including the AG-UI thread_id mapping, is kept in this service.
  4. Memory. A memory_service is initialized in parallel (in_memory by default, or vertex_ai) for long-term recall.
  5. Observability. When a Langfuse provider is enabled in observability:, the adapter installs GoogleADKInstrumentor from openinference.instrumentation.google_adk automatically. When LangSmith is enabled, it calls langsmith.integrations.google_adk.configure_google_adk(name=...). No extra wiring needed in your agent code.
  6. Serve. Chat requests POST to /agent/run with the AG-UI streaming protocol, same as LangGraph.
Source: libs/idun_agent_engine/src/idun_agent_engine/agent/adk/adk.py.

Adding MCP tools

To wire MCP servers registered in config.yaml (or the admin panel) into the agent, pull them in with get_adk_tools() and pass them to the Agent constructor:
agent.py
from google.adk.agents import Agent
from idun_agent_engine.mcp import get_adk_tools

root_agent = Agent(
    model="gemini-2.5-flash",
    name="weather_agent",
    description="An agent that answers questions about the weather.",
    instruction="You are a helpful weather assistant. Answer questions about weather conditions.",
    tools=get_adk_tools(),
)
get_adk_tools() runs at engine boot, after the MCP registry has connected to every server in mcp_servers, so every advertised tool is available to the agent without per-tool wiring. See MCP Servers for the full transport reference.

Session and memory services

ADK agents have two persistence layers: session services (conversation state) and memory services (long-term recall). The scaffolded config.yaml uses in-memory for both by default. See Memory and sessions for ADK for backend options including Database (PostgreSQL) and Vertex AI.
ADK does not support folder paths that contain spaces. Make sure your project directory path has no spaces.

Next steps

Memory and session details for ADK

Configure session and memory services across backends.

Guardrails

Add safety guards to your agent inputs and outputs.

Observability

Trace runs, monitor latency, and inspect token usage.

MCP Servers

Connect external tools through the Model Context Protocol.
Last modified on May 26, 2026