<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Magesh Builds AI]]></title><description><![CDATA[A developer blog where I share my journey building AI agents, Generative AI applications, RAG systems, and cloud-based projects using modern technologies.]]></description><link>https://magesh-ai.hashnode.dev</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1593680282896/kNC7E8IR4.png</url><title>Magesh Builds AI</title><link>https://magesh-ai.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Sun, 06 Sep 2026 21:54:43 GMT</lastBuildDate><atom:link href="https://magesh-ai.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Building and Deploying a RAG AI Agent with Google Cloud: My Coffee Barista]]></title><description><![CDATA[☕ Building My First RAG AI Agent on Google Cloud — Coffee Barista
Introduction
I've always been interested in how AI applications work beyond just asking questions to a chatbot.
So, while working thro]]></description><link>https://magesh-ai.hashnode.dev/building-and-deploying-a-rag-ai-agent-with-google-cloud-my-coffee-barista</link><guid isPermaLink="true">https://magesh-ai.hashnode.dev/building-and-deploying-a-rag-ai-agent-with-google-cloud-my-coffee-barista</guid><category><![CDATA[generative ai]]></category><category><![CDATA[google cloud]]></category><category><![CDATA[ai agents]]></category><category><![CDATA[RAG ]]></category><category><![CDATA[gemini]]></category><dc:creator><![CDATA[Magesh Sugumaran]]></dc:creator><pubDate>Thu, 27 Aug 2026 19:35:16 GMT</pubDate><content:encoded><![CDATA[<h1>☕ Building My First RAG AI Agent on Google Cloud — Coffee Barista</h1>
<h2>Introduction</h2>
<p>I've always been interested in how AI applications work beyond just asking questions to a chatbot.</p>
<p>So, while working through the <strong>Google AI Cloud Academy</strong>, I decided to build something small but practical — a virtual coffee shop assistant.</p>
<p>I named it <strong>Coffee Barista</strong> ☕.</p>
<p>The idea was simple:</p>
<blockquote>
<p>Instead of searching through a menu manually, what if I could just ask an AI barista what I want?</p>
</blockquote>
<p>For example:</p>
<ul>
<li><p>"What drinks are available?"</p>
</li>
<li><p>"Tell me about the Matcha Green Tea Latte."</p>
</li>
<li><p>"What would you recommend for someone who likes matcha?"</p>
</li>
<li><p>"Do you have Dragon Fruit Espresso?"</p>
</li>
<li><p>"What dairy-free options do you have?"</p>
</li>
</ul>
<p>This project gave me hands-on experience with <strong>AI agents, RAG, vector search, Gemini, Firestore, Streamlit and Cloud Run</strong>.  </p>
<p>💡 What I Built</p>
<p>Coffee Barista is a customer-facing AI application that understands questions about a coffee shop menu and responds with relevant information.</p>
<p>Instead of making the AI simply generate an answer from its own knowledge, I wanted the responses to be connected to the actual menu data.</p>
<p>That's where <strong>Retrieval-Augmented Generation (RAG)</strong> comes in.</p>
<p>The basic idea is:</p>
<pre><code class="language-plaintext">User Question
      ↓
AI Agent
      ↓
Retrieve Relevant Menu Information
      ↓
Gemini
      ↓
AI Response
</code></pre>
<p>So the application can answer questions using the information available in the coffee shop's menu.  </p>
<p>🏗️ How the Application Works</p>
<p>The architecture of my application looks roughly like this:</p>
<pre><code class="language-plaintext">             👤 Customer
                  |
                  ↓
          ┌───────────────┐
          │   Streamlit   │
          │      UI       │
          └───────┬───────┘
                  |
                  ↓
          ┌───────────────┐
          │   ADK Agent   │
          └───────┬───────┘
                  |
                  ↓
          ┌───────────────┐
          │ Gemini /      │
          │ Vertex AI     │
          └───────┬───────┘
                  |
                  ↓
          ┌───────────────┐
          │   Firestore   │
          │ Vector Search │
          └───────┬───────┘
                  |
                  ↓
          📋 Menu Information
                  |
                  ↓
             🤖 Response
</code></pre>
<p>The application is hosted on <strong>Google Cloud Run</strong>, so the final application can be accessed through a web browser.  </p>
<p>☕ Creating the Coffee Menu</p>
<p>I started with a simple mock menu stored in <code>menu.json</code>.</p>
<p>Some of the items included:</p>
<ul>
<li><p>Oat Milk Honey Latte</p>
</li>
<li><p>Matcha Green Tea Latte</p>
</li>
<li><p>Vegan Blueberry Muffin</p>
</li>
<li><p>Cold Brew Coffee</p>
</li>
<li><p>Nitro Cold Brew</p>
</li>
<li><p>Iced Caramel Macchiato</p>
</li>
</ul>
<p>Each menu item contains information such as its name, description and price.</p>
<p>For example:</p>
<pre><code class="language-plaintext">Matcha Green Tea Latte

