sidebar_position: 1
Knowledge base, hallucination-free chat, and file management are the three pillars of RAGFlow. RAGFlow’s AI chats are based on knowledge bases. Each of RAGFlow’s knowledge bases serves as a knowledge source, parsing files uploaded from your local machine and file references generated in File Management into the real ‘knowledge’ for future AI chats. This guide demonstrates some basic usages of the knowledge base feature, covering the following topics:
With multiple knowledge bases, you can build more flexible, diversified question answering. To create your first knowledge base:
Each time a knowledge base is created, a folder with the same name is generated in the root/.knowledgebase directory.
The following screen shot shows the configuration page of a knowledge base. A proper configuration of your knowledge base is crucial for future AI chats. For example, choosing the wrong embedding model or chunk method would cause unexpected semantic loss or mismatched answers in chats.
This section covers the following topics:
RAGFlow offers multiple chunking template to facilitate chunking files of different layouts and ensure semantic integrity. In Chunk method, you can choose the default template that suits the layouts and formats of your files. The following table shows the descriptions and the compatible file formats of each supported chunk template:
| Template | Description | File format | 
|---|---|---|
| General | Files are consecutively chunked based on a preset chunk token number. | DOCX, EXCEL, PPT, PDF, TXT, JPEG, JPG, PNG, TIF, GIF | 
| Q&A | EXCEL, CSV/TXT | |
| Manual | ||
| Table | EXCEL, CSV/TXT | |
| Paper | ||
| Book | DOCX, PDF, TXT | |
| Laws | DOCX, PDF, TXT | |
| Presentation | PDF, PPTX | |
| Picture | JPEG, JPG, PNG, TIF, GIF | |
| One | The entire document is chunked as one. | DOCX, EXCEL, PDF, TXT | 
You can also change the chunk template for a particular file on the Datasets page.
An embedding model builds vector index on file chunks. Once you have chosen an embedding model and used it to parse a file, you are no longer allowed to change it. To switch to a different embedding model, you must deletes all completed file chunks in the knowledge base. The obvious reason is that we must ensure that all files in a specific knowledge base are parsed using the same embedding model (ensure that they are compared in the same embedding space).
The following embedding models can be deployed locally:
While uploading files directly to a knowledge base seems more convenient, we highly recommend uploading files to File Management and then linking them to the target knowledge bases. This way, you can avoid permanently deleting files uploaded to the knowledge base.
File parsing is a crucial topic in knowledge base configuration. The meaning of file parsing in RAGFlow is twofold: chunking files based on file layout and building embedding and full-text (keyword) indexes on these chunks. After having selected the chunk method and embedding model, you can start parsing an file:
RAGFlow features visibility and explainability, allowing you to view the chunking results and intervene where necessary. To do so:
You are taken to the Chunk page:
Hover over each snapshot for a quick view of each chunk.
Double click the chunked texts to add keywords or make manual changes where necessary:
As you can tell from the following, RAGFlow responds with truthful citations.
RAGFlow uses multiple recall of both full-text search and vector search in its chats. Prior to setting up an AI chat, consider adjusting the following parameters to ensure that the intended information always turns up in answers:
As of RAGFlow v0.11.0, the search feature is still in a rudimentary form, supporting only knowledge base search by name.
You are allowed to delete a knowledge base. Hover your mouse over the three dot of the intended knowledge base card and the Delete option appears. Once you delete a knowledge base, the associated folder under root/.knowledge directory is AUTOMATICALLY REMOVED. The consequence is: