CORNER CAFE

HOW THE CAFE THINKS

You talk. A program turns your words into text, an AI decides what to do, small tools change your order, and the answer comes back as speech. Here is every step, with pictures.

1THE BIG PICTURE

Three ways in, one brain in the middle. The red dots are your words travelling. Click any box.

2INSIDE THE BRAIN

The brain is a small flowchart (built with LangGraph). Every time you speak, it starts at START and follows the arrows until END.

RULE 1 · 6 TRIES MAXThe AI can use tools at most 6 times per thing you say. Then it must answer. Stops it from going round in circles.
RULE 2 · CONFIRM FIRSTIf your order changed in this turn, it can't be placed yet. You always hear the final order and say yes first.
RULE 3 · ONLY FINAL WORDSThe AI sometimes "thinks out loud" while using tools. Only its final answer is spoken, so it doesn't ramble.

3THE TOOLS

The AI can't touch your order directly. It can only ask for one of these three tools, which are plain Python code that always does exactly the same thing. The menu and your current order are simply handed to it, so it never needs a tool just to look.

add_items

Adds everything you asked for in one go. Understands "bug" means a Bug Fix.

"two bug fixes and a hotfix"
remove_item

Takes something off your order.

"actually, no hotfix"
place_order

Saves the order and gets the next order number from the counter.

"yes, place it"

4ONE ORDER, STEP BY STEP

Press PLAY to watch a real order go through, one message at a time.

5WORDS USED HERE

AI / LLMThe language model that reads the conversation and decides what to say or which tool to use. Here: gpt-oss-120b, running on Groq.
GroqThe free service that runs the AI model for us. Free plan has a per-minute limit.
LangGraphA library for building the brain as a flowchart: boxes (steps) joined by arrows (what happens next).
ToolA small piece of normal code the AI is allowed to ask for, like "add an item". The code does the real work.
STT / TTSSpeech-to-text (your voice becomes words) and text-to-speech (words become a voice).
LiveKitThe voice system used by agent.py. Handles the microphone, speaker, and knowing when you've stopped talking.
orders.dbA small file that stores every placed order. It's why order numbers keep counting up.
SessionOne customer's visit. Each tab gets its own order and conversation, so customers never mix.