Add Execution Mode for ADK Agent (multi-agent cost + non-real-time UX) #4168
rafiatha09
started this conversation in
General
Replies: 1 comment
-
|
Could this be of help to you? https://google.github.io/adk-docs/tools-custom/function-tools/#long-run-tool |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
Yes.
In my experience, multi-agent workflows are heavy to run in real time, and in most of my cases I do not require immediate answers.
A concrete example: I have a “scoring agent” used to prioritize client projects/deals. This agent is expensive because it needs to retrieve and synthesize data from multiple sources (docs, CRM, email, meeting transcripts, and browsing), which means multiple complex tool calls and often multiple agent handoffs. The common expectation is:
“Please assess these deals, and return the results later.”
This becomes a cost and UX problem:
ADK already supports batch/async execution in the context of offline evaluation, but production use cases frequently need a first-class “non-real-time execution mode” (e.g., “finish this task and email me later”).
Given that Gemini supports offline/batch-style processing, it would be very valuable if ADK could expose an execution mode that allows:
Describe the solution you'd like
Introduce an explicit Execution Mode for ADK agents and a first-class Job Service for job lifecycle management.
Add a config option to Agent (or LlmAgent) such as:
Example (based on the multi-agent pattern in adk-samples):
Introduce a dedicated Job Service abstraction to store and retrieve job records across invocations.
Motivation:
Job state (QUEUED/RUNNING/DONE/FAILED) is operational metadata that changes frequently and needs deterministic reads/writes. This does not map cleanly to “memory” (which is primarily for long-term knowledge retrieval) or to session state alone (which is scoped per session). A dedicated service makes the semantics clear and avoids mixing concerns.
Proposed interface (conceptual):
Default implementation:
Pluggable implementations:
Job record fields (minimum viable):
When a parent agent delegates to a child agent with execution_mode="offline":
Every time the parent/root tries to invoke the offline agent again (or when the user asks for status), ADK checks JobService:
If RUNNING:
{type: OFFLINE_JOB_RUNNING, job_id, last_update_at, optional_progress}
“Your scoring job is still running. You can continue chatting; I’ll update you when it’s done.”
If DONE:
If FAILED:
Describe alternatives you've considered
Status quo: Only use offline evaluation batching
Offline evaluation is helpful for regression testing and benchmarking, but it does not solve production async job execution patterns like:
“please finish this task and email me later.”
Custom job orchestration outside ADK
It’s possible to build a custom queue, persistence layer, and polling logic around ADK, but this becomes duplicated boilerplate and inconsistent across teams.
Store job state in MemoryService or Session state
A dedicated JobService is clearer, safer, and more extensible.
Additional context
My current production-like use cases that do not require real-time completion, but do require online access to tools/data sources:
Beta Was this translation helpful? Give feedback.
All reactions