MCPcopy Create free account
hub / github.com/FirebaseExtended/solution-ai-barista

github.com/FirebaseExtended/solution-ai-barista @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
102 symbols 242 edges 54 files ⚖ Apache-2.0 17 documented · 17% updated 2mo ago★ 451 open issues

Browse by type

Functions 67 Types & classes 35
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

AI Barista: Agent-powered Barista App

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.

Try it out today

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.

<img
  height="32"
  alt="Try in Firebase Studio"
  src="https://cdn.firebasestudio.dev/btn/try_blue_32.svg">

Prerequisites

  1. A new Firebase project
  2. 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.
  3. Activate billing on your Google Cloud / Firebase Project
  4. Enable the Anonymous authentication sign-in method for your project.
  5. You may chose to upgrade your project and enable automatic clean-up of old accounts.
  6. Create a default Firestore database by navigating to Firestore in the console.
  7. 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.

Getting started in Firebase Studio

  1. Open the project in Firebase Studio.
  2. When prompted, select your Firebase project.
  3. Log into Firebase Hosting. Navigate to the "Firebase Studio" screen and select "Authenticate". Follow the prompts in the terminal.
  4. Prepare your Firebase project by setting up security rules, TTL configuration and functions for cleaning up data:
  5. Select a Firebase project: firebase use.
  6. Deploy Firestore, Storage and Functions: firebase deploy --only firestore,storage,functions
  7. Follow any additional prompts to set up access and grant permissions.
  8. You may need to grant the Logs Writer permission.
  9. Configure Firebase for the Angular frontend app.
  10. Navigate to the Firebase console, create a new web client and donwload the configuration file for your project.
  11. Add the configuration into the file client/web/angular-customer-app/src/environments/environment.development.ts.
  12. The app is now ready! Switch to the Web Preview to see it in action.

Getting started locally

You can run the application locally and access Firebase and Google Cloud directly.

Local Prerequisites

  1. Set up the Google Cloud SDK.
  2. Set up the Firebase CLI.
  3. 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.

Demo and code overview

This project consists of two main parts:

Two additional systems provide some additional services:

Demo walkthrough and examples

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.

Orders

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.

Updating orders

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.

Order submission and status check

What's my order?
Submit my order

Deploying the app

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.

Delete and clean up deployed services

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

Additional Information

This app is not an officially supported Google Product.

Extension points exported contracts — how you extend this code

browse all types & interfaces →

Core symbols most depended-on inside this repo

browse all functions →

Shape

Method 47
Class 26
Function 20
Interface 9

Languages

TypeScript100%

Modules by API surface

client/web/angular-customer-app/src/app/chatbot/chatbot.component.ts12 symbols
client/web/angular-customer-app/src/app/services/chat.service.ts10 symbols
services/cloud-run/src/ai/agentSessionManager.ts9 symbols
services/cloud-run/src/firestore/sessionStore.ts8 symbols
client/web/angular-customer-app/src/app/services/login.service.ts7 symbols
services/cloud-run/src/utils/utils.ts6 symbols
client/web/angular-customer-app/src/app/services/coffee.service.ts6 symbols
services/cloud-run/src/firestore/submittedOrderStore.ts4 symbols
client/web/angular-customer-app/src/app/chatbot/order-dialog/order-dialog.component.ts4 symbols
services/cloud-run/src/types/ChatResponse.ts3 symbols
services/cloud-run/src/types/ChatError.ts3 symbols
services/cloud-run/src/ai/agents/utils/agentUtils.ts3 symbols

For agents

$ claude mcp add solution-ai-barista \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page