dify icon indicating copy to clipboard operation
dify copied to clipboard

Delete Knowledge base won't free up hard drive space

Open terrysun1216 opened this issue 10 months ago • 1 comments

Self Checks

  • [x] I have searched for existing issues search for existing issues, including closed ones.
  • [x] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [x] [FOR CHINESE USERS] 请务必使用英文提交 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.

will it clean up database and uploaded files when delete knowledge base? how to do it?

2. Additional context or comments

No response

3. Can you help us with this feature?

  • [ ] I am interested in contributing to this feature.

terrysun1216 avatar Mar 11 '25 03:03 terrysun1216

Hello @terrysun1216! I'm here to assist you with any bugs, questions, or contributions you may have. I'll be here to help while you wait for a human maintainer.

Deleting the knowledge base will indeed clean up the database and uploaded files. This is handled by the clean_document_task function, which removes document segments and associated files from the database and storage when documents are deleted. The function ensures that both the database entries and the uploaded files are cleaned up, including additional cleanup of dataset process rules, queries, and app dataset joins [1][2][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] avatar Mar 11 '25 03:03 dosubot[bot]

@dosu when I update the document with a new text through api, the old txt file is not delete, causing large amount of file in S3.

kyleli666 avatar Mar 20 '25 09:03 kyleli666