Skip to main content
The 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:
Jobs survive worker restarts: ingestion resumes from the last checkpoint instead of starting over.

Checking Processing Status

Statuses:
  • Processing - Documents being embedded
  • Ready - All documents processed
  • Error - Some documents failed

Listing Documents

Removing Documents

Removing a document is permanent and cannot be undone!
Test your knowledge base with semantic search:
Search Features:
  • Semantic similarity (not just keyword matching)
  • Ranked by relevance score (0-1)
  • Shows source document
  • Returns top relevant chunks

Deleting Knowledge Base

Deleting a knowledge base removes all documents and embeddings permanently!

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

  1. Upload - File sent to server
  2. Parse - Content extracted (text from PDF, DOCX, etc.)
  3. Chunk - Split into manageable pieces (~500 tokens)
  4. Embed - Generate vector embeddings
  5. Index - Store in vector database
  6. 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

Solution: Use a different name or delete the existing KB:

Upload Failed

Possible causes:
  • File format not supported
  • File too large (>50 MB)
  • Network connection issues
Solution:
  • Check file format (PDF, TXT, MD, DOCX only)
  • Split large files
  • Retry upload

Documents Stuck in Processing

Solution:
  • Check document format and content
  • Contact support if issue persists
  • Remove and re-upload problematic documents

Poor Search Results

If search quality is low:
  1. Add more documents - More context improves results
  2. Use larger embedding model - Better semantic understanding
  3. Improve document quality - Clear, well-structured content
  4. 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