You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This Python middleware enables Google ADK agents to be used with the AG-UI Protocol, providing a seamless bridge between the two frameworks.
3
+
This Python middleware enables [Google ADK](https://google.github.io/adk-docs/) agents to be used with the AG-UI Protocol, providing a bridge between the two frameworks.
4
4
5
-
## Features
5
+
## Prerequisites
6
6
7
-
- ⚠️ Full event translation between AG-UI and ADK (partial - full support coming soon)
8
-
- ✅ Automatic session management with configurable timeouts
9
-
- ✅ Automatic session memory option - expired sessions automatically preserved in ADK memory service
10
-
- ✅ Support for multiple agents with centralized registry
11
-
- ❌ State synchronization between protocols (coming soon)
12
-
- ✅ **Complete bidirectional tool support** - Enable AG-UI Protocol tools within Google ADK agents
13
-
- ✅ Streaming responses with SSE
14
-
- ✅ Multi-user support with session isolation
7
+
The examples use ADK Agents using various Gemini models along with the AG-UI Dojo.
15
8
16
-
## Installation
9
+
- A [Gemini API Key](https://makersuite.google.com/app/apikey). The examples assume that this is exported via the GOOGLE_API_KEY environment variable.
10
+
11
+
## Quick Start
12
+
13
+
To use this integration you need to:
14
+
15
+
1. Clone the [AG-UI repository](https://github.com/ag-ui-protocol/ag-ui).
If you want to contribute to ADK Middleware development, you'll need to take some additional steps. You can either use the following script of the manual development setup.
This installs the ADK middleware in editable mode for development.
43
104
44
-
## Directory Structure Note
105
+
## Testing
45
106
46
-
Although this is a Python integration, it lives in `typescript-sdk/integrations/` following the ag-ui-protocol repository conventions where all integrations are centralized regardless of implementation language.
107
+
```bash
108
+
# Run tests
109
+
pytest
47
110
48
-
## Quick Start
111
+
# With coverage
112
+
pytest --cov=src/adk_middleware
113
+
114
+
# Specific test file
115
+
pytest tests/test_adk_agent.py
116
+
```
117
+
118
+
## Usage instructions
119
+
120
+
For instructions on using the ADK Middleware outside of the Dojo environment, see [Usage](./USAGE.md).
49
121
50
122
### Option 1: Direct Usage
51
123
```python
@@ -71,6 +143,7 @@ async for event in agent.run(input_data):
71
143
```
72
144
73
145
### Option 2: FastAPI Server
146
+
74
147
```python
75
148
from fastapi import FastAPI
76
149
from adk_middleware import ADKAgent, AgentRegistry, add_adk_fastapi_endpoint
# 3. Available for retrieval and context in future conversations
199
272
```
200
273
201
-
**Benefits:**
202
-
-**Zero-config**: Works automatically when a memory service is provided
203
-
-**Comprehensive**: Applies to all session deletions (timeout, user limits, manual)
204
-
-**Performance**: Preserves conversation history without manual intervention
205
-
206
274
### Memory Tools Integration
207
275
208
276
To enable memory functionality in your ADK agents, you need to add Google ADK's memory tools to your agents (not to the ADKAgent middleware):
@@ -223,7 +291,7 @@ my_agent = Agent(
223
291
registry = AgentRegistry.get_instance()
224
292
registry.set_default_agent(my_agent)
225
293
226
-
# Create middleware WITHOUT tools parameter - THIS IS CORRECT
294
+
# Create middleware WITHOUT tools parameter
227
295
adk_agent = ADKAgent(
228
296
app_name="my_app",
229
297
user_id="user123",
@@ -233,37 +301,12 @@ adk_agent = ADKAgent(
233
301
234
302
**⚠️ Important**: The `tools` parameter belongs to the ADK agent (like `Agent` or `LlmAgent`), **not** to the `ADKAgent` middleware. The middleware automatically handles any tools defined on the registered agents.
235
303
236
-
### Memory Testing Configuration
237
-
238
-
For testing memory functionality across sessions, you may want to shorten the default session timeouts:
0 commit comments