Configure knowledge
OpenRAG includes a built-in OpenSearch instance that serves as the underlying datastore for your knowledge (documents). This specialized database is used to store and retrieve your documents and the associated vector data (embeddings).
The documents in your OpenSearch knowledge base provide specialized context in addition to the general knowledge available to the language model that you select when you install OpenRAG or edit a flow.
You can upload documents from a variety of sources to populate your knowledge base with unique content, such as your own company documents, research papers, or websites. Documents are processed through OpenRAG's knowledge ingestion flows with Docling.
Then, the OpenRAG Chat can run similarity searches against your OpenSearch database to retrieve relevant information and generate context-aware responses.
You can configure how documents are ingested and how the Chat interacts with your knowledge base.
Browse knowledge
The Knowledge page lists the documents OpenRAG has ingested into your OpenSearch database, specifically in an OpenSearch index named documents.
To explore the raw contents of your knowledge base, click Knowledge to get a list of all ingested documents. Click a document to view the chunks produced from splitting the document during ingestion.
By default, OpenRAG includes some initial documents about OpenRAG. You can use these documents to ask OpenRAG about itself, and to test the Chat feature before uploading your own documents. If you delete these documents, you won't be able to ask OpenRAG about itself and it's own functionality. It is recommended that you keep these documents, and use filters to separate them from your other knowledge.
OpenSearch authentication and document access
When you install OpenRAG, you can choose between two setup modes: Basic Setup and Advanced Setup. The mode you choose determines how OpenRAG authenticates with OpenSearch and controls access to documents:
-
Basic Setup (no-auth mode): If you choose Basic Setup, then OpenRAG is installed in no-auth mode. This mode uses one, anonymous JWT token for OpenSearch authentication. There is no differentiation between users. All users that access your OpenRAG instance can access all documents uploaded to your OpenSearch knowledge base.
-
Advanced Setup (OAuth mode): If you choose Advanced Setup, then OpenRAG is installed in OAuth mode. This mode uses a unique JWT token for each OpenRAG user, and each document is tagged with user ownership. Documents are filtered by user owner. This means users see only the documents that they uploaded or have access to.
You can enable OAuth mode after installation. For more information, see Ingest files with OAuth connectors.
OpenSearch indexes
An OpenSearch index is a collection of documents in an OpenSearch database.
By default, all documents you upload to your OpenRAG knowledge base are stored in an index named documents.
It is possible to change the index name by editing the ingestion flow.
However, this can impact dependent processes, such as the filters and Chat flow, that reference the documents index by default.
Make sure you edit other flows as needed to ensure all processes use the same index name.
If you encounter errors or unexpected behavior after changing the index name, you can revert the flows to their original configuration, or delete knowledge to clear the existing documents from your knowledge base.
Knowledge ingestion settings
Knowledge ingestion settings apply to documents you upload after making the changes. Documents uploaded before changing these settings aren't reprocessed.
After changing knowledge ingestion settings, you must determine if you need to reupload any documents to be consistent with the new settings.
It isn't always necessary to reupload documents after changing knowledge ingestion settings. For example, it is typical to upload some documents with OCR enabled and others without OCR enabled.
If needed, you can use filters to separate documents that you uploaded with different settings, such as different embedding models.
Set the embedding model and dimensions
When you install OpenRAG, you select at least one embedding model during application onboarding. OpenRAG automatically detects and configures the appropriate vector dimensions for your selected embedding model, ensuring optimal search performance and compatibility.
In the OpenRAG repository, you can find the complete list of supported models in models_service.py and the corresponding vector dimensions in settings.py.
During application onboarding, you can select from the supported models.
The default embedding dimension is 1536, and the default model is the OpenAI text-embedding-3-small.
If you want to use an unsupported model, you must manually set the model in your OpenRAG configuration.
If you use an unsupported embedding model that doesn't have defined dimensions in settings.py, then OpenRAG falls back to the default dimensions (1536) and logs a warning. OpenRAG's OpenSearch instance and flows continue to work, but similarity search quality can be affected if the actual model dimensions aren't 1536.
To change the embedding model after onboarding, it is recommended that you modify the embedding model setting in the OpenRAG Settings page or in your OpenRAG configuration. This will automatically update all relevant OpenRAG flows to use the new embedding model configuration.
Set Docling parameters
OpenRAG uses Docling for document ingestion because it supports many file formats, processes tables and images well, and performs efficiently.
When you upload documents, Docling processes the files, splits them into chunks, and stores them as separate, structured documents in your OpenSearch knowledge base.
You can use either Docling Serve or OpenRAG's built-in Docling ingestion pipeline to process documents.
- Docling Serve ingestion
- Built-in Docling ingestion
By default, OpenRAG uses Docling Serve.
This means that OpenRAG starts a docling serve process on your local machine and runs Docling ingestion through an API service.
If you want to use OpenRAG's built-in Docling ingestion pipeline instead of the separate Docling Serve service, set DISABLE_INGEST_WITH_LANGFLOW=true in your OpenRAG environment variables.
The built-in pipeline uses the Docling processor directly instead of through the Docling Serve API.
For the underlying functionality, see processors.py in the OpenRAG repository.
To modify the Docling ingestion and embedding parameters, click Settings in the OpenRAG user interface.
OpenRAG warns you if docling serve isn't running.
You can start and stop OpenRAG services from the TUI main menu with Start Native Services or Stop Native Services.
-
Embedding model: Select the model to use to generate vector embeddings for your documents.
This is initially set during installation. The recommended way to change this setting is in the OpenRAG Settings or your OpenRAG configuration. This will automatically update all relevant OpenRAG flows to use the new embedding model configuration.
If you uploaded documents prior to changing the embedding model, you can create filters to separate documents embedded with different models, or you can reupload all documents to regenerate embeddings with the new model. If you want to use multiple embeddings models, similarity search (in the Chat) can take longer as it searching each model's embeddings separately.
-
Chunk size: Set the number of characters for each text chunk when breaking down a file. Larger chunks yield more context per chunk, but can include irrelevant information. Smaller chunks yield more precise semantic search, but can lack context. The default value is 1000 characters, which is usually a good balance between context and precision.
-
Chunk overlap: Set the number of characters to overlap over chunk boundaries. Use larger overlap values for documents where context is most important. Use smaller overlap values for simpler documents or when optimization is most important. The default value is 200 characters, which represents an overlap of 20 percent if the Chunk size is 1000. This is suitable for general use. For faster processing, decrease the overlap to approximately 10 percent. For more complex documents where you need to preserve context across chunks, increase it to approximately 40 percent.
-
Table Structure: Enables Docling's
DocumentConvertertool for parsing tables. Instead of treating tables as plain text, tables are output as structured table data with preserved relationships and metadata. This option is enabled by default. -
OCR: Enables Optical Character Recognition (OCR) processing when extracting text from images and ingesting scanned documents. This setting is best suited for processing text-based documents faster with Docling's
DocumentConverter. Images are ignored and not processed.This option is disabled by default. Enabling OCR can slow ingestion performance.
If OpenRAG detects that the local machine is running on macOS, OpenRAG uses the ocrmac OCR engine. Other platforms use easyocr.
-
Picture descriptions: Only applicable if OCR is enabled. Adds image descriptions generated by the
SmolVLM-256M-Instructmodel. Enabling picture descriptions can slow ingestion performance.
Set the local documents path
The default path for local uploads is the ./openrag-documents subdirectory in your OpenRAG installation directory. This is mounted to the /app/openrag-documents/ directory inside the OpenRAG container. Files added to the host or container directory are visible in both locations.
To change this location, modify the Documents Paths variable in either the Advanced Setup menu or in the .env used by Docker Compose.
Delete knowledge
To clear your entire knowledge base, delete the contents of the ./opensearch-data folder in your OpenRAG installation directory.
This is a destructive operation that cannot be undone.