Customer support chatbot with tools
A support bot for a demo shop that answers FAQs from a knowledge base and looks up real order status through tools.
What you'll learn
- âTool use / function calling
- âCombining RAG with actions
- âGuardrails: never act without confirmation
What you'll build
- âAnswers policy questions from FAQ docs
- âLooks up an order by ID (tool)
- âHands over to a human when unsure
- âConversation log for review
Step-by-step guide
- 1
Demo data
A small SQLite database of orders and a folder of FAQ markdown files.
- 2
Knowledge base
Embed FAQ chunks for retrieval (see the RAG project).
- 3
Define tools
get_order_status(order_id) and create_support_ticket(summary) described with JSON schemas.
- 4
Agent loop
Send messages + tools to the model; when it asks to call a tool, run it, return the result, continue until a final answer.
- 5
Guardrails
Validate tool inputs; the bot can read order status but must ask the user to confirm before creating a ticket; never reveal other customers' data.
- 6
Escalation
If confidence is low or the user is upset, create a ticket and say a human will reply.
- 7
Test
A list of 30 test conversations including tricky ones (wrong order ID, prompt injection attempts in user text).
đ Make it stand out
- +WhatsApp or web widget front end
- +Analytics of common questions
- +Multilingual replies