Documents in the knowledge base use parent-child segmentation, with parent blocks containing the full text. When using the local large language model, it fails to properly extract content from the documents, and the extraction process gets interrupted #12061

Closed
opened 2026-02-21 19:05:33 -05:00 by yindo · 9 comments
Owner

Originally created by @panhaomouse on GitHub (Mar 24, 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

Version 1.1.3

Cloud or Self Hosted

Cloud

Steps to reproduce

The documents in the knowledge base use a parent-child segmentation approach, with the parent block containing the full text.
Image
select Local large language model,Unable to properly extract content from the document, and the extraction process was interrupted.

Image

✔️ Expected Behavior

Documents in the knowledge base adopt a parent-child segmentation structure, with parent blocks containing the full text. When using a local large language model, it should be able to correctly output and derive content from these documents

Actual Behavior

Documents in the knowledge base use parent-child segmentation, with parent blocks containing the full text. When using the local large language model, it fails to properly extract content from the documents, and the extraction process gets interrupted。
If an online large language model is selected, it can properly derive/extract the content
This issue occurred in both versions 1.1.1 and 1.1.2, and still persists in the current 1.1.3 release。

Originally created by @panhaomouse on GitHub (Mar 24, 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 Version 1.1.3 ### Cloud or Self Hosted Cloud ### Steps to reproduce The documents in the knowledge base use a parent-child segmentation approach, with the parent block containing the full text. ![Image](https://github.com/user-attachments/assets/b325726e-eaed-4ac1-9d8a-3504d2c2a5fa) select Local large language model,Unable to properly extract content from the document, and the extraction process was interrupted. ![Image](https://github.com/user-attachments/assets/b7f10fa4-ecdb-427d-a0be-4a5733053ba3) ### ✔️ Expected Behavior Documents in the knowledge base adopt a parent-child segmentation structure, with parent blocks containing the full text. When using a local large language model, it should be able to correctly output and derive content from these documents ### ❌ Actual Behavior Documents in the knowledge base use parent-child segmentation, with parent blocks containing the full text. When using the local large language model, it fails to properly extract content from the documents, and the extraction process gets interrupted。 If an online large language model is selected, it can properly derive/extract the content This issue occurred in both versions 1.1.1 and 1.1.2, and still persists in the current 1.1.3 release。
yindo added the 🐞 bugcloud labels 2026-02-21 19:05:33 -05:00
yindo closed this issue 2026-02-21 19:05:33 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Mar 24, 2025):

The issue you're experiencing with the local large language model failing to extract content using parent-child segmentation might be related to the JSON payload structure. The 'parent_mode' and 'subchunk_segmentation' parameters should be placed under the 'rules' object, not directly under 'process_rule'. This misconfiguration can lead to segmentation recognition failure [1].

Additionally, there is a known limitation with the 'deepseek-r1:32b' model, which does not support multimodal functionality in Dify cloud service (version 1.1.0) or self-hosted deployments (version 1.1.1) [2].

To resolve the issue, ensure that your JSON configuration is correctly structured as follows:

{
    "indexing_technique": "high_quality",
    "doc_form": "hierarchical_model",
    "process_rule": {
        "mode": "hierarchical",
        "rules": {
            "pre_processing_rules": [
                {"id": "remove_extra_spaces", "enabled": True},
                {"id": "remove_urls_emails", "enabled": True}
            ],
            "segmentation": {
                "separator": "###",
                "max_tokens": 500
            },
            "parent_mode": "paragraph",
            "subchunk_segmentation": {
                "separator": "***",
                "max_tokens": 500
            }
        }
    }
}

Make sure that 'parent_mode' and 'subchunk_segmentation' are correctly placed under the 'rules' object [3].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Mar 24, 2025): <!-- Answer --> The issue you're experiencing with the local large language model failing to extract content using parent-child segmentation might be related to the JSON payload structure. The 'parent_mode' and 'subchunk_segmentation' parameters should be placed under the 'rules' object, not directly under 'process_rule'. This misconfiguration can lead to segmentation recognition failure <sup>[[1]](https://github.com/langgenius/dify/issues/13007)</sup>. Additionally, there is a known limitation with the 'deepseek-r1:32b' model, which does not support multimodal functionality in Dify cloud service (version 1.1.0) or self-hosted deployments (version 1.1.1) <sup>[[2]](https://github.com/langgenius/dify/issues/16445)</sup>. To resolve the issue, ensure that your JSON configuration is correctly structured as follows: ```json { "indexing_technique": "high_quality", "doc_form": "hierarchical_model", "process_rule": { "mode": "hierarchical", "rules": { "pre_processing_rules": [ {"id": "remove_extra_spaces", "enabled": True}, {"id": "remove_urls_emails", "enabled": True} ], "segmentation": { "separator": "###", "max_tokens": 500 }, "parent_mode": "paragraph", "subchunk_segmentation": { "separator": "***", "max_tokens": 500 } } } } ``` Make sure that 'parent_mode' and 'subchunk_segmentation' are correctly placed under the 'rules' object <sup>[[3]](https://github.com/langgenius/dify/issues/12714)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/bcad280d-9b20-4cc5-be69-6f1fe500499b?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/bcad280d-9b20-4cc5-be69-6f1fe500499b?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/bcad280d-9b20-4cc5-be69-6f1fe500499b?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/bcad280d-9b20-4cc5-be69-6f1fe500499b?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/bcad280d-9b20-4cc5-be69-6f1fe500499b?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/bcad280d-9b20-4cc5-be69-6f1fe500499b?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/bcad280d-9b20-4cc5-be69-6f1fe500499b?feedback_type=other)</sup>
Author
Owner

