Skip to main content

Overview

Open WebUI’s RAG (Retrieval-Augmented Generation) system enables powerful document-based chat interactions by combining vector search, hybrid retrieval, and multiple content extraction engines.

Document Upload & Processing

Supported File Types

Open WebUI supports extensive file format compatibility:
  • PDF (with OCR support)
  • Word (DOC, DOCX)
  • PowerPoint (PPT, PPTX)
  • Excel (XLS, XLSX)
  • Plain text (TXT, MD)
  • Rich text (RTF)

Content Extraction Engines

Choose from multiple extraction engines based on your needs:

Tika

Apache Tika - Universal document parser
  • Supports 1000+ file formats
  • Metadata extraction
  • Self-hosted option

Docling

IBM Docling - AI-powered extraction
  • Advanced layout understanding
  • Table structure preservation
  • High accuracy for complex documents

Document Intelligence

Azure Document Intelligence
  • Cloud-based OCR
  • Form recognition
  • Layout analysis
  • Custom model support

Mistral OCR

Mistral OCR API
  • AI-powered image text extraction
  • Multi-language support
  • High-quality results

Configuration

Configure content extraction settings:

Vector Database Support

Open WebUI supports 9 vector database options:
Default embedded database
  • No external dependencies
  • Perfect for single-node deployments
  • Persistent storage

Embedding Configuration

Embedding Models

Configure embedding generation:
1

Choose Engine

2

Configure Provider

Ollama:
OpenAI:
Azure OpenAI:
3

Optimize Performance

Changing embedding models requires re-embedding all existing documents. Plan migrations carefully.

Chunking Strategies

Optimize document chunking for better retrieval:

Text Splitters

RecursiveCharacterTextSplitter (Default)
  • Splits on multiple separators hierarchically
  • Preserves semantic meaning
  • Best for general content

Chunking Parameters

Optimal chunking balances:
  • Chunk Size: Larger = more context, fewer chunks
  • Overlap: Prevents information loss at boundaries
  • Min Size: Ensures chunks contain meaningful content
Combine vector and keyword search for better results.

How It Works

1

Vector Search

Semantic similarity using embeddings
2

BM25 Keyword Search

Traditional keyword matching with TF-IDF
3

Score Fusion

Combine scores using configured weight
4

Reranking

Optionally rerank results with dedicated model

Reranking

Improve retrieval quality with reranking models.

Configuration

Supported models:
  • BAAI/bge-reranker-*
  • jinaai/jina-colbert-v2
  • CrossEncoder models

Reranking Process

  1. Initial Retrieval: Get top N candidates (e.g., 50)
  2. Rerank: Score candidates with reranking model
  3. Filter: Keep top K (e.g., 10) best matches
  4. Threshold: Optionally filter by relevance score

Web Search Integration

Enhance RAG with live web search.

Supported Providers

SearXNG

Self-hosted metasearch engine

Google PSE

Programmable Search Engine

Brave Search

Privacy-focused search API

Kagi

Premium search API

Tavily

AI-optimized search

Perplexity

AI-powered answers

Configuration Example

Web Search Workflow

1

Search Execution

Query configured search provider for relevant URLs
2

Content Loading

Fetch and extract text from web pages
3

Processing

Chunk and embed web content
4

RAG Integration

Combine with document library results

Using RAG in Chat

Accessing Documents

Reference documents in chat using the # command:

RAG Template

Customize how retrieved context is presented:
The {{CONTEXT}} placeholder is replaced with retrieved document chunks, and {{QUERY}} with the user’s question.

Advanced Features

Full Context Mode

Bypass chunking for small documents:
When enabled:
  • Small documents sent in full
  • Better context preservation
  • Higher token usage

Bypass Embedding

Skip vector search for specific use cases:
This disables RAG functionality. Documents won’t be searchable.

YouTube Integration

Extract transcripts from YouTube videos:
Usage:

Cloud Storage Integration

Import documents from cloud services:
Features:
  • OAuth authentication
  • File picker interface
  • Automatic download and processing

Performance Optimization

Async Embedding

Parallelize embedding generation:
Benefits:
  • Faster document processing
  • Better resource utilization
  • Configurable concurrency

Web Loader Optimization

API Reference

RAG Configuration

Embedding Management

Best Practices

Choose Right Chunk Size

  • Too small: Loss of context
  • Too large: Poor retrieval precision
  • Start with 1500 characters
  • Adjust based on content type

Use Hybrid Search

  • Better than vector-only for many queries
  • Combines semantic + keyword matching
  • Tune weight based on use case

Enable Reranking

  • Significantly improves result quality
  • Small performance cost
  • Worth it for production use

Monitor Embedding Costs

  • Track API usage for cloud providers
  • Consider local models for volume
  • Batch processing reduces costs