DEV Community

Pradyumna Roy
Pradyumna Roy

Posted on

Building an Allergen-Aware AI Barista using Google Cloud ADK, Gemini, and Cloud Firestore

As conversational AI transitions from generic chatbots to specialized corporate agents, grounding language models in precise operational data has become a necessity. Recently, I built a serverless AI Barista application designed to act as an interactive coffee shop assistant. The architecture leverages the Google Agent Development Kit (ADK) alongside the high-efficiency Gemini 1.5 Flash model to drive intelligent customer conversations, manage contextual dialogue history, and surface accurate product recommendations.

The Backend and Security

To ensure production-grade security and data precision, the system avoids embedding raw text catalogs directly inside system prompts—which inflates response latency and transaction token counts. Instead, the backend utilizes Cloud Firestore in Native Mode as a scalable NoSQL vector database, implementing a flat composite vector index mapped to 768-dimensional embeddings via Google’s text-embedding-004 model. The running application executes under a custom Identity and Access Management (IAM) service account conforming strictly to the Principle of Least Privilege, isolating database access roles from broader compute engine capabilities.

Application Hosting & Validation

The application layer is wrapped inside an interactive, responsive Streamlit user interface and containerized for deployment on serverless Google Cloud Run infrastructure. During validation testing, the deployed RAG (Retrieval-Augmented Generation) agent successfully navigated out-of-menu safety traps without hallucinating, dynamically filtered allergen-specific requests (such as lactose intolerance exclusions), and seamlessly fetched dynamic menu additions (like a newly pushed 'Matcha Green Tea Latte') in real-time directly from the live production database.

Top comments (0)