AG-UI ADK Middleware

raw JSON →
0.6.1 verified Fri May 01 auth: no python

Middleware for the Google Agent Development Kit (ADK) that implements the AG-UI protocol. Enables ADK agents to communicate via the AG-UI protocol for streaming UI components and actions. Current version 0.6.1, requires Python >=3.10,<3.15, release cadence is irregular (several releases in Mar-Apr 2026).

pip install ag-ui-adk
error ModuleNotFoundError: No module named 'ag_ui_adk'
cause Package not installed or wrong import name (package is ag-ui-adk, but import uses underscores).
fix
Install with pip install ag-ui-adk and import as from ag_ui_adk import ....
error AttributeError: module 'ag_ui_adk' has no attribute 'ADKMethodAdapter'
cause Using old import path `from ag_ui_adk import ADKMethodAdapter` but version <0.6.0 where the class was under `ag_ui_adk.adapter`.
fix
Upgrade: pip install --upgrade ag-ui-adk. If stuck on old version, use from ag_ui_adk.adapter import ADKMethodAdapter.
deprecated The `handle_tool_call` method is deprecated in favour of `run`. Use `adapter.run()` instead of `adapter.handle_tool_call()`.
fix Replace `adapter.handle_tool_call(...)` with `await adapter.run(...)`.
breaking As of version 0.6.0, the import path changed from `ag_ui_adk.adapter` to `ag_ui_adk` (top-level). Old import `from ag_ui_adk.adapter import ADKMethodAdapter` will break.
fix Use `from ag_ui_adk import ADKMethodAdapter`.
gotcha The adapter is async; you must create an event loop (e.g., asyncio.run). Forgetting `await` on `adapter.run()` results in a coroutine object, not the result.
fix Always `await adapter.run(...)` inside an async function.

Creates an ADK agent and wraps it with the AG-UI adapter, then runs a query.

import asyncio
from google.adk import Agent
from ag_ui_adk import ADKMethodAdapter

async def main():
    agent = Agent(
        name="weather_agent",
        instruction="Call get_weather for any city.",
        tools=[],  # Adapter will attach AG-UI tools
    )
    adapter = ADKMethodAdapter(agent)
    # Run via AG-UI method call
    result = await adapter.run(input_text="What's the weather in Paris?")
    print(result)

asyncio.run(main())