This is a demo app that shows how to build an agent-driven beverage ordering system using Firebase and Google Cloud.
Explore the demo and its underlying concepts in more detail on the solutions page at https://developers.google.com/solutions/learn/agentic-barista
AI Barista is an intelligent chatbot application designed to simulate a coffee shop ordering experience. Users can interact with an AI agent to place beverage orders, ask for recommendations, and confirm their selections.
This project is intended for demonstration purposes only. It is not intended for use in a production environment.
We recommend trying out this project in Firebase Studio. Click this button to launch the project in Firebase Studio and follow the steps below to get started.
- A new Firebase project
- We recommended using a new Firebase project for this demo. This simplifies cleanup to avoid incurring on-going costs after trying out this demo app.
- Activate billing on your Google Cloud / Firebase Project
- Enable the Anonymous authentication sign-in method for your project.
- You may chose to upgrade your project and enable automatic clean-up of old accounts.
- Create a default Firestore database by navigating to Firestore in the console.
- Enable Vertex AI and recommended APIs in the Google Cloud console.
Note
Enabling billing and deploying services may incur a cost. Follow the steps under Delete and clean up deployed services to remove any deployed services after trying out this demo.
- Open the project in Firebase Studio.
- When prompted, select your Firebase project.
- Log into Firebase Hosting. Navigate to the "Firebase Studio" screen and select "Authenticate". Follow the prompts in the terminal.
- Prepare your Firebase project by setting up security rules, TTL configuration and functions for cleaning up data:
- Select a Firebase project:
firebase use
. - Deploy Firestore, Storage and Functions:
firebase deploy --only firestore,storage,functions
- Follow any additional prompts to set up access and grant permissions.
- You may need to grant the Logs Writer permission.
- Select a Firebase project:
- Configure Firebase for the Angular frontend app.
- Navigate to the Firebase console, create a new web client and donwload the configuration file for your project.
- Add the configuration into the file
client/web/angular-customer-app/src/environments/environment.development.ts
.
- The app is now ready! Switch to the Web Preview to see it in action.
You can run the application locally and access Firebase and Google Cloud directly.
- Set up the Google Cloud SDK.
- Set up the Firebase CLI.
- Set up Application Default Credentials (ADC) for a local development environment
Follow the steps in services/cloud-run, client/web/angular-customer-app and services/local-recommendation to run each component.
This project consists of two main parts:
- client/web/angular-customer-app: The frontend customer ordering app, built with Angular.
- services/cloud-run/: The backend, built with Genkit, Vertex AI, Firestore, Clound Run and Cloud Storage for Firebase.
Two additional systems provide some additional services:
- services/functions: Cloud Functions for Firebase to handle clean up of data stored in Cloud Storage.
- services/local-recommendation: A simple HTTP-service that returns a drink recommendation from a fixed list of beverages.
Once the application is up and running, talk to the agent to assemble and submit a beverage order.
Here are some example messages to try.
I want to order a latte with oat milk and double shots.
Add 1 latte, regular milk, 1 shot, no sweeteners to the order.
Order a cappucino with almond milk and extra sugar.
I'd like a decaf almond cappuccino, double shots with chocolate sauce.
Add a cortado with with quadruple shots, iced, regular milk and a Matcha Latte with extra foam, hazelnut sauce and sugar free vanilla sweetener.
Order 1 latte with oat milk, 2 shots and a latte, regular milk, 1 shot with sugar.
Actually, instead of the Latte I'd like an espresso. Make it extra hot.
I want oat milk instead.
Clear my order and let me start again.
What's my order?
Submit my order
You can deploy the backend and the frontend directly from Firebase Studio. Follow the on the "Firebase Studio" screen to deploy the app to Google Cloud Run and Firebase Hosting.
Don't forget to deploy Cloud Functions and the Storage and Firestore configurations:
firebase deploy --only firestore,storage,functions
See services/cloud-run and client/web/angular-customer-app for more details and manual deployment steps.
To avoid continued billing for the resources that you have created as part of trying out this demo app, delete the Firebase project or disable the deployed services.
If you have created a new project to test this app, follow these steps to delete the project through the Firebase console.
Alternatively, if you followed the steps to deploy Cloud Firestore, Functions and Cloud Storage for Firebase to an existing project, follow these steps to remove them manually through the console:
- Delete data from Cloud Firestore
- Delete Cloud Functions
- Delete Cloud Storage
- Delete Cloud Run services
This app is not an officially supported Google Product.