@panhaomouse commented on GitHub (Mar 24, 2025):

使用qwq:32b本地大语言模型也存在这个问题

@panhaomouse commented on GitHub (Mar 24, 2025): 使用qwq:32b本地大语言模型也存在这个问题
Author
Owner

@panhaomouse commented on GitHub (Mar 24, 2025):

此类问题多个版本都存在,一直未解决。还请dify大拿们重视这个问题。

@panhaomouse commented on GitHub (Mar 24, 2025): 此类问题多个版本都存在,一直未解决。还请dify大拿们重视这个问题。
Author
Owner

@JohnJyong commented on GitHub (Mar 25, 2025):

I think you should consider whether it is a performance problem of your local model.
Our http request has a request timeout. If the model processing time is too long, the response will be affected.
you can try with any other cloud llm model if the issue is also exist, thanks

@JohnJyong commented on GitHub (Mar 25, 2025): I think you should consider whether it is a performance problem of your local model. Our http request has a request timeout. If the model processing time is too long, the response will be affected. you can try with any other cloud llm model if the issue is also exist, thanks
Author
Owner

@panhaomouse commented on GitHub (Mar 25, 2025):

The cloud large language model can do it, but the local large language model cannot.

@panhaomouse commented on GitHub (Mar 25, 2025): The cloud large language model can do it, but the local large language model cannot.
Author
Owner

@panhaomouse commented on GitHub (Mar 25, 2025):

The documents in the knowledge base employ parent-child segmentation where parent blocks contain full text. When using a local large language model, it fails to properly extract content from these documents and the extraction process gets interrupted. However, the local LLM can successfully perform derivation when parent blocks do not contain full tex。

@panhaomouse commented on GitHub (Mar 25, 2025): The documents in the knowledge base employ parent-child segmentation where parent blocks contain full text. When using a local large language model, it fails to properly extract content from these documents and the extraction process gets interrupted. However, the local LLM can successfully perform derivation when parent blocks do not contain full tex。
Author
Owner

@panhaomouse commented on GitHub (Mar 25, 2025):

In the parent-child segmentation structure, the local LLM fails to derive content when parent blocks contain full text, but succeeds when parent blocks store partial tex

@panhaomouse commented on GitHub (Mar 25, 2025): In the parent-child segmentation structure, the local LLM fails to derive content when parent blocks contain full text, but succeeds when parent blocks store partial tex
Author
Owner

@panhaomouse commented on GitHub (Mar 25, 2025):

老师,这个问题并没有解决,为什么要关闭?

@panhaomouse commented on GitHub (Mar 25, 2025): 老师,这个问题并没有解决,为什么要关闭?
Author
Owner

@AuditAIH commented on GitHub (Apr 26, 2025):

@panhaomouse 我最近发现ollama的api/core/model_runtime/model_providers/ollama/llm/llm.py这个文件,传入了一个num_ctx参数之后,就会导致超过这个参数的文本被全部截断,你可以尝试修改源码的这个参数,让dify不再传入任何值,用本地ollama的默认值,则可能会解决这个问题。有疑问可以尝试给我的github账户发送邮件。

@AuditAIH commented on GitHub (Apr 26, 2025): @panhaomouse 我最近发现ollama的api/core/model_runtime/model_providers/ollama/llm/llm.py这个文件,传入了一个num_ctx参数之后,就会导致超过这个参数的文本被全部截断,你可以尝试修改源码的这个参数,让dify不再传入任何值,用本地ollama的默认值,则可能会解决这个问题。有疑问可以尝试给我的github账户发送邮件。
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#12061