Filter knowledge
OpenRAG's knowledge filters help you organize and manage your knowledge base by creating pre-defined views of your documents.
Each knowledge filter captures a specific subset of documents based on given a search query and filters.
Knowledge filters can be used with different OpenRAG functionality. For example, knowledge filters can help agents access large knowledge bases efficiently by narrowing the scope of documents that you want the agent to use.
Built-in filters
When you install OpenRAG, it automatically creates an OpenRAG docs filter that includes OpenRAG's default documents. These documents provide information about OpenRAG itself and help you learn how to use OpenRAG.
When you use the OpenRAG Chat, apply the OpenRAG docs filter if you want to ask questions about OpenRAG's features and functionality. This limits the agent's context to the default OpenRAG documentation rather than all documents in your knowledge base.
After uploading your own documents, it is recommended that you create your own filters to organize your documents effectively and separate them from the default OpenRAG documents.
Create a filter
To create a knowledge filter, do the following:
-
Click Knowledge, and then click Knowledge Filters.
-
Enter a Name.
-
Optional: Click the filter icon next to the filter name to select a different icon and color for the filter. This is purely cosmetic, but it can help you visually distinguish different sets of filters, such as different projects or sources.
-
Optional: Enter a Description.
-
Customize the filter settings.
By default, filters match all documents in your knowledge base. Use the filter settings to narrow the scope of documents that the filter captures:
-
Search Query: Enter a natural language text string for semantic search.
When you apply a filter that has a Search Query, only documents matching the search query are included. It is recommended that you also use the Score Threshold setting to avoid returning irrelevant documents.
-
Data Sources: Select specific files and folders to include in the filter.
This is useful if you want to create a filter for a specific project or topic and you know the specific documents you want to include. For example, if you upload a folder, you could create a filter that only includes the documents from that folder.
-
Document Types: Filter by file type.
-
Owners: Filter by the user that uploaded the documents.
In no-auth mode, all documents are attributed to Anonymous User because there is no distinct document ownership or unique JWTs. For more control over document ownership and visibility, use OAuth mode. For more information, see OpenSearch authentication and document access.
-
Connectors: Filter by upload source, such as the local file system or a cloud storage connector.
-
Response Limit: Set the maximum number of results to return from the knowledge base. The default is
10, which means the filter returns only the top 10 most relevant documents. -
Score Threshold: Set the minimum relevance score for similarity search. The default score is
0. A threshold is recommended to avoid returned irrelevant documents.
-
-
Click Create Filter.
Edit a filter
To modify a filter, click Knowledge, and then click the filter you want to edit in the Knowledge Filters list. On the filter settings pane, edit the filter as desired, and then click Update Filter.
Apply a filter
In the OpenRAG Chat, click Filter, and then select the filter to apply. Chat filters apply to one chat session only.
You can also use filters when browsing your knowledge base. This is a helpful way to test filters and manage knowledge bases that have many documents.
Delete a filter
-
Click Knowledge.
-
In the Knowledge Filters list, click the filter that you want to delete.
-
In the filter settings pane, click Delete Filter.