How to Deploy an AI Coffee Shop Agent on Cloud Run Using Google ADK and RAG
In this hands-on Google Cloud Skills Boost lab, we build and deploy a customer-facing AI agent using the Google Agent Development Kit (ADK), Retrieval-Augmented Generation (RAG), and Cloud Run. The result is an intelligent coffee shop assistant that gives personalized recommendations by combining an AI agent with a knowledge base.
The video below shows the full walkthrough, including the build and deployment errors I ran into along the way and how I fixed them.
📌 Introduction
AI agents are quickly moving from demos to real customer-facing applications. Instead of a chatbot that only answers from its training data, an agent can reason, use tools, and pull in your own business information to give relevant answers.
This lab walks through that idea end to end: build the agent locally, connect it to a knowledge base, and deploy it to Google Cloud Run so it runs as a live web service.
🎯 What You'll Learn
- Build an AI agent using Google ADK
- Understand how Retrieval-Augmented Generation (RAG) works
- Create a personalized coffee shop assistant
- Configure the project for Cloud Run deployment
- Build and deploy the application to Cloud Run
- Troubleshoot common Cloud Build and deployment errors
- Verify the deployed AI agent
🧠 What is Google Agent Development Kit (ADK)?
The Agent Development Kit (ADK) is a framework from Google for building AI agents. It gives you a structured way to define an agent, give it instructions and tools, and run it locally before deploying it to the cloud. This makes it a good starting point for developers who want to move from simple prompts to real agent-based applications.
📚 What is Retrieval-Augmented Generation (RAG)?
Large Language Models only know what they were trained on. They can't automatically access your menu, your products, or your private data. RAG solves this by retrieving relevant information from a knowledge base first, then using it to generate the answer.
User Question
│
▼
Knowledge Base Retrieval
│
▼
Relevant Information
│
▼
AI Agent (LLM)
│
▼
Personalized Response
Why use RAG?
- Answers are based on your own data
- Fewer made-up (hallucinated) responses
- No need to retrain the model
- Easy to update by changing the knowledge base
☕ The Project: A Coffee Shop AI Assistant
In this lab, the agent acts as a coffee shop assistant. A customer can ask for a recommendation, and the agent looks up information in its knowledge base to suggest something that fits their needs. This is a simple example, but the same pattern applies to support bots, product advisors, and internal help desks.
🛠️ Steps Covered in the Video
Step 1: Build the AI Agent with ADK
We start by creating the agent using Google ADK and defining how it should behave as a coffee shop assistant.
Step 2: Add the Knowledge Base (RAG)
Next, we connect the agent to a knowledge base so it can retrieve relevant information before responding. This is what makes the recommendations personalized and accurate.
Step 3: Test the Application Locally
Before deploying, we run the application locally to confirm the agent responds correctly. Testing locally first makes it much easier to separate application bugs from deployment problems.
Step 4: Configure the Project for Cloud Run
We prepare the project for deployment so Cloud Run can build and run it as a container-based web service.
Step 5: Build and Deploy to Cloud Run
We then deploy the application to Cloud Run. Cloud Build builds the container image, stores it in Artifact Registry, and Cloud Run serves it as a live service. A source-based deployment generally looks like this (example only, values will differ in your lab):
gcloud run deploy YOUR_SERVICE_NAME \ --source . \ --region YOUR_REGION \ --allow-unauthenticated
Step 6: Troubleshoot Build and Deployment Errors
This is the part many tutorials skip. During my attempt, I hit multiple build and deployment errors and walk through them in the video instead of cutting them out. If your deployment fails, these are the areas worth checking:
- Service account permissions: the account used by Cloud Build or Cloud Run may be missing required IAM roles
- Artifact Registry access: the build may not be able to push or pull the container image
- Required APIs: Cloud Build, Cloud Run, and Artifact Registry APIs must be enabled
- Project configuration: a wrong project, region, or missing file can break the build
Always read the full error message in the Cloud Build logs. It usually points directly to the missing permission or setting.
Step 7: Verify the Deployed Agent
Once the deployment succeeds, we open the Cloud Run service URL and confirm the AI agent responds correctly as a live web service.
☁️ Topics and Services Covered
- Google Agent Development Kit (ADK)
- Retrieval-Augmented Generation (RAG)
- Cloud Run
- Cloud Build
- Service Accounts
- IAM Permissions
- Artifact Registry
- Google Cloud Console
- Generative AI and AI Agents
💡 Key Takeaways
- RAG lets an AI agent answer using your own data instead of relying only on the model's training
- ADK provides a clean way to build and structure AI agents
- Cloud Run makes it simple to turn an agent into a live web service
- Most deployment failures come down to IAM permissions, service accounts, or missing APIs
- Testing locally before deploying saves a lot of debugging time
✅ Conclusion
Building an AI agent is only half the job. Getting it deployed and working reliably in the cloud is where the real learning happens. This lab covers the full journey from agent design and RAG to Cloud Run deployment, and the troubleshooting section should help if you hit similar errors.
If this tutorial helped you, like the video, subscribe to the channel, and turn on notifications for more Google Cloud Skills Boost labs and cloud tutorials.
Disclaimer: This content is created for educational and learning purposes only. The cloud environment and resources shown are part of a controlled training/lab environment. Please use any commands or configurations only on cloud resources that you own or are authorized to access. This content is not affiliated with or endorsed by the respective cloud service provider unless explicitly stated.
Comments
Post a Comment