Knowledge Base π‘ BETA
The Knowledge Base (KB) system enables semantic search and document retrieval for intelligent bot responses.
Quick Overview
| Feature | Description |
|---|---|
| Storage | S3-compatible drive + PostgreSQL metadata + Qdrant vectors |
| Search | Dense vector search, optionally fused with keyword matching β chosen per bot by rag-mode |
| Formats | PDF, DOCX, DOC, XLSX, XLS, ODS, PPTX, PPT, ODP, EPUB, ODT, TXT, MD, HTML, CSV, JSON, YAML, TOML, and 30+ text-based formats |
| Integration | Automatic 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) retrieval with term matching, fused by Reciprocal Rank Fusion
- 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
Retrieval strategy is one per-bot setting:
name,value
rag-mode,hybrid
rag-mode accepts standard, hybrid, corrective, graph, agentic or
multimodal, and defaults to standard. It is read from the botβs configuration
row (environment fallback RAG_MODE), not from config.csv. The older
rag-hybrid-enabled / rag-dense-weight / rag-sparse-weight keys are read only
by an unconnected crate and have no effect β see
Retrieval and RAG.
Performance Tips
- Organize collections by topic for precise activation
- Clear unused KBs to free memory:
CLEAR KB "old-docs" - Enable caching for repeated queries
- Tune weights based on content type (technical vs conversational)
Learn More
- KB System Architecture - Technical deep dive
- Retrieval and RAG - How retrieval works
- Document Indexing - Processing pipeline
- Retrieval and RAG - The
rag-modesetting and the six retrieval modes - USE KB Keyword - Complete reference
- .gbkb Package - Folder structure