Skip to main content

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"))

Release files for dbos-google-adk 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dbos-google-adk 0.1.0
File Size Uploaded
dbos_google_adk-0.1.0.tar.gz 253.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dbos-google-adk 0.1.0
File Interpreter ABI Platform
dbos_google_adk-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 260.4 kB

Release files / dbos_google_adk-0.1.0.tar.gz

Download URL dbos_google_adk-0.1.0.tar.gz
Size 253.5 kB
Tags Source
SHA-256 checksum
How to use checksums
279c659acc88d8be626080746a61b3690999b555a93326da3e94c7512771c28b
BLAKE2b-256 checksum
How to use checksums
9600e7b5b23fdef509246350c223445bea8e0d443fa3e22c509ac966c710efba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 7, 2026.

Transparency log

Release files / dbos_google_adk-0.1.0-py3-none-any.whl

Download URL dbos_google_adk-0.1.0-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
31c34bad313a45cfafe0d431ee64947940dfca7b5e2e296b01426f9b8535e1aa
BLAKE2b-256 checksum
How to use checksums
69ae2dde947a9659f44af220426e0669808fbdb5a9603603c01aab9e18cde61e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 7, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page