how to merge the identified segment with the subsequent 1 or 2 segments to form a cohesive context to feed into a large language model #1738

Closed
opened 2026-02-21 17:37:17 -05:00 by yindo · 0 comments
Owner

Originally created by @charliex2 on GitHub (Apr 2, 2024).

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).
  • Pleas do not modify this template :) and fill in all the required fields.

Provide a description of the help you need

we're encountering a specific challenge regarding the merging of segments retrieved from a query search in our vector database. The issue arises when a query search successfully identifies a matching segment, but the actual content may have been fragmented into multiple segments. Our goal is to seamlessly merge the identified segment with the subsequent three segments to form a cohesive context to feed into a large language model.

for example,a text:

How to be rich?

  1. Develop a written financial plan
  2. Get into the habit of saving
  3. Live below your means
  4. Stay out of debt
  5. Invest in ways that work for you
  6. Start your own business
  7. Get professional advice

but the text above was split into two segement. When user query "How to be rich?",only first half part was found.

Is is it possible to merge the identified segment with the subsequent 1 or 2 segments to form a cohesive context to feed into a large language model?

Originally created by @charliex2 on GitHub (Apr 2, 2024). ### 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] Pleas do not modify this template :) and fill in all the required fields. ### Provide a description of the help you need we're encountering a specific challenge regarding the merging of segments retrieved from a query search in our vector database. The issue arises when a query search successfully identifies a matching segment, but the actual content may have been fragmented into multiple segments. Our goal is to seamlessly merge the identified segment with the subsequent three segments to form a cohesive context to feed into a large language model. for example,a text: > How to be rich? > 1. Develop a written financial plan > 2. Get into the habit of saving > 3. Live below your means > 4. Stay out of debt > 5. Invest in ways that work for you > 6. Start your own business > 7. Get professional advice but the text above was split into two segement. When user query "How to be rich?",only first half part was found. Is is it possible to merge the identified segment with the subsequent 1 or 2 segments to form a cohesive context to feed into a large language model?
yindo added the 🙋‍♂️ question label 2026-02-21 17:37:17 -05:00
yindo closed this issue 2026-02-21 17:37:17 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#1738