Google ADK with PraisonAI

Run PraisonAI agents YAML with Google Agent Development Kit via praisonai-frameworks

framework: google_adk connects PraisonAI’s YAML and CLI to Google’s Agent Development Kit, running your tasks against Gemini models with a single install.

Diagram

Google ADK Framework

📄 YAML Config

🔌 GoogleAdkAdapter

🤖 Google ADK

💎 Gemini Model

✅ Result

Quick Start

  1. Install
    bash
    pip install "praisonai[google-adk]"
  2. Set API Key
    bash
    export GOOGLE_API_KEY=your-key
    # or: export GEMINI_API_KEY=your-key
  3. Create agents.yaml
    yaml
    framework: google_adk
    topic: math
    roles:
      calculator:
        role: Calculator
        goal: Compute exactly
        backstory: Return only the numeric answer.
        tasks:
          add:
            description: What is 3 + 3?
            expected_output: "6"
  4. Run
    bash
    praisonai agents.yaml --framework google_adk

How Google ADK Works

Diagram
GeminiGoogle ADKGoogleAdkAdapterFrameworkAdapterRegistryPraisonAIUserGeminiGoogle ADKGoogleAdkAdapterFrameworkAdapterRegistryPraisonAIUserpraisonai agents.yaml –framework google_adkcreate(“google_adk”)GoogleAdkAdapter (entry-point)run(config, llm_config, topic, tools_dict)build google.adk.agents.Agent(s) + tasksinvoke gemini-2.5-flashcompletionresult text“result

Every result begins with the sentinel prefix ### Google ADK Output ###. Downstream parsers can split on this to extract only the run output.


Capabilities

CapabilitySupported
agent_creation✅
tool_execution✅
sequential_execution✅
handoff✅
tool_loop✅

Models

ModelAPI key
gemini-2.5-flash (native)GOOGLE_API_KEY or GEMINI_API_KEY
openai/gpt-4o-mini (LiteLLM)OPENAI_API_KEY

Sequential Context (Task Chaining)

Tasks reference outputs of earlier tasks with context: [task_name]:

yaml
framework: google_adk
topic: numbers
roles:
  writer:
    role: Writer
    goal: Write numbers only
    backstory: Concise writer
    tasks:
      draft:
        description: Reply with only the number 3.
        expected_output: "3"
      polish:
        description: Add 3 to the previous result. Reply with only the number.
        expected_output: "6"
        context:
          - draft

Handoffs

Use handoff.to with a single router task; specialists are listed without tasks:

yaml
framework: google_adk
topic: language help
roles:
  triage:
    role: Triage Agent
    handoff:
      to:
        - English Agent
    tasks:
      route:
        description: Help with {topic}
  english:
    role: English Agent
    goal: Reply in English only
    backstory: English specialist.

Multi-task configs with handoff.to fall back to sequential execution (OpenAI parity).


Direct Adapter Use (Advanced)

Call the adapter without the CLI or YAML loader:

python
from praisonai_frameworks.google_adk.adapter import GoogleAdkAdapter

config = {
    "framework": "google_adk",
    "topic": "Quick test",
    "roles": {
        "helper": {
            "role": "Assistant",
            "goal": "Answer briefly",
            "backstory": "Helpful assistant",
            "tasks": {
                "answer": {
                    "description": "Reply with exactly the word OK.",
                    "expected_output": "OK",
                }
            },
        }
    },
}
llm_config = [{"model": "gemini-2.5-flash", "api_key": ""}]   # use $GOOGLE_API_KEY or $GEMINI_API_KEY
result = GoogleAdkAdapter().run(config, llm_config, "Quick test", tools_dict={})
# result starts with "### Google ADK Output ###"

Verify Installation

Check availability via praisonai doctor:

bash
$ praisonai doctor
✓ Runtime 'google_adk' available
  name: Google ADK
  capabilities: agent_creation, tool_execution, sequential_execution, handoff, tool_loop

Or check from Python:

python
from praisonai._framework_availability import is_available

if is_available("google_adk"):
    print("Google ADK is installed and importable")

_google_adk_probe() checks three things in order:

  1. importlib.metadata.distribution("google-adk") — the PyPI dist must be installed.
  2. importlib.util.find_spec("google.adk") — the google.adk import namespace must be discoverable.
  3. from google.adk.agents import Agent or from google.adk import Agent — the ADK’s Agent symbol must import without error (tries the submodule path first, falls back to the package root for older ADK layouts).

True from is_available("google_adk") guarantees the adapter can run, not just that the package is on disk.


Pip Extras Reference

ExtraInstallsRequired for
praisonai[google-adk]praisonai-frameworks[google-adk]>=0.1.8, praisonai-tools>=0.1.0Probe + doctor recognition + adapter dispatch for Google ADK
praisonai-frameworks[google-adk] (transitive)Google ADK adapter implementation registered via entry-point group, plus the google-adk PyPI distActually executing framework: google_adk

Troubleshooting

framework='google_adk' is not a valid choice — you are running a pre-PR-#2506 PraisonAI version. Upgrade: pip install -U praisonai.

Framework 'google_adk' was requested but is not installed — run pip install 'praisonai[google-adk]' (from your project rather than praisonai-frameworks[google-adk] alone, so praisonai-tools is also pulled in).

ValueError: framework='google_adk' in workflow YAML is not supported for workflow execution — switch the file to the roles: agents.yaml shape used in the Quick Start above.

google.adk imports successfully but is_available("google_adk") returns False — the probe also requires google-adk to be visible to importlib.metadata.distribution(...). If the package was installed in editable or namespace-only mode without a real dist-info, the probe refuses. Install the published google-adk PyPI package.

API key not found — set either GOOGLE_API_KEY or GEMINI_API_KEY. The adapter checks GOOGLE_API_KEY first; if absent it falls back to GEMINI_API_KEY. If both are set, GOOGLE_API_KEY wins.


Best Practices

When to pick google_adk over other frameworks

Choose google_adk when you are already on Gemini and want the official Google ADK semantics, or when sequential task graphs with tool calls are sufficient. For dynamic multi-agent delegation requiring handoffs, both google_adk (>= 0.1.8) and praisonai, autogen_v4, openai_agents, or agno work well.

When to use handoffs

Handoff support is available since praisonai-frameworks>=0.1.8 (PraisonAI PR #2507). Use handoff.to in your YAML when you need a router agent to delegate to specialists. Multi-task configs fall back to sequential execution. See Handoffs for the full conceptual model.

Use the roles: format

Always use the roles: agents.yaml shape. The workflow steps: format raises a ValueError at validation time and is explicitly not supported for framework: google_adk.

Use context: to express task dependencies

Declare task dependencies with context: [task_name] in your YAML. This keeps the config declarative and lets the adapter wire the SDK’s task chain automatically — no adapter-level code required.

Parse the output sentinel

Every run returns text beginning with ### Google ADK Output ###. Downstream code can split on this sentinel to extract only the run output, making it easy to chain Google ADK results into other systems.


Related