🌌 OpenWebUI Document Settings: A Comprehensive Guide
OpenWebUI is an extensible, self-hosted AI interface that allows users to interact with large language models (LLMs) through a user-friendly web interface1. One of its key features is the ability to upload and query documents using Retrieval Augmented Generation (RAG). This article provides a comprehensive overview of the document settings in OpenWebUI, explaining their purpose, usage, and recommended configurations.
🌟 Accessing Document Settings
To access the document settings, first navigate to the main OpenWebUI interface2. In the top panel, click on your avatar in the top right corner of the screen and select “Admin Panel”2. Then, click on the “Settings” tab and select “Documents”.
🌟 Document Settings Overview
🚀 Welcome to this comprehensive guide! This section will give you the foundational knowledge you need. The “Documents” settings section in OpenWebUI allows you to configure how the platform interacts with your documents. These settings control how documents are processed, embedded, and retrieved when using the RAG feature3. In addition to the settings detailed below, OpenWebUI also offers Google Drive integration for document uploading. When paired with a Google Cloud project that has the Google Picker API and Google Drive API enabled, this feature allows users to directly access their Drive files from the chat interface and upload documents, slides, sheets, and more as context to your chat4. This feature can be enabled in the Admin Panel > Settings > Documents menu. The following table summarizes the key document settings available in OpenWebUI:
Setting | Description | How to Use | Recommendations |
---|---|---|---|
Embedding Model Engine | Determines which engine is used for creating embeddings of your documents. | Choose from: - Default (SentenceTransformers) - Ollama - OpenAI | For enhanced performance, install an embedding model directly in Ollama and select “Ollama” as the engine5. |
Hybrid Search | Enables a hybrid search approach that combines keyword-based search with vector similarity search. | Toggle on/off | Enable this setting for improved search accuracy6. |
Embedding Model | Specifies the specific embedding model to use for creating document embeddings. | Select a model from the available options. | If using the default engine, download the model in the “Embedding Models” section. For Ollama, install the model directly in Ollama5. The paraphrase-multilingual model is recommended. |
Content extraction engine | Specifies how OpenWebUI extracts text content from documents. | Select from available options. | The default option is generally recommended. |
RAG Template | Allows customization of the template used to incorporate document context into LLM responses. | Modify the template in the provided text field. | Adjust the template to suit your specific needs and preferences. |
🌟 Embedding Model Engine
The Embedding Model Engine setting determines how OpenWebUI generates embeddings for your documents. Embeddings are numerical representations of text that capture the semantic meaning of the words, similar to how words are represented in a dictionary7. These embeddings are used to measure the similarity between documents and user queries, enabling the RAG feature to retrieve relevant information. OpenWebUI offers three options for the Embedding Model Engine:
Engine | Description | Pros/Cons |
---|---|---|
Default (SentenceTransformers) | Utilizes the SentenceTransformers library, which provides a wide range of pre-trained embedding models5. | Pros: Easy to use, wide range of models available. Cons: May not be as performant as other options. |
Ollama | Allows you to use embedding models installed directly within your Ollama instance5. | Pros: Can provide better performance, allows for custom models. Cons: Requires installing models in Ollama. |
OpenAI | Utilizes the OpenAI API for generating embeddings7. | Pros: High-quality embeddings. Cons: Requires an OpenAI API key, may incur costs. |
To configure the Embedding Model Engine, simply select your preferred option from the dropdown menu in the “Documents” settings section.
🌟 Hybrid Search
Hybrid search combines traditional keyword-based search with vector similarity search to improve the accuracy and relevance of document retrieval. When enabled, OpenWebUI will first use keyword matching to identify potentially relevant documents and then use vector similarity to rank those documents based on their semantic relevance to the user query8. This approach leverages the strengths of both methods, resulting in more accurate and comprehensive search results.
🌟 Embedding Model
The Embedding Model setting allows you to specify which embedding model to use for generating document embeddings. The available options will depend on the Embedding Model Engine you have selected. If you are using the default SentenceTransformers engine, you will need to download the desired embedding model from the “Embedding Models” section within the “Documents” settings9. For Ollama, you will need to install the embedding model directly in your Ollama instance5. Choosing the right embedding model is crucial for optimal performance5. Consider factors such as the size of your documents, the complexity of the language used, and the desired accuracy of the embeddings. Larger, more complex models may provide better accuracy but require more computational resources. For general use, the paraphrase-multilingual model is recommended5.
🌟 Content Extraction Engine
The Content extraction engine setting determines how OpenWebUI extracts text content from the documents you upload. This engine is responsible for parsing different file formats (e.g., PDFs, DOCX, TXT) and extracting the relevant text information for embedding and retrieval3. OpenWebUI typically provides a default option that works well for most common file types. However, you may be able to select alternative engines if needed for specific use cases or file formats.
🌟 RAG Template
The RAG template defines how OpenWebUI incorporates the retrieved document context into the LLM response. You can customize this template to control the format and presentation of the information4. For example, you can modify the template to include citations, highlight specific sections of the document, or adjust the overall structure of the response. This allows you to tailor the output to your specific needs and preferences.
🌟 Conclusion
The document settings in OpenWebUI provide a powerful set of tools for configuring how the platform interacts with your documents. By understanding these settings and their implications, you can optimize the RAG feature for your specific needs and achieve more accurate and relevant results. Carefully consider the Embedding Model Engine, Hybrid Search, Embedding Model, Content extraction engine, and RAG Template settings to ensure that OpenWebUI effectively processes and retrieves information from your documents.
🔧 Works cited
1. Open WebUI, accessed on January 23, 2025, https://openwebui.com/
2. Using Open WebUI for Effective AI Model Interaction, accessed on January 23, 2025, https://documentation.suse.com/suse-ai/1.0/html/openwebui-using/index.html
3. Documents usage (Guide) · open-webui open-webui · Discussion …, accessed on January 23, 2025, https://github.com/open-webui/open-webui/discussions/3432
4. Retrieval Augmented Generation (RAG) - Open WebUI, accessed on January 23, 2025, https://docs.openwebui.com/features/rag/
5. 10 Tips for Open WebUI to Enhance Your Work with AI - HOSTKEY, accessed on January 23, 2025, https://hostkey.com/blog/74-10-tips-for-open-webui-to-enhance-your-work-with-ai/
6. Features | Open WebUI, accessed on January 23, 2025, https://docs.openwebui.com/features/
7. Environment Variable Configuration | Open WebUI, accessed on January 23, 2025, https://docs.openwebui.com/getting-started/advanced-topics/env-configuration/
8. issue: hybrid search · Issue #7942 · open-webui/open-webui - GitHub, accessed on January 23, 2025, https://github.com/open-webui/open-webui/issues/7942
9. Open WebUI, RAG, Knowledge, Sentence Transformers, Embeddings models, Re-ranking models - YouTube, accessed on January 23, 2025, https://www.youtube.com/watch?v=5Lpd2o1TM7A