DBOS integration for the Google Agent Development Kit
Project description
Durable Google ADK Agents
Durable execution for the Google Agent Development Kit using DBOS.
Installation
pip install dbos-google-adk
Usage
Add DBOSPlugin to your Runner and call it from a @DBOS.workflow().
Annotate tool calls with @DBOS.step().
import asyncio
import logging
from dbos import DBOS, DBOSConfig
from dbos_google_adk import DBOSPlugin
from google.adk.agents import LlmAgent
from google.adk.runners import Runner
from google.adk.sessions import InMemorySessionService
from google.genai import types
# Suppress cosmetic OpenTelemetry warning. See google/adk-python#4894.
logging.getLogger("opentelemetry.context").setLevel(logging.CRITICAL)
# Decorate tool calls with @DBOS.step() for durable execution
@DBOS.step()
async def get_weather(city: str) -> str:
"""Get the weather for a city."""
return f"Sunny in {city}"
agent = LlmAgent(name="weather", model="gemini-2.5-flash", tools=[get_weather])
runner = Runner(
app_name="my-agent",
agent=agent,
plugins=[DBOSPlugin()],
session_service=InMemorySessionService(),
)
# Drive the agent from a DBOS workflow for durable execution
@DBOS.workflow()
async def run_agent(user_id: str, session_id: str, message: str) -> str:
new_message = types.Content(role="user", parts=[types.Part.from_text(text=message)])
async for event in runner.run_async(
user_id=user_id, session_id=session_id, new_message=new_message
):
if event.is_final_response():
return event.content.parts[0].text
return ""
async def main():
config: DBOSConfig = {"name": "my-agent"}
DBOS(config=config)
DBOS.launch()
await runner.session_service.create_session(
app_name="my-agent", user_id="u", session_id="s"
)
print(await run_agent("u", "s", "How is the weather in San Francisco?"))
if __name__ == "__main__":
asyncio.run(main())
DBOSPlugin checkpoints every model call through DBOS so that an interrupted
workflow resumes from the last completed step on retry. It must be used from
within a @DBOS.workflow().
For durable event compaction, wrap your summarizer with DBOSEventSummarizer
so the compaction LLM call is also checkpointed:
from dbos_google_adk import DBOSEventSummarizer
from google.adk.models.google_llm import Gemini
summarizer = DBOSEventSummarizer.from_llm(Gemini(model="gemini-2.5-flash"))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dbos_google_adk-0.1.0.tar.gz.
File metadata
- Download URL: dbos_google_adk-0.1.0.tar.gz
- Upload date:
- Size: 253.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
279c659acc88d8be626080746a61b3690999b555a93326da3e94c7512771c28b
|
|
| MD5 |
22ebdbd1c49a60dd4d259e792d5a8ee1
|
|
| BLAKE2b-256 |
9600e7b5b23fdef509246350c223445bea8e0d443fa3e22c509ac966c710efba
|
Provenance
The following attestation bundles were made for dbos_google_adk-0.1.0.tar.gz:
Publisher:
publish.yml on dbos-inc/dbos-google-adk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dbos_google_adk-0.1.0.tar.gz -
Subject digest:
279c659acc88d8be626080746a61b3690999b555a93326da3e94c7512771c28b - Sigstore transparency entry: 1464873316
- Sigstore integration time:
-
Permalink:
dbos-inc/dbos-google-adk@04ecc2fb0db71ee6619846c301d62797e22baa5c -
Branch / Tag:
refs/heads/release/v0.1.0 - Owner: https://github.com/dbos-inc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@04ecc2fb0db71ee6619846c301d62797e22baa5c -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file dbos_google_adk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dbos_google_adk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31c34bad313a45cfafe0d431ee64947940dfca7b5e2e296b01426f9b8535e1aa
|
|
| MD5 |
97e9baee20bb16338b31c892a50392ab
|
|
| BLAKE2b-256 |
69ae2dde947a9659f44af220426e0669808fbdb5a9603603c01aab9e18cde61e
|
Provenance
The following attestation bundles were made for dbos_google_adk-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on dbos-inc/dbos-google-adk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dbos_google_adk-0.1.0-py3-none-any.whl -
Subject digest:
31c34bad313a45cfafe0d431ee64947940dfca7b5e2e296b01426f9b8535e1aa - Sigstore transparency entry: 1464873746
- Sigstore integration time:
-
Permalink:
dbos-inc/dbos-google-adk@04ecc2fb0db71ee6619846c301d62797e22baa5c -
Branch / Tag:
refs/heads/release/v0.1.0 - Owner: https://github.com/dbos-inc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@04ecc2fb0db71ee6619846c301d62797e22baa5c -
Trigger Event:
workflow_dispatch
-
Statement type: