FinalDocFinalDoc
Pricing
AI & Documentation

Building a Knowledge Base Chatbot That Actually Works

March 5, 2026 · 7 min read

Building a Knowledge Base Chatbot That Actually Works

Everyone wants a chatbot on their help center. Few get it right.

The typical approach: point ChatGPT at your documentation and hope for the best. The result: a chatbot that confidently answers questions with information that's wrong, outdated, or completely fabricated. Your customers get bad answers. Your support team gets more tickets, not fewer.

The problem isn't AI. It's how you use AI. The difference between a chatbot that works and one that embarrasses you comes down to one technique: Retrieval-Augmented Generation (RAG).

Generic AI vs. RAG

Generic AI (The Wrong Way)

Feed your entire documentation into a system prompt. Let the AI answer based on what it "remembers." This fails because:

RAG (The Right Way)

When a user asks a question, RAG does two things:

  1. Retrieval — searches your knowledge base for the most relevant article chunks using semantic search (vector embeddings)
  2. Generation — sends the user's question + the retrieved chunks to the AI, which generates an answer grounded in your actual documentation

The key difference: the AI only answers based on content it was given, not content it "knows." If your docs don't cover the topic, the AI says so instead of hallucinating.

RAG turns your chatbot from a creative fiction writer into a research assistant that always cites its sources.

How FinalDoc's Reader Chatbot Works

Step 1: Embedding Your Articles

When you publish an article, FinalDoc breaks it into chunks (typically 500-1000 tokens each) and generates a vector embedding for each chunk using OpenAI's text-embedding-3-small model (1536 dimensions). These embeddings are stored in PostgreSQL with pgvector.

Think of embeddings as coordinates in meaning-space. "How do I reset my password?" and "Password recovery steps" are far apart as strings but close together as embeddings, because they mean the same thing.

Step 2: Semantic Search

When a reader asks a question, the chatbot converts the question into an embedding and searches for the nearest article chunks. This is semantic search — it finds content by meaning, not keywords.

FinalDoc uses a hybrid approach: semantic search (pgvector cosine similarity) combined with keyword search (PostgreSQL full-text search with pg_trgm fuzzy matching). The hybrid approach catches both conceptual matches and exact term matches.

Step 3: Grounded Generation

The top 5-8 relevant chunks are passed to GPT-4o-mini along with the user's question. The prompt instructs the AI to:

Step 4: Source Citations

Every chatbot response includes clickable links to the source articles. The reader can verify the answer, read the full article, or explore related content. This builds trust — the chatbot isn't a black box.

Beyond Text: Voice Mode

Some readers prefer to speak rather than type. FinalDoc's Voice Mode extends the chatbot to real-time voice conversations:

Voice Mode uses the same RAG pipeline as the text chatbot. The retrieval and grounding are identical — only the input/output modality changes.

Deployment Options

Public Knowledge Base

The chatbot appears as a floating capsule button on your public KB portal. Readers click to chat. The capsule has a split design — Chat on one side, Voice on the other, with an animated cosmic orb in the center.

Help Widget

Embed the chatbot in your own website or application via the Help Widget. The widget loads your KB content and provides the same RAG-powered Q&A in your own UI.

Multi-Channel (OpenClaw AI Agent)

Deploy the chatbot on WhatsApp, Telegram, Discord, and web chat. The OpenClaw AI Agent integration handles channel-specific formatting while using the same RAG backend.

Microsoft Teams

Add FinalDoc as a Teams outgoing webhook. Team members @mention the bot and get answers from your internal knowledge base — no switching apps.

Measuring Effectiveness

A chatbot is only useful if it actually helps. Track these metrics:

FinalDoc's Analytics dashboard tracks all of these. The Feedback inbox collects chatbot interactions where users indicated the answer wasn't helpful, so your team can improve the underlying articles.

Getting Started

The Reader Chatbot is available on Starter plans and above. To enable it:

  1. Go to Settings → Portal Builder
  2. Toggle "Enable AI Chatbot" on
  3. Choose your chatbot appearance (capsule, minimal, or custom)
  4. Publish — the chatbot appears on your public KB immediately

Your articles are automatically embedded when published. No additional setup required. The chatbot starts answering questions from day one.

← Back to Blog