Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Knowledge Base

The Knowledge Base (KB) system enables semantic search and document retrieval for intelligent bot responses.

Quick Overview

FeatureDescription
StorageS3-compatible drive + PostgreSQL metadata + Qdrant vectors
SearchHybrid (semantic + keyword) with optional reranking
FormatsPDF, DOCX, TXT, MD, HTML, CSV, JSON
IntegrationAutomatic context injection into LLM responses

Basic Usage

' Load knowledge base
USE KB "policies"

' Bot now answers questions using that knowledge
' No explicit search needed - it's automatic

Key Capabilities

  • Semantic Search - Find content by meaning, not just keywords
  • Multi-Collection - Organize documents into focused collections
  • Auto-Indexing - Documents indexed automatically when added
  • Hybrid Search - Combines dense (semantic) and sparse (BM25) retrieval
  • Context Management - Relevant chunks injected into LLM prompts

Document Organization

bot.gbkb/
├── policies/      → USE KB "policies"
├── products/      → USE KB "products"
└── support/       → USE KB "support"

Configuration

Key settings in config.csv:

name,value
rag-hybrid-enabled,true
rag-dense-weight,0.7
rag-sparse-weight,0.3
rag-top-k,10

Performance Tips

  1. Organize collections by topic for precise activation
  2. Clear unused KBs to free memory: CLEAR KB "old-docs"
  3. Enable caching for repeated queries
  4. Tune weights based on content type (technical vs conversational)

Learn More