Skip to main content

Build an FAQ Chatbot

Learning Path

Level 2, Step 2.4 β€” Learning Path. Prerequisites: Basic RAG.

This is the perfect first project β€” a chatbot that answers questions based on your company's FAQ document. It's simple to build, immediately useful, and teaches you the fundamentals of RAG (Retrieval-Augmented Generation).

What You'll Build​

A chatbot that:

  • Answers questions based on your FAQ document
  • Cites which section the answer came from
  • Politely handles questions it can't answer
  • Can be embedded on your website

Step 1: Prepare Your FAQ Document​

Create a text or PDF file with your FAQs. Here's an example format that works well:

## Shipping

Q: How long does shipping take?
A: Standard shipping takes 5-7 business days. Express shipping takes 2-3 business days.

Q: Do you offer free shipping?
A: Yes! Free standard shipping on all orders over $50.

Q: Do you ship internationally?
A: We currently ship to the US, Canada, and UK.

## Returns

Q: What is your return policy?
A: We accept returns within 30 days of delivery for unused items in original packaging.

Q: How do I start a return?
A: Email returns@example.com with your order number and reason for return.

## Account

Q: How do I reset my password?
A: Click "Forgot Password" on the login page and follow the email instructions.
tip

The better organized your FAQ document is, the better your chatbot will perform. Use clear headings and keep answers concise.

Step 2: Create a Document Store​

  1. Go to Document Stores β†’ + Add New
  2. Name it "Company FAQ"
  3. Click into the store β†’ + Add Document Loader
  4. Choose PDF File (or Text File depending on your format)
  5. Upload your FAQ document
  6. Text Splitter: Recursive Character Text Splitter
    • Chunk Size: 1000
    • Chunk Overlap: 200
  7. Click Preview to check the chunks look good
  8. Click Process

Step 3: Upsert to Vector Store​

  1. Click the Upsert configuration
  2. Embeddings: OpenAI Embeddings (select your credential)
  3. Vector Store: In-Memory Vector Store (for testing) or Pinecone/Qdrant (for production)
  4. Click Upsert
  5. Test with the Retrieval Query button: try "shipping time" and verify relevant chunks are returned

Step 4: Build the Agentflow​

  1. Go to Agentflows β†’ + Add New
  2. Name it "FAQ Chatbot"

Configure the Start Node​

  • Input Type: Chat Input

Add an Agent Node​

  1. Drag an Agent node and connect it to Start
  2. Model: ChatOpenAI β†’ gpt-4o-mini
  3. System Message:
You are a helpful FAQ assistant for our company. Your job is to answer customer questions using ONLY the information from the knowledge base provided.

Rules:
1. Only answer questions based on the FAQ knowledge base
2. If the answer isn't in the knowledge base, say: "I don't have information about that in our FAQ. Please contact our support team at support@example.com for help."
3. Keep answers concise and friendly
4. If a question is ambiguous, ask for clarification
  1. Knowledge (Document Stores): Add your "Company FAQ" store
  2. Description: "Contains frequently asked questions about shipping, returns, account management, and product information"

Save and Test​

Try these questions:

  • "How long does shipping take?" βœ… Should answer from FAQ
  • "What's the meaning of life?" ❌ Should politely decline
  • "Can I return something after 30 days?" βœ… Should reference return policy

Step 5: Embed on Your Website​

  1. Click the Embed button in the top bar
  2. Copy the embed code
  3. Customize with starter prompts:
<script type="module">
import Chatbot from 'https://cdn.jsdelivr.net/npm/ciniterflow-embed/dist/web.js';
Chatbot.init({
chatflowid: 'your-flow-id',
apiHost: 'https://flow.ciniter.com',
theme: {
chatWindow: {
title: 'FAQ Assistant',
welcomeMessage: 'Hi! πŸ‘‹ I can help answer your questions. What would you like to know?',
starterPrompts: [
'What is your return policy?',
'How long does shipping take?',
'How do I reset my password?'
],
}
}
})
</script>

Tips for a Great FAQ Bot​

  1. Keep your FAQ document updated β€” re-upsert whenever you add new questions
  2. Monitor unanswered questions β€” check Executions for questions the bot couldn't answer, then add them to your FAQ
  3. Use small chunk sizes β€” FAQ answers are usually short, so 500-1000 character chunks work best
  4. Add metadata β€” tag chunks by category (shipping, returns, etc.) for better filtering

Taking It Further​

  • Add a feedback mechanism so users can rate answers
  • Connect to a live chat system for escalation when the bot can't help
  • Add multiple languages by creating separate Document Stores for each language
  • Use Evaluations to test the bot against a set of known Q&A pairs