UI Guide
Web-based interface for RAG-lite TS - Visual ingestion and search
Complete guide to using the RAG-lite TS web interface for document ingestion and semantic search through your browser.
Table of Contents
- Introduction
- Installation & Setup
- Quick Start
- Ingestion Tab
- Search Tab
- Advanced Features
- Comparison: UI vs CLI
- Troubleshooting
Introduction
The RAG-lite TS UI provides a modern web-based interface for managing your semantic search knowledge base. It offers the same powerful features as the CLI but with a visual, interactive experience.
What is the UI?
The UI consists of two main components:
- Frontend: React-based web interface (Vite + TypeScript)
- Backend: Express API server that interfaces with the RAG-lite TS core library
Both components run locally on your machine - your data never leaves your computer.
When to Use UI vs CLI
Use the UI when:
- You prefer visual interfaces over command-line
- You want to see real-time ingestion progress
- You need to upload files interactively
- You want to search with image uploads
- You're exploring or learning the system
Use the CLI when:
- You're scripting or automating workflows
- You need batch processing
- You're working in headless environments
- You prefer terminal-based workflows
- You're integrating with other tools
Architecture Overview
┌─────────────────┐
│ Browser │
│ (Frontend) │
└────────┬────────┘
│ HTTP
▼
┌─────────────────┐
│ Express API │
│ (Backend) │
└────────┬────────┘
│
▼
┌─────────────────┐
│ RAG-lite TS │
│ Core Library │
└─────────────────┘
The UI backend uses the same core library as the CLI, ensuring feature parity and consistent behavior.
Installation & Setup
Prerequisites
- Node.js 18+ installed
- RAG-lite TS installed globally:
npm install -g rag-lite-ts - Modern web browser (Chrome, Firefox, Edge, Safari)
Starting the UI
Simply run:
raglite ui
This command:
- Starts the backend API server (default: port 3001)
- Starts the frontend dev server (default: port 3000)
- Opens your browser automatically (if configured)
Port Configuration
By default:
- Frontend:
http://localhost:3000 - Backend API:
http://localhost:3001
If ports are in use, the UI will attempt to use alternative ports or show an error.
First-Time Setup
-
Launch the UI:
raglite ui -
Wait for servers to start: You'll see output like:
🚀 Launching RAG-lite TS UI...
📡 Starting backend on port 3001...
🎨 Starting frontend on port 3000...
✨ UI Access:
Frontend: http://localhost:3000
Backend: http://localhost:3001 -
Open in browser: Navigate to
http://localhost:3000(or the URL shown) -
Start ingesting: Go to the "Ingest" tab and upload your first documents
Working Directory
The UI uses the current working directory where you run raglite ui as the base for:
- Database file:
db.sqlite(orRAG_DB_FILEenv var) - Index file:
vector-index.bin(orRAG_INDEX_FILEenv var)
Tip: Run raglite ui from the directory where you want your knowledge base files.
Quick Start
1. Launch the UI
cd /path/to/your/documents
raglite ui
2. Ingest Your First Document
- Click the "Ingest" tab
- Drag and drop a file (or click to select)
- Configure options (or use defaults):
- Mode: Text (for documents) or Multimodal (for text + images)
- Model: Choose based on your needs
- Click "Start Ingestion"
- Watch real-time progress
3. Perform Your First Search
- Click the "Search" tab
- Type your query in the search box
- Click "Search" or press Enter
- View results with relevance scores
4. View Knowledge Base Stats
The Knowledge Base Stats card shows:
- Total documents and chunks
- Current model and dimensions
- Reranking status
- Content type distribution
- Database and index file locations
Ingestion Tab
The Ingestion tab provides a visual interface for adding documents to your knowledge base.
File Upload
Drag & Drop Interface
- Drag files onto the upload area
- Or click to open file picker
- Or select folder using the folder button
Supported file types:
- Text Mode:
.md,.txt,.mdx,.pdf,.docx - Multimodal Mode: All text types +
.jpg,.jpeg,.png,.gif,.webp,.bmp
Folder Upload
The UI supports uploading entire folder structures:
- Click the folder icon button
- Select a directory
- All supported files in the directory (and subdirectories) will be processed
- Folder structure is preserved in relative paths
Progress Tracking
During ingestion, you'll see:
- Real-time progress: Documents processed, chunks created, embeddings generated
- Current file: Which file is being processed
- Errors: Any files that failed to process
- Time elapsed: Total processing time
Configuration Options
Basic Configuration
Processing Mode:
- Text: Optimized for text-only documents (faster, smaller models)
- Multimodal: Enables image processing and cross-modal search (CLIP models)
Embedding Model:
- Text Mode Models:
sentence-transformers/all-MiniLM-L6-v2(384D, fastest, default)Xenova/all-mpnet-base-v2(768D, higher quality)
- Multimodal Mode Models:
Xenova/clip-vit-base-patch32(512D, balanced, default)Xenova/clip-vit-base-patch16(512D, more accurate)
Advanced Configuration
Chunk Configuration:
- Chunk Size: Number of tokens per chunk (default: 250)
- Larger chunks = more context, fewer chunks
- Smaller chunks = more granular, more chunks
- Recommended: 200-300 tokens
- Chunk Overlap: Tokens shared between adjacent chunks (default: ~20% of chunk size)
- Ensures context continuity
- Recommended: ~20% of chunk size
Reranking Strategy:
- Text Mode:
cross-encoder: Uses transformer models for improved relevance (default)disabled: No reranking, vector similarity only
- Multimodal Mode:
text-derived: Converts images to text, then applies cross-encoder reranking (default)disabled: No reranking, vector similarity only
Note: Reranking strategy is set during ingestion and cannot be changed at search time. If disabled during ingestion, reranking won't be available in search.
Path Storage Strategy:
- Relative: Paths stored relative to base directory (portable across systems)
- Absolute: Paths stored as absolute paths (system-specific but explicit)
Preprocessing Options:
- MDX Processing: Extract and process JSX components from MDX files
- Mermaid Extraction: Extract and process Mermaid diagrams from markdown
Index Management:
- Force Rebuild: ⚠️ DESTRUCTIVE - Wipes database and index, rebuilds from scratch
- Use when switching models
- Use when you want a clean rebuild
- Shows confirmation dialog before proceeding
Directory Ingestion
For ingesting local directories (server-side):
- Enter the directory path in the "Local Directory" section
- Path must be accessible by the server process
- Click "Ingest Path"
- All supported files in the directory will be processed
Note: Directory ingestion uses the same configuration options as file upload.
Search Tab
The Search tab provides semantic search capabilities with support for both text and image queries.
Text Search
Basic Text Search
- Enter your query in the search box
- Click "Search" or press Enter
- Results appear below with:
- Relevance score
- Document title and source
- Content preview
- Metadata
Search Options
Reranking:
- Toggle to enable/disable reranking
- Note: Only available if reranking was enabled during ingestion
- Automatically disabled for image searches (preserves visual similarity)
Results Count (topK):
- Slider to adjust number of results (1-50)
- Default: 10 results
Content Type Filter:
- All: Search across all content types
- Text: Only text documents
- Image: Only images
Custom Paths:
- Optionally specify custom database and index paths
- Useful for working with multiple knowledge bases
Image Search
Upload Image to Search
- Click "Image Search" button
- Select an image file
- Image preview appears
- Click "Search" to find similar content
How Image Search Works
- Image-to-Image: Finds visually similar images using CLIP embeddings
- Image-to-Text: Finds text documents that match the image content
- Cross-Modal: Works in unified embedding space (CLIP)
Note: Image search requires:
- Multimodal mode was used during ingestion
- CLIP model was used (not text-only models)
Image Search Behavior
- Reranking is automatically disabled for image searches
- This preserves visual similarity (CLIP embeddings are optimized for this)
- Text-to-image searches can still use reranking if enabled
Search Results
Results are displayed with:
- Relevance Score: Higher = more relevant
- Document Title: From source file
- Source Path: File location
- Content Preview: Highlighted matching text
- Content Type Badge: Text or Image indicator
- Metadata: Additional file information
Click any result to see full content preview.
Knowledge Base Stats
The Knowledge Base Stats card shows:
- Documents: Total number of documents ingested
- Chunks: Total number of text chunks created
- Model: Current embedding model and dimensions
- Mode: Text or Multimodal
- Reranking: Whether reranking is enabled
- Created: When the knowledge base was created
- File Sizes: Database and index file sizes
- Content Types: Distribution of text vs image content
- Data Locations: Paths to database and index files
Advanced Features
Custom Database/Index Paths
You can specify custom paths for database and index files:
- Click the settings icon (⚙️) in Search tab
- Expand "Path Configuration"
- Enter custom paths:
- Database Path: Custom SQLite file location
- Index Path: Custom vector index file location
- Paths can be absolute or relative to working directory
Use cases:
- Multiple knowledge bases
- Testing with separate databases
- Custom file locations
Path Storage Strategies
Relative Paths (Default):
- Portable across systems
- Paths stored relative to base directory
- Good for: Development, portability
Absolute Paths:
- System-specific
- Explicit file locations
- Good for: Production, fixed deployments
Working Directory Behavior
The UI respects the working directory where raglite ui was launched:
- Database and index files are created/accessed relative to this directory
- Environment variables (
RAG_DB_FILE,RAG_INDEX_FILE) override defaults - Directory ingestion paths are resolved from this directory
Best Practice: Always run raglite ui from the directory containing (or where you want) your knowledge base files.
Theme Switching
The UI supports dark/light theme:
- Click the theme toggle button (moon/sun icon) in the header
- Preference is saved in browser local storage
Comparison: UI vs CLI
Feature Parity
| Feature | UI | CLI |
|---|---|---|
| Text ingestion | ✅ | ✅ |
| Image ingestion | ✅ | ✅ |
| Text search | ✅ | ✅ |
| Image search | ✅ | ✅ |
| Reranking | ✅ | ✅ |
| Mode selection | ✅ | ✅ |
| Model selection | ✅ | ✅ |
| Configuration | ✅ | ✅ |
| Progress tracking | ✅ Visual | ✅ Console |
| Batch processing | ✅ | ✅ |
UI Advantages
- Visual feedback: Real-time progress bars and stats
- File upload: Drag & drop interface
- Image preview: See images before searching
- Interactive: No need to remember command syntax
- Exploratory: Easy to try different configurations
CLI Advantages
- Scriptable: Easy to automate and integrate
- Headless: Works without GUI
- Faster: No browser overhead
- Terminal-friendly: Works in remote sessions
- Batch operations: Better for large-scale processing
When to Use Each
Use UI for:
- Learning and exploration
- Interactive document management
- Visual search with images
- Quick one-off operations
- When you prefer GUIs
Use CLI for:
- Automation and scripting
- CI/CD pipelines
- Server deployments
- Batch processing
- Terminal-based workflows
Troubleshooting
Server Won't Start
Problem: UI servers fail to start
Solutions:
-
Check ports:
- Ensure ports 3000 and 3001 are available
- Close other applications using these ports
- Check firewall settings
-
Check Node.js version:
node --version # Should be 18+ -
Check dependencies:
cd ui/backend && npm install
cd ../frontend && npm install
Files Won't Upload
Problem: File upload fails or files are rejected
Solutions:
- Check file type: Ensure file extension is supported
- Check file size: Large files (>100MB) may fail
- Check browser: Use modern browser (Chrome, Firefox, Edge, Safari)
- Check console: Browser DevTools may show errors
Search Returns No Results
Problem: Search queries return empty results
Solutions:
- Check ingestion: Ensure documents were successfully ingested
- Check knowledge base stats: Verify documents and chunks exist
- Check mode: Ensure search mode matches ingestion mode
- Try different query: Some queries may not match content
Image Search Not Working
Problem: Image search fails or returns errors
Solutions:
- Check mode: Must be in multimodal mode
- Check model: Must use CLIP model (not text-only)
- Check ingestion: Images must have been ingested in multimodal mode
- Check file format: Supported: JPG, PNG, GIF, WebP, BMP
Reranking Not Available
Problem: Reranking toggle is disabled or doesn't work
Solutions:
- Check ingestion: Reranking must be enabled during ingestion
- Check mode: Image searches automatically disable reranking
- Re-ingest: If reranking was disabled, re-ingest with reranking enabled
Performance Issues
Problem: UI is slow or unresponsive
Solutions:
- Check browser: Close other tabs, clear cache
- Check file sizes: Large files take longer to process
- Check model: Larger models (MPNet, CLIP) are slower
- Check system resources: Ensure sufficient RAM and CPU
Database Lock Errors
Problem: "Database is locked" or "EBUSY" errors
Solutions:
- Close other instances: Don't run multiple UI or CLI instances
- Wait for operations: Let current ingestion/search complete
- Use force rebuild carefully: May cause locks during reset
- Check file permissions: Ensure write access to database file
Browser Compatibility
Supported Browsers:
- Chrome/Edge 90+
- Firefox 88+
- Safari 14+
Not Supported:
- Internet Explorer
- Very old browser versions
Getting Help
If issues persist:
- Check console: Browser DevTools (F12) for errors
- Check backend logs: Terminal output shows backend errors
- Check documentation: See Troubleshooting Guide
- Check GitHub issues: Search for similar problems
Next Steps
- CLI Reference - Learn command-line interface
- Multimodal Tutorial - Advanced multimodal workflows
- API Reference - Programmatic integration
- Configuration Guide - Advanced configuration
Note: The UI is currently marked as "Experimental" and is actively being developed. Features may change between versions.