Telegram agent, 2026
Bunn Cafe AI Assistant
A Telegram assistant that sells coffee, books workshops and answers policy questions for a specialty-coffee shop.
- What it does for a business
- Sales, bookings and support in one chat, with every order written to the database before the customer hears "confirmed".
- Built with
- n8n, OpenAI, PostgreSQL, pgvector, Airtable, Notion, Gmail, Telegram
- Source
- View the code on GitHub

The coordinator and its three specialists, each with its own tools.
The problem
A small coffee shop gets the same questions all day: what is in stock, how much 100 grams costs, whether a workshop can be moved. Every answer depends on live prices and the current policy, and an order that is "confirmed" in chat but never reaches the kitchen is worse than no bot at all.
What I built
Customers write, send a voice note or a photo of a coffee bag. The assistant shows the menu with live prices and stock, takes pickup and delivery orders, books workshops and courses, and hands difficult cases to staff.
Four cooperating agents: a GPT-4.1 coordinator that talks to the customer and three GPT-5-mini specialists for products, orders and training.
Fourteen n8n workflows. The agents choose what to do. Prices, stock and confirmations are handled by code and SQL.
How a message moves through it
Step 1
Customer
Text, voice or photo in Telegram
Step 2
Telegram adapter
Whisper turns voice into text; photos become label facts
Step 3
Coordinator agent
Understands the request and picks a specialist
Step 4
Specialists
Products, orders, training and bookings
Step 5
Tool workflows
Catalog, pricing, orders, knowledge search, support
Step 6
PostgreSQL
Orders, stock and bookings committed in one transaction
Step 7
Staff email
Sent through an outbox with retries
One tested order
Redrawn from the tested demo order. Replies are shortened; prices and steps are the ones recorded in the run.
Bunn Cafe
bot
- PhotoPhoto of a bag of Guatemala Huehuetenango
- Guatemala Huehuetenango is sold out right now. Two in stock: Colombia Huila, EGP 340 for 250 g, and Brazil Cerrado, EGP 300 for 250 g.
- Voice note"100 grams of the second one, ground for a moka pot, delivered to Nasr City."
- Brazil Cerrado, 100 g, moka pot grind: EGP 135. Delivery to Nasr City: EGP 45. What is the delivery address?
- (address, hidden in the test record)
- Here is your draft: EGP 180 in total, pay on delivery. Shall I confirm it?
- Yes
- Confirmed. Your order reference is BN-ORD-… and the shop has been asked to prepare it.
Decisions that keep it reliable
Prices are read at the moment they are needed
The owner edits prices in Airtable. A change is live on the next message, with no redeploy. Confirmed orders keep a snapshot of the agreed price, so history never changes.
Policies come from versioned Notion pages
Guides are split by heading, embedded into pgvector as a staging version and switched live in one step. The clause the bot quotes and the rule the booking tool enforces always come from the same version.
"Yes" is checked by the database
Confirming an order checks ownership, the current draft, that the yes came after the draft, and live prices, then locks stock, writes the order and queues the staff email, all or nothing.
The last seat goes to one person
When two customers confirm the last workshop seat at the same moment, the slot row is locked. The first wins; the second gets the nearest alternative. Duplicate Telegram messages are ignored by a unique key.
Screens from the build




What was tested
- Photo of a sold-out coffee, then a voice note ordering 100 g of an alternative for delivery: priced at EGP 135 + 45 delivery, stock reduced by 100 g, one email to staff.
- Policy changed from 24 h to 48 h in Notion and a price raised in Airtable: the next answers used the new rules, while an old order kept its original price.
- Two customers racing for the last seat, a duplicated Telegram update and an email outage: one booking, no duplicates, email retried.
- 64 database tests passing on the final schema.
Limits
A demo shop with fictional data, English only, Telegram only, pay on pickup or delivery. No production traffic is claimed.
Next project
WhatsApp AI Personal Agent
Want something like this for your business?