How to retrieve a whole document from knowledge base? #11215

Closed
opened 2026-02-21 18:56:59 -05:00 by yindo · 0 comments
Owner

Originally created by @kandeng on GitHub (Mar 16, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • 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).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.0.0

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

  1. Create a knowledge base, named as "our_products",

Upload a few product introduction DOCX files to "our_products", including a file named "JCLD003010N001-W2.docx".

  1. Do chunking for the files in the knowledge base "our_products",

Since the maximum chunk size is quite small, 4000 tokens, we selected 2048 token/chunk.

  1. Create a "chatbot" instance in the studio, mainly consists of 2 steps,

3.1 With user's query, retrieve the files from the "our_products" knowledge base,

3.2 Input both the files from knowledge base, and the user's query, to the LLM that is a DS-R1, asking R1 to read and comprehend the file's content.

  1. Our query is "Please tell me the size of the product called 'JCLD003010N001-W2'? ",

    We expected the R1 would give an answer like "35*57",

    however, the R1 replied "I don't know".

  2. We dived into the workflow step by step, found the root cause, that is,

Step 3.1 should give step 3.2 a whole file's content,

However, maybe because of chunking, what step 3.1 really gave step 3.2 was a string, "JCLD003010N001-W2specification", rather than the entire file content.

✔️ Expected Behavior

"Knowledge retrieval" block is expected to retrieve the entire contents of the files in the knowledge base.

Actual Behavior

"Knowledge retrieval" block only retrieves one chunk from the file content in the knowledge base.

Originally created by @kandeng on GitHub (Mar 16, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [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] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.0.0 ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce 1. Create a knowledge base, named as "our_products", Upload a few product introduction DOCX files to "our_products", including a file named "JCLD003010N001-W2.docx". 2. Do chunking for the files in the knowledge base "our_products", Since the maximum chunk size is quite small, 4000 tokens, we selected 2048 token/chunk. 3. Create a "chatbot" instance in the studio, mainly consists of 2 steps, 3.1 With user's query, retrieve the files from the "our_products" knowledge base, 3.2 Input both the files from knowledge base, and the user's query, to the LLM that is a DS-R1, asking R1 to read and comprehend the file's content. 4. Our query is "Please tell me the size of the product called 'JCLD003010N001-W2'? ", We expected the R1 would give an answer like "35*57", however, the R1 replied "I don't know". 5. We dived into the workflow step by step, found the root cause, that is, Step 3.1 should give step 3.2 a whole file's content, However, maybe because of chunking, what step 3.1 really gave step 3.2 was a string, "JCLD003010N001-W2specification", rather than the entire file content. ### ✔️ Expected Behavior "Knowledge retrieval" block is expected to retrieve the entire contents of the files in the knowledge base. ### ❌ Actual Behavior "Knowledge retrieval" block only retrieves one chunk from the file content in the knowledge base.
yindo closed this issue 2026-02-21 18:56:59 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#11215