
Building cost-effective, high-throughput gen AI workflows in Google Dataflow
Google Cloud presents a method for building cost-effective gen AI workflows in Google Dataflow by using a lightweight CPU model to pre-filter events. This ensures only complex cases are routed to a heavyweight Gemini agent for adaptive execution.
Why it matters
This hybrid approach lowers API costs and reduces latency for organizations processing high-volume data streams. It enables automated, dynamic responses to specific customer issues without requiring extensive hardcoded logic.
The details
- Lightweight CPU models filter routine messages at zero incremental API cost.
- The gemini-3.5-flash agent performs remediation only for events flagged as negative.
- The workflow uses BigQuery and Gmail API to execute custom remediation plans.
Show entities and relationshipsHide entities and relationships
In this article
Key connections
Hugging Face owns distilbert-base-uncased-finetuned-sst-2-english
The article describes it as a Hugging Face model.
Dataflow uses Apache Beam
Dataflow is the serverless execution service for Apache Beam pipelines.
Dataflow uses distilbert-base-uncased-finetuned-sst-2-english
The sentiment model runs locally on Dataflow worker CPUs via Apache Beam's RunInference transform.
Dataflow uses Agent Development Kit
The Dataflow pipeline invokes the ADK remediation agent downstream of the sentiment pre-filter.
Agent Development Kit uses Gemini 3.5 Flash
The remediation agent built with ADK is backed by gemini-3.5-flash.
Agent Development Kit uses BigQuery
The agent's lookup_user and lookup_orders tools query BigQuery.
Show 3 more connectionsShow fewer connections
Agent Development Kit uses Gmail
The agent's send_email tool sends remediation emails via the Gmail API.
Agent Development Kit is built with Generative AI
ADK is used to build the generative AI remediation agent.
distilbert-base-uncased-finetuned-sst-2-english is built with Machine Learning
The sentiment classifier is a machine learning model.
Get the weekly recap
The stories like this one, picked and explained — once a week, straight to your inbox.