rf kb command provides complete knowledge base (vector store) management for RAG applications. Upload documents, perform semantic search, check processing status, and manage your knowledge bases.
Commands Overview
Listing Knowledge Bases
Creating Knowledge Base
Interactive Mode
Non-Interactive Mode
Perfect for scripts and automation:Options
Uploading Documents
Upload Single File
Since CLI
0.3.22, uploads use the platform’s async ingestion pipeline: the file is accepted immediately and embedded in the background with batched embeddings and checkpoint resume; the CLI shows live chunk progress until the job completes. Large files (50k+ row CSV catalogs) no longer time out. Against an older self-hosted API without the async endpoint, the CLI falls back to the legacy synchronous upload automatically.Upload Directory
Supported File Types
- PDF (
.pdf) - Text (
.txt) - Markdown (
.md) - Word Documents (
.docx) - CSV (
.csv) — ingested one document per row (great for product catalogs) - JSON (
.json)
Files are automatically parsed, chunked, and embedded for semantic search.
Ingestion Jobs
Every upload creates an ingestion job you can inspect at any time:Checking Processing Status
- Processing - Documents being embedded
- Ready - All documents processed
- Error - Some documents failed
Listing Documents
Removing Documents
Semantic Search
Test your knowledge base with semantic search:- Semantic similarity (not just keyword matching)
- Ranked by relevance score (0-1)
- Shows source document
- Returns top relevant chunks
Deleting Knowledge Base
Complete Workflow Example
Using with RAG Agents
Creating RAG Agent with Knowledge Base
Agent Configuration
Your agent code will reference the knowledge base:Automation & Scripts
Bulk Upload Script
Multi-KB Setup
Best Practices
1. Organize Documents by Domain
2. Keep Documents Updated
3. Test Before Production
4. Choose Appropriate Embedding Model
5. Monitor Processing Status
Document Processing
How It Works
- Upload - File sent to server
- Parse - Content extracted (text from PDF, DOCX, etc.)
- Chunk - Split into manageable pieces (~500 tokens)
- Embed - Generate vector embeddings
- Index - Store in vector database
- Ready - Available for search
Processing Time
- Small files (<1 MB): ~5-10 seconds
- Medium files (1-10 MB): ~30-60 seconds
- Large files (>10 MB): ~2-5 minutes
- Directories: Depends on total size and file count
Chunking Strategy
Documents are automatically chunked with:- Chunk size: ~500 tokens (~375 words)
- Overlap: 50 tokens (for context continuity)
- Smart splitting: Respects paragraph boundaries
Troubleshooting
KB Already Exists
Upload Failed
- File format not supported
- File too large (>50 MB)
- Network connection issues
- Check file format (PDF, TXT, MD, DOCX only)
- Split large files
- Retry upload
Documents Stuck in Processing
- Check document format and content
- Contact support if issue persists
- Remove and re-upload problematic documents
Poor Search Results
If search quality is low:- Add more documents - More context improves results
- Use larger embedding model - Better semantic understanding
- Improve document quality - Clear, well-structured content
- Test queries - Refine search terms
Advanced Usage
Environment-Specific KBs
Backup and Restore
Next Steps
Create RAG Agent
Create agent with knowledge base
Test Locally
Test KB integration locally
Prompts
Create RAG-specific prompts
Knowledge & RAG
Learn more about RAG concepts