From 74c195cd3692d556d2008e935c8f33bd54246a30 Mon Sep 17 00:00:00 2001 From: writinwaters <93570324+writinwaters@users.noreply.github.com> Date: Wed, 15 Oct 2025 21:00:19 +0800 Subject: [PATCH] Doc: Added Long context RAG guide (#10591) ### What problem does this PR solve? ### Type of change - [x] Documentation Update --- .../dataset/configure_knowledge_base.md | 7 +--- .../dataset/extract_table_of_contents.md | 39 +++++++++++++++++++ docs/guides/dataset/select_pdf_parser.md | 4 +- docs/guides/dataset/set_metadata.md | 2 +- docs/guides/dataset/set_page_rank.md | 2 +- docs/guides/dataset/use_tag_sets.md | 4 +- 6 files changed, 47 insertions(+), 11 deletions(-) create mode 100644 docs/guides/dataset/extract_table_of_contents.md diff --git a/docs/guides/dataset/configure_knowledge_base.md b/docs/guides/dataset/configure_knowledge_base.md index e7fd9c2a1..a57ca03cb 100644 --- a/docs/guides/dataset/configure_knowledge_base.md +++ b/docs/guides/dataset/configure_knowledge_base.md @@ -1,5 +1,5 @@ --- -sidebar_position: -1 +sidebar_position: -10 slug: /configure_knowledge_base --- @@ -58,11 +58,8 @@ You can also change a file's chunking method on the **Files** page. ![change chunking method](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/change_chunking_method.jpg) -:::tip NOTE -From v0.21.0, RAGFlow supports ingestion pipeline to allow for customized -
- From v0.21.0 onward, RAGFlow supports ingestion pipeline to allow for customized data ingestion and cleansing workflows. + From v0.21.0 onward, RAGFlow supports ingestion pipeline for customized data ingestion and cleansing workflows. To use a customized data pipeline: diff --git a/docs/guides/dataset/extract_table_of_contents.md b/docs/guides/dataset/extract_table_of_contents.md new file mode 100644 index 000000000..58e920613 --- /dev/null +++ b/docs/guides/dataset/extract_table_of_contents.md @@ -0,0 +1,39 @@ +--- +sidebar_position: 4 +slug: /enable_table_of_contents +--- + +# Extract table of contents + +Extract table of contents (TOC) from documents to provide long context RAG and improve retrieval. + +--- + +During indexing, this technique uses LLM to extract and generate chapter information, which is added to each chunk to provide sufficient global context. At the retrieval stage, it first uses the chunks matched by search, then supplements missing chunks based on the table of contents structure. This addresses issues caused by chunk fragmentation and insufficient context, improving answer quality. + +:::danger WARNING +Enabling TOC extraction requires significant memory, computational resources, and tokens. +::: + +## Prerequisites + +The system's default chat model is used to summarize clustered content. Before proceeding, ensure that you have a chat model properly configured: + +![Set default models](https://raw.githubusercontent.com/infiniflow/ragflow-docs/main/images/set_default_models.jpg) + +## Quickstart + +1. Navigate to the **Configuration** page. + +2. Enable **TOC Enhance**. + +3. To use this technique during retrieval, do either of the following: + + - In the **Chat setting** panel of your chat app, switch on the **TOC Enhance** toggle. + - If you are using an agent, click the **Retrieval** agent component to specify the dataset(s) and switch on the **TOC Enhance** toggle. + +## Frequently asked questions + +### Will previously parsed files be searched using the TOC enhancement feature once I enable `TOC Enhance`? + +No. Only files parsed after you enable **TOC Enhance** will be searched using the TOC enhancement feature. To apply this feature to files parsed before enabling **TOC Enhance**, you must reparse them. \ No newline at end of file diff --git a/docs/guides/dataset/select_pdf_parser.md b/docs/guides/dataset/select_pdf_parser.md index eabf0b264..b9af551c2 100644 --- a/docs/guides/dataset/select_pdf_parser.md +++ b/docs/guides/dataset/select_pdf_parser.md @@ -1,5 +1,5 @@ --- -sidebar_position: 1 +sidebar_position: -4 slug: /select_pdf_parser --- @@ -25,7 +25,7 @@ RAGFlow isn't one-size-fits-all. It is built for flexibility and supports deeper - **One** - To use a third-party visual model for parsing PDFs, ensure you have set a default img2txt model under **Set default models** on the **Model providers** page. -## Procedure +## Quickstart 1. On your dataset's **Configuration** page, select a chunking method, say **General**. diff --git a/docs/guides/dataset/set_metadata.md b/docs/guides/dataset/set_metadata.md index a3d239927..15491ad23 100644 --- a/docs/guides/dataset/set_metadata.md +++ b/docs/guides/dataset/set_metadata.md @@ -1,5 +1,5 @@ --- -sidebar_position: 0 +sidebar_position: -7 slug: /set_metada --- diff --git a/docs/guides/dataset/set_page_rank.md b/docs/guides/dataset/set_page_rank.md index 4b24d9b34..5df848a0e 100644 --- a/docs/guides/dataset/set_page_rank.md +++ b/docs/guides/dataset/set_page_rank.md @@ -1,5 +1,5 @@ --- -sidebar_position: 2 +sidebar_position: -2 slug: /set_page_rank --- diff --git a/docs/guides/dataset/use_tag_sets.md b/docs/guides/dataset/use_tag_sets.md index 81dc65838..35af071cf 100644 --- a/docs/guides/dataset/use_tag_sets.md +++ b/docs/guides/dataset/use_tag_sets.md @@ -42,8 +42,8 @@ A tag set is *not* involved in document indexing or retrieval. Do not specify a ::: 1. Click **+ Create dataset** to create a dataset. -2. Navigate to the **Configuration** page of the created dataset and choose **Tag** as the default chunking method. -3. Navigate to the **Dataset** page and upload and parse your table file in XLSX, CSV, or TXT formats. +2. Navigate to the **Configuration** page of the created dataset, select **Built-in** in **Ingestion pipeline**, then choose **Tag** as the default chunking method from the **Built-in** drop-down menu. +3. Go back to the **Files** page and upload and parse your table file in XLSX, CSV, or TXT formats. _A tag cloud appears under the **Tag view** section, indicating the tag set is created:_ ![Image](https://github.com/user-attachments/assets/abefbcbf-c130-4abe-95e1-267b0d2a0505) 4. Click the **Table** tab to view the tag frequency table: