How Carrefour used Google Cloud ADK and Cloud Run to build a scale-to-zero RAG agent that answers data platform questions in minutes.
Shout out to Guillaume Blaquiere, Group Data Architect at Carrefour, for helping bring this story to life!
Problem
At Carrefour, a global retail leader with 80 million customers and 335,000 employees, our central Data Platform team acts as the data engine for the entire enterprise. We provide platform engineering resources for internal teams, from e-commerce and supply chain to HR and finance, who need to ingest, produce, or consume data. To support these internal users, we maintain a dedicated Google Chat space where anyone in the company can drop in to ask questions about using the data platform or querying specific datasets.
-
The bottleneck: Because of our immense scale and natural team turnover, our platform engineers were constantly answering the exact same questions. While we maintain extensive documentation, users naturally prefer asking questions in the chat. A human engineer would have to manually read the question, search our Confluence documentation (or attempt to recall edge cases from past chat histories), formulate an answer, and sometimes write a custom BigQuery SQL snippet for the user.
-
The impact: This manual support cycle was highly repetitive and time-consuming, pulling our engineers away from core platform development. For our users, it meant they often had to wait hours, or even a full working day, for an engineer to become available, slowing down their ability to extract business insights from our data.
What we built
To solve this, we built a Retrieval-Augmented Generation (RAG) chatbot called the Data Platform Assistant. Instead of forcing users to learn a new tool or navigate to a dedicated web portal, we connected the agent directly into our existing Google Chat support space.
Now, the agent automatically intercepts questions, retrieves relevant context from our documentation and past chat histories, and provides highly accurate answers, complete with sample queries, in a matter of minutes. Incredibly, the first Minimum Viable Product (MVP) of this agent was built by a single developer over a single weekend.
The stack & solution
To build a highly responsive and observable agent quickly, we utilized a vertically integrated Google Cloud stack:
-
Google Cloud ADK: The core orchestration framework used to define the agent, manage its tools, and handle the conversational loop. The transition from ADK1 to ADK 2 was very smooth and transparent.
-
Gemini 2.5 Pro: The conversational reasoning brain of the agent, selected for its capabilities and regional availability in Europe. (Note: We are actively testing 3.5 Flash to further optimize speed).
-
Agent Search (Discovery Engine): Powers the RAG pipeline. It creates the chunks, generates the embeddings and indexes our Confluence documentation as well as historical Google Chat discussions to capture unwritten “tribal” knowledge and complex edge cases.
-
Cloud Run: Hosts the custom middleware and the ADK agent. Because internal support is only heavily utilized during European working hours, Cloud Run’s scale-to-zero capability ensures we aren’t paying for idle compute during nights and weekends.
-
Agent Session Management: A serverless manager that captures and persists agent context, enabling multi-turn interactions that remain consistent even after several days or weeks.
-
BigQuery Agent Analytics + MCP: We use the BigQuery Managed Context Protocol (MCP) server so the agent can safely explore metadata and generate valid sample SQL. We also use the Agent Analytics plugin to stream detailed agent telemetry directly into BigQuery.
Under the hood
The biggest technical hurdle wasn’t building the LLM logic or writing the prompts, it was the
integration. We built a custom middleware layer hosted on Cloud Run to translate incoming Google Chat API webhooks into a format the ADK could process, and vice versa.
from fastapi import FastAPI, BackgroundTasks, Response
from google.apps.chat_v1 import ChatServiceClient, Message
app = FastAPI()
chat_client = ChatServiceClient()
@app.post("/")
async def on_message(event: dict, bg_tasks: BackgroundTasks):
# 1. Receive message in the middleware
msg = Message.from_json(event.get("message"))
# 3. Invoke ADK in background
bg_tasks.add_task(invoke_adk_and_reply, msg)
# 2. Synchronous immediate response to Google Chat
return Response(status_code=200)
async def invoke_adk_and_reply(msg: Message):
# 3. Call ADK agent URL
adk_text = call_adk_agent(msg.text)
# 4. Use Google Chat API to publish reply asynchronously in thread
reply = Message(text=adk_text, thread=msg.thread, space=msg.space)
chat_client.create_message(parent=msg.space.name, message=reply)
The technical wins
By leveraging the seamless integration between ADK, BigQuery, and Gemini on Google Cloud, we achieved immediate ROI:
-
Performance: Support resolution times dropped from hours/days down to ~2 minutes.
-
Rapid development: The initial MVP logic was built and deployed in just one weekend.
-
High adoption and efficiency: Because we brought the agent to where the users already were (Google Chat), adoption was instant. It is now the most used agent at Carrefour, supporting 700 to 800 active internal users and handling 100 to 200 deep technical discussions per week with zero change-management friction.
-
Cost efficiency: By hosting the agent on Cloud Run, the infrastructure scales entirely to zero during nights and weekends, ensuring we only pay for exact compute used.
-
User satisfaction: 75% of rated answers are evaluated as good and enough, no additional human needs to solve the issue or clarify data platform usage. It’s 0.5 FTE saved and allocated to more critical tasks.
What we learned
-
Lesson 1: Do not underestimate the integration effort
-
The Old Way: Many teams assume the LLM prompt engineering and reasoning logic is the hardest part of building an AI application, dedicating the bulk of their sprint points there.
-
The Golden Path: Since the quality of LLM and agentic framework is pretty high, building the agentic logic and prompting Gemini using the ADK was incredibly fast. The real engineering challenge, and where teams should allocate their sprint time, lies in the integration. Extracting clean data from Confluence into Agent Search, building the custom middleware to translate between the Google Chat API and the ADK, and managing state and sessions took the most effort.
-
-
Lesson 2: Meet users where they work
-
The Old Way: Building a shiny new standalone web application for an AI chatbot, which requires users to break their workflow, navigate to a new URL, and learn a new UI.
-
The Golden Path: By deploying the agent directly into our existing Google Chat support space, adoption was frictionless and automatic. If a user asks a question, the agent replies. If the agent’s answer is incomplete, a human engineer can jump in, seamlessly adding to the thread. This hybrid approach builds immediate trust and actively enriches our chat history RAG data for future queries.
-
Building something similar?
Try the Google Cloud ADK for fast agent orchestration.
Check out Cloud Run for scale-to-zero container hosting
Check out BigQuery Agent Analytics to stream and analyze your agent telemetry
Question:
Integrating LLM agents into existing collaboration tools (like Slack, Teams, or Google Chat) often requires custom middleware to handle API translation and session state. How is your team handling Thread-to-Session mapping in your enterprise chat integrations?
Let us know in the comments!

