Restaurant Ordering & Table Booking
Let diners browse your menu, filter by dietary needs, book a table, or place a takeout order — with upsell prompts baked into the flow.
What you'll build
An agent that handles diner interactions end to end: menu questions, dietary filtering, table reservations checked against Google Calendar, and takeout orders with upsell prompts at the point of order.
Prerequisites
- BimpeAI account with an API key (
sk_…) - Read Anatomy of a workflow agent first — this recipe skips steps covered there
- Google Calendar connected in the Console dashboard (see Step 4)
Steps
1. Find the workflow
import { BimpeAI } from "@bimpeai/sdk";
const bimpe = new BimpeAI({ apiKey: process.env.BIMPEAI_API_KEY! });
const page = await bimpe.workflows.list({ scope: "public", search: "restaurant" });
const workflow = page.data[0];
console.log(workflow.id, workflow.name);import os
from bimpeai import BimpeAI
client = BimpeAI(api_key=os.environ["BIMPEAI_API_KEY"])
page = client.workflows.list(scope="public", search="restaurant")
workflow = page.data[0]
print(workflow.id, workflow.name)2. Create the agent
const agent = await bimpe.agents.create(
{
name: "Restaurant assistant",
system_prompt:
"You help guests browse the menu, check dietary options, book tables, and place takeout orders. " +
"When a guest places an order, always offer a complementary side or dessert.",
agent_workflow_id: workflow.id,
},
{ idempotencyKey: "create-restaurant-agent-v1" },
);
console.log(agent.id);agent = client.agents.create(
name="Restaurant assistant",
system_prompt=(
"You help guests browse the menu, check dietary options, book tables, "
"and place takeout orders. "
"When a guest places an order, always offer a complementary side or dessert."
),
agent_workflow_id=workflow.id,
idempotency_key="create-restaurant-agent-v1",
)
print(agent.id)3. Add knowledge bases
Add the menu and booking policy so the agent can answer accurately without hallucinating prices or dietary details.
// Menu with dietary flags
await bimpe.agents.knowledgeBases.create(agent.id, {
type: "text",
name: "Menu",
content:
"Starters:\n" +
" Bruschetta — £6.50 — vegan, gluten-free option available\n" +
" Chicken wings — £8.00 — contains gluten\n" +
"Mains:\n" +
" Margherita pizza — £12.00 — vegetarian\n" +
" Pasta arrabbiata — £10.50 — vegan, contains gluten\n" +
" Grilled salmon — £16.00 — gluten-free\n" +
"Desserts:\n" +
" Tiramisu — £6.00 — contains dairy, gluten\n" +
" Sorbet — £4.50 — vegan, gluten-free",
});
// Booking policy
await bimpe.agents.knowledgeBases.create(agent.id, {
type: "text",
name: "Booking policy",
content:
"Tables available Tuesday to Sunday, 12:00–22:00.\n" +
"Maximum party size: 12. Groups over 8 require a £10 per head deposit.\n" +
"Cancellations must be made 24 hours in advance.",
});# Menu with dietary flags
client.agents.knowledge_bases.create(agent.id, {
"type": "text",
"name": "Menu",
"content": (
"Starters:\n"
" Bruschetta — £6.50 — vegan, gluten-free option available\n"
" Chicken wings — £8.00 — contains gluten\n"
"Mains:\n"
" Margherita pizza — £12.00 — vegetarian\n"
" Pasta arrabbiata — £10.50 — vegan, contains gluten\n"
" Grilled salmon — £16.00 — gluten-free\n"
"Desserts:\n"
" Tiramisu — £6.00 — contains dairy, gluten\n"
" Sorbet — £4.50 — vegan, gluten-free"
),
})
# Booking policy
client.agents.knowledge_bases.create(agent.id, {
"type": "text",
"name": "Booking policy",
"content": (
"Tables available Tuesday to Sunday, 12:00–22:00.\n"
"Maximum party size: 12. Groups over 8 require a £10 per head deposit.\n"
"Cancellations must be made 24 hours in advance."
),
})4. Connect channels and integrations (dashboard)
Google Calendar and channels are configured in the dashboard
The API cannot create integrations or channel connections. Connect Google Calendar and your messaging channels in the Console dashboard. The SDK lets you list what is active but cannot modify the connections.
- Open Console dashboard → Agents → select your agent.
- Under Channels, connect your WhatsApp Business number.
- Under Channels, enable the web chat widget and paste the embed snippet into your restaurant website.
- Under Integrations, connect Google Calendar. The agent uses it to check table availability in real time.
5. Go live
Once channels are connected, the agent is ready to handle diners. Verify the integration is connected before opening for service:
const integrations = await bimpe.agents.integrations.list(agent.id);
console.log("Integrations:", integrations.map((i) => i.name));integrations = client.agents.integrations.list(agent.id)
print("Integrations:", [i.name for i in integrations])Full example
import { BimpeAI } from "@bimpeai/sdk";
const bimpe = new BimpeAI({ apiKey: process.env.BIMPEAI_API_KEY! });
// 1. Find workflow
const page = await bimpe.workflows.list({ scope: "public", search: "restaurant" });
const workflow = page.data[0];
// 2. Create agent
const agent = await bimpe.agents.create(
{
name: "Restaurant assistant",
system_prompt:
"You help guests browse the menu, check dietary options, book tables, and place takeout orders. " +
"When a guest places an order, always offer a complementary side or dessert.",
agent_workflow_id: workflow.id,
},
{ idempotencyKey: "create-restaurant-agent-v1" },
);
// 3. Add knowledge bases
await bimpe.agents.knowledgeBases.create(agent.id, {
type: "text",
name: "Menu",
content:
"Margherita pizza — £12.00 — vegetarian\n" +
"Pasta arrabbiata — £10.50 — vegan, contains gluten\n" +
"Tiramisu — £6.00 — contains dairy, gluten",
});
await bimpe.agents.knowledgeBases.create(agent.id, {
type: "text",
name: "Booking policy",
content:
"Tables available Tuesday to Sunday, 12:00–22:00.\n" +
"Maximum party size: 12.",
});
// 4. Verify integrations (connected via dashboard)
const integrations = await bimpe.agents.integrations.list(agent.id);
console.log("Agent ID:", agent.id);
console.log("Integrations:", integrations.map((i) => i.name));
// 5. Stream incoming web chat conversations
const controller = new AbortController();
for await (const event of bimpe.conversations.messages.stream(
agent.id,
"<conversation_id>",
{ signal: controller.signal },
)) {
console.log(event.role, event.message);
}import os
from bimpeai import BimpeAI
client = BimpeAI(api_key=os.environ["BIMPEAI_API_KEY"])
# 1. Find workflow
page = client.workflows.list(scope="public", search="restaurant")
workflow = page.data[0]
# 2. Create agent
agent = client.agents.create(
name="Restaurant assistant",
system_prompt=(
"You help guests browse the menu, check dietary options, book tables, "
"and place takeout orders. "
"When a guest places an order, always offer a complementary side or dessert."
),
agent_workflow_id=workflow.id,
idempotency_key="create-restaurant-agent-v1",
)
# 3. Add knowledge bases
client.agents.knowledge_bases.create(agent.id, {
"type": "text",
"name": "Menu",
"content": (
"Margherita pizza — £12.00 — vegetarian\n"
"Pasta arrabbiata — £10.50 — vegan, contains gluten\n"
"Tiramisu — £6.00 — contains dairy, gluten"
),
})
client.agents.knowledge_bases.create(agent.id, {
"type": "text",
"name": "Booking policy",
"content": "Tables available Tuesday to Sunday, 12:00–22:00.\nMaximum party size: 12.",
})
# 4. Verify integrations (connected via dashboard)
integrations = client.agents.integrations.list(agent.id)
print("Agent ID:", agent.id)
print("Integrations:", [i.name for i in integrations])
# 5. Stream incoming web chat conversations
for event in client.conversations.messages.stream(agent.id, "<conversation_id>"):
print(event.role, event.message)Deploy
Store your API key in BIMPEAI_API_KEY. Update the menu knowledge base whenever the menu changes — call knowledgeBases.update with the new content so the agent stays accurate. Use a stable idempotencyKey to prevent duplicate agents on redeploy.
Variations
- Add a daily specials knowledge base entry and update it each morning via a scheduled script.
- Strengthen upselling by listing pairing suggestions for each main dish in the menu KB.
- Add a loyalty programme text entry so the agent can explain points accrual and redemption.
Product Recommendation Agent
Deliver personalised product suggestions through web chat or WhatsApp by grounding the agent in your product catalogue knowledge base.
Returns & Refund Processing Agent
Handle return requests, check eligibility against your order management system, track refund status, and schedule replacements.