Enhance Knowledge Base with Neighbouring Chunk Retrieval #4435

Closed
opened 2026-02-21 18:06:26 -05:00 by yindo · 6 comments
Owner

Originally created by @mkeari on GitHub (Jul 4, 2024).

Originally assigned to: @crazywoola on GitHub.

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

Yes, the current knowledge base functionality sometimes misses out on important context when the explanation of a concept is divided across multiple chunks and not all of them mention the retrieved concept by name.

What is the feature you'd like to see?
I propose an option in the knowledge settings that, if selected, allows the user to retrieve not only the matching chunk, but also neighbouring chunks. This would ensure that all relevant information is captured, even if it's spread across multiple chunks.

How will this feature improve your workflow / experience?
This feature will significantly improve the accuracy of the answers provided by the knowledge base. It will ensure that no part of the information is lost due to the absence of specific words in a particular chunk.

2. Additional context or comments

No response

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @mkeari on GitHub (Jul 4, 2024). Originally assigned to: @crazywoola on GitHub. ### Self Checks - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### 1. Is this request related to a challenge you're experiencing? Tell me about your story. Yes, the current knowledge base functionality sometimes misses out on important context when the explanation of a concept is divided across multiple chunks and not all of them mention the retrieved concept by name. **What is the feature you'd like to see?** I propose an option in the knowledge settings that, if selected, allows the user to retrieve not only the matching chunk, but also neighbouring chunks. This would ensure that all relevant information is captured, even if it's spread across multiple chunks. **How will this feature improve your workflow / experience?** This feature will significantly improve the accuracy of the answers provided by the knowledge base. It will ensure that no part of the information is lost due to the absence of specific words in a particular chunk. ### 2. Additional context or comments _No response_ ### 3. Can you help us with this feature? - [X] I am interested in contributing to this feature.
yindo added the 💪 enhancement label 2026-02-21 18:06:26 -05:00
yindo closed this issue 2026-02-21 18:06:26 -05:00
Author
Owner

@tangyoha commented on GitHub (Jul 4, 2024):

I think in addition to this, there is another situation, such as solving a problem requires multiple steps, and the text exceeds 1000, it will be divided into multiple Chunks, which can be solved by modifying the maximum Chunk, but I think it can be retrieved by setting the mapping method, and the entire block can be returned by configuration.

@tangyoha commented on GitHub (Jul 4, 2024): I think in addition to this, there is another situation, such as solving a problem requires multiple steps, and the text exceeds 1000, it will be divided into multiple Chunks, which can be solved by modifying the maximum Chunk, but I think it can be retrieved by setting the mapping method, and the entire block can be returned by configuration.
Author
Owner

@Dragon-gif commented on GitHub (Jul 4, 2024):

I think it's best to support custom text splitters, such as matching several levels of titles based on regular expressions.

@Dragon-gif commented on GitHub (Jul 4, 2024): I think it's best to support custom text splitters, such as matching several levels of titles based on regular expressions.
Author
Owner

@tangyoha commented on GitHub (Jul 4, 2024):

https://github.com/langgenius/dify/issues/1360

@tangyoha commented on GitHub (Jul 4, 2024): https://github.com/langgenius/dify/issues/1360
Author
Owner

@crazywoola commented on GitHub (Jul 16, 2024):

In next major release.

@crazywoola commented on GitHub (Jul 16, 2024): In next major release.
Author
Owner

@limingchina commented on GitHub (Jan 13, 2025):

Will this still be planned in the future?

@limingchina commented on GitHub (Jan 13, 2025): Will this still be planned in the future?
Author
Owner

@zjh1943 commented on GitHub (Apr 7, 2025):

I think Neighbouring Chunk Retrieval is a very good idea. Hope it be implemneted.

@zjh1943 commented on GitHub (Apr 7, 2025): I think Neighbouring Chunk Retrieval is a very good idea. Hope it be implemneted.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#4435