Price: $5.50

Description:
Creamy steamed oat milk infused with premium
Japanese matcha powder.
</code></pre>
<p>This gave the AI agent a small knowledge base to work with.  </p>
<p>🔎 Adding Vector Embeddings</p>
<p>This was one of the parts I found most interesting.</p>
<p>Instead of searching the menu only by exact words, I used <strong>text embeddings</strong> to represent menu information as vectors.</p>
<p>For example, the text:</p>
<pre><code class="language-plaintext">Matcha Green Tea Latte:
Creamy steamed oat milk infused with premium
Japanese matcha powder.
</code></pre>
<p>can be converted into a numerical vector representation.</p>
<p>That vector can then be stored in <strong>Firestore</strong>.</p>
<p>This allows the application to perform semantic retrieval.</p>
<p>For example, a customer might ask:</p>
<blockquote>
<p>"What would you recommend if I enjoy earthy and green tea flavors?"</p>
</blockquote>
<p>The question doesn't have to exactly match the menu description. The vector representation can help find information that is semantically related.  </p>
<p>🤖 Building the AI Agent</p>
<p>I used Google's <strong>Agent Development Kit (ADK)</strong> to build the agent logic.</p>
<p>The agent acts as the bridge between the customer and the menu information.</p>
<p>The basic flow is:</p>
<pre><code class="language-plaintext">Customer asks a question
          ↓
Agent understands the request
          ↓
Relevant information is retrieved
          ↓
Gemini generates the response
          ↓
Customer receives the answer
</code></pre>
<p>This makes the interaction feel much more natural than simply displaying a static menu.  </p>
<p>🎨 Building the Interface with Streamlit</p>
<p>For the frontend, I used <strong>Streamlit</strong>.</p>
<p>I wanted to keep the interface simple so that the main focus was the interaction with the AI barista.</p>
<p>The application contains:</p>
<ul>
<li><p>Coffee shop branding</p>
</li>
<li><p>Menu information</p>
</li>
<li><p>Chat interface</p>
</li>
<li><p>User questions</p>
</li>
<li><p>AI-generated responses</p>
</li>
<li><p>Personalized recommendations</p>
</li>
</ul>
<p>The final interface looks like a small virtual coffee shop assistant.  </p>
<p>☁️ Deploying to Cloud Run</p>
<p>Once the application was working locally, I deployed it to <strong>Google Cloud Run</strong>.</p>
<p>This was an important step for me because the project went from being something running in Cloud Shell to an actual publicly accessible application.</p>
<p>My deployed application is available here:</p>
<h3>🚀 Live Demo</h3>
<p><a href="https://coffee-barista-176896011523.us-west1.run.app/"><strong>https://coffee-barista-176896011523.us-west1.run.app/</strong></a></p>
<p>Anyone with the link can open the application and interact with the Coffee Barista.  </p>
<p>🔐 Using a Service Account</p>
<p>For the Cloud Run deployment, I created a dedicated service account for the application:</p>
<pre><code class="language-plaintext">barista-agent-sa
</code></pre>
<p>The application uses this service account to access the required Google Cloud services.</p>
<p>This also helped me understand an important cloud security concept:</p>
<p><strong>Least privilege.</strong></p>
<p>Instead of giving an application unnecessary permissions, the goal is to provide only the permissions required for it to work.  </p>
<p>🧪 Testing the AI Barista</p>
<p>After deployment, I tested the application with different questions.</p>
<h3>Test 1 — Checking the menu</h3>
<p>I asked:</p>
<blockquote>
<p>"What drinks are available?"</p>
</blockquote>
<p>The agent returned the available drinks from the menu.</p>
<hr />
<h3>Test 2 — Asking about a specific drink</h3>
<p>I asked:</p>
<blockquote>
<p>"Tell me about the Matcha Green Tea Latte."</p>
</blockquote>
<p>The agent provided information about the drink, including its ingredients and characteristics.</p>
<hr />
<h3>Test 3 — Getting a recommendation</h3>
<p>I asked:</p>
<blockquote>
<p>"What would you recommend for someone who likes matcha?"</p>
</blockquote>
<p>The agent recommended the Matcha Green Tea Latte and also suggested a suitable pastry.</p>
<hr />
<h3>Test 4 — Asking about something that isn't available</h3>
<p>I also tested:</p>
<blockquote>
<p>"Do you have Dragon Fruit Espresso?"</p>
</blockquote>
<p>The agent correctly responded that it wasn't available on the menu and suggested alternatives.</p>
<p>This was a useful test because an AI application shouldn't simply invent a product when it doesn't exist in the available menu information.  </p>
<p>📂 Project Structure</p>
<p>The project is kept relatively simple:</p>
<pre><code class="language-plaintext">coffee-barista-agent/
│
├── agent.py
├── app.py
├── menu.json
├── requirements.txt
├── seed.py
└── README.md
</code></pre>
<h3><a href="http://agent.py"><code>agent.py</code></a></h3>
<p>Contains the agent-related logic.</p>
<h3><a href="http://app.py"><code>app.py</code></a></h3>
<p>Contains the Streamlit application.</p>
<h3><code>menu.json</code></h3>
<p>Contains the coffee shop menu data.</p>
<h3><a href="http://seed.py"><code>seed.py</code></a></h3>
<p>Used for preparing/storing the menu data.</p>
<h3><code>requirements.txt</code></h3>
<p>Contains the Python dependencies.</p>
<h3><a href="http://README.md"><code>README.md</code></a></h3>
<p>Contains the project documentation.  </p>
<p>🛠️ Technologies I Used</p>
<p>The main technologies I worked with in this project were:</p>
<ul>
<li><p><strong>Python</strong></p>
</li>
<li><p><strong>Google Gemini / Vertex AI</strong></p>
</li>
<li><p><strong>Google ADK</strong></p>
</li>
<li><p><strong>Firestore</strong></p>
</li>
<li><p><strong>Firestore Vector Search</strong></p>
</li>
<li><p><strong>Text Embeddings</strong></p>
</li>
<li><p><strong>Streamlit</strong></p>
</li>
<li><p><strong>Google Cloud Run</strong></p>
</li>
<li><p><strong>Google Cloud IAM</strong></p>
</li>
<li><p><strong>Git</strong></p>
</li>
<li><p><strong>GitHub</strong>  </p>
<p>What I Learned</p>
<p>This project was more than just following a codelab for me.</p>
<p>I got to see how different pieces of a modern AI application fit together.</p>
<p>Some of the things I learned were:</p>
<ol>
<li>AI agents are more than just chatbots</li>
</ol>
<p>An agent can interact with tools and external data instead of relying only on the model's generated knowledge.</p>
<ol>
<li>RAG is useful for grounding AI</li>
</ol>
<p>If an application needs to answer questions about a specific dataset, retrieving relevant information first can make the responses much more useful.</p>
<ol>
<li>Vector search is pretty powerful</li>
</ol>
<p>I found the idea of searching based on meaning rather than exact keywords especially interesting.</p>
<ol>
<li>Cloud deployment is a different experience from local development</li>
</ol>
<p>Getting the application running locally is one thing.</p>
<p>Getting it deployed, configuring permissions, handling environment variables and making it publicly accessible is another.</p>
<ol>
<li>Security matters</li>
</ol>
<p>Working with service accounts and IAM made me understand why applications shouldn't simply be given broad permissions.</p>
<p>🚀 What's Next?</p>
<p>This Coffee Barista application is currently a simple prototype, but there are many ways I could extend it.</p>
<p>Some ideas I'd like to explore are:</p>
<p>🛒 Add a shopping cart 📦 Add order placement 💳 Add payment integration 📍 Add store/location information 👤 Remember customer preferences 🌐 Add multiple languages 🎙️ Add voice interaction 📊 Add analytics 📦 Connect the menu to real-time inventory</p>
<p>The same basic architecture could also be adapted for other use cases such as restaurant assistants, customer support agents, product recommendation systems and internal business assistants.</p>
<p>🔗 Project Links 🚀 Live Application</p>
<p><a href="https://coffee-barista-176896011523.us-west1.run.app/">https://coffee-barista-176896011523.us-west1.run.app/</a></p>
<p>💻 Source Code</p>
<p><a href="https://github.com/mageshsugumaran2123/coffee-barista-rag-agent">https://github.com/mageshsugumaran2123/coffee-barista-rag-agent</a></p>
<p>❤️ Final Thoughts</p>
<p>Building Coffee Barista was a really good introduction to putting together a complete Generative AI application.</p>
<p>What started as a simple coffee menu became an application involving:</p>
<p>Menu Data ↓ Embeddings ↓ Vector Search ↓ RAG ↓ AI Agent ↓ Streamlit ↓ Cloud Run ↓ 🚀 Live AI Application</p>
<p>The biggest takeaway for me was that building an AI application isn't just about getting an AI model to generate text.</p>
<p>It's about connecting the model to real data, tools, interfaces and cloud infrastructure to solve an actual problem.</p>
<p>And honestly, turning a coffee shop menu into my first deployed AI agent was a pretty fun way to learn it. ☕🤖</p>
</li>
</ul>
]]></content:encoded></item></channel></rss>