Can a download feature be added to the knowledge source ? #999

Closed
opened 2026-02-21 17:29:25 -05:00 by yindo · 3 comments
Owner

Originally created by @andylzming on GitHub (Jan 30, 2024).

Self Checks

Dify version

0.5.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Can a download feature be added to the knowledge source? Could we add a setting feature that allows administrators to configure download capabilities based on actual needs?

12

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @andylzming on GitHub (Jan 30, 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 file this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). ### Dify version 0.5.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Can a download feature be added to the knowledge source? Could we add a setting feature that allows administrators to configure download capabilities based on actual needs? ![12](https://github.com/langgenius/dify/assets/21255047/34e3f6e7-864b-4a58-b201-6fd515b4b0a6) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 💪 enhancement🐞 bug labels 2026-02-21 17:29:25 -05:00
yindo closed this issue 2026-02-21 17:29:25 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jan 30, 2024):

🤖

Hey there @andylzming! Nice to see you again. Hope everything is going well on your end.

Thank you for your suggestion to add a download feature to the knowledge source in the dify application. As a maintainer of the repository, I can confirm that it is technically possible to add such a feature.

The dify application already has a component named CSVDownload that uses the useCSVDownloader hook from the react-papaparse library to download CSV files. This component is used to create a download link that, when clicked, will download a CSV file with a specified name and data. You can find the relevant code in the CSVDownloader component.

Regarding the structure of the knowledge source, it is represented as a JSON object with two main properties: "icon" and "name". The "icon" property describes the SVG icon for the knowledge source, and the "name" property represents the name of the knowledge source. You can find the relevant code in the Knowledge.json file.

As for the current functionality of the knowledge source, I wasn't able to find an answer within the repository. However, the data for the knowledge source is stored in a database and retrieved using the DatasetRetrieverTool or DatasetMultiRetrieverTool depending on the retrieval strategy. You can find the relevant code in the DatasetRetrievalFeature class.

Finally, the knowledge source is accessed through a React component named 'Knowledge', which imports data from the 'Knowledge.json' file and uses it to render an SVG icon. You can find the relevant code in the Knowledge component.

I hope this information is helpful. If you have any further questions or need more clarification, please don't hesitate to ask.

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

@dosubot[bot] commented on GitHub (Jan 30, 2024): _🤖_ <!-- Greeting --> Hey there @andylzming! Nice to see you again. Hope everything is going well on your end. <!-- Answer --> Thank you for your suggestion to add a download feature to the knowledge source in the dify application. As a maintainer of the repository, I can confirm that it is technically possible to add such a feature. The dify application already has a component named `CSVDownload` that uses the `useCSVDownloader` hook from the `react-papaparse` library to download CSV files. This component is used to create a download link that, when clicked, will download a CSV file with a specified name and data. You can find the relevant code in the [CSVDownloader component](https://github.com/langgenius/dify/blob/main/web/app/components/app/annotation/batch-add-annotation-modal/csv-downloader.tsx). Regarding the structure of the knowledge source, it is represented as a JSON object with two main properties: "icon" and "name". The "icon" property describes the SVG icon for the knowledge source, and the "name" property represents the name of the knowledge source. You can find the relevant code in the [Knowledge.json file](https://github.com/langgenius/dify/blob/main/web/app/components/base/icons/src/public/header-nav/knowledge/Knowledge.json). As for the current functionality of the knowledge source, I wasn't able to find an answer within the repository. However, the data for the knowledge source is stored in a database and retrieved using the DatasetRetrieverTool or DatasetMultiRetrieverTool depending on the retrieval strategy. You can find the relevant code in the [DatasetRetrievalFeature class](https://github.com/langgenius/dify/blob/main/api/core/features/dataset_retrieval.py). Finally, the knowledge source is accessed through a React component named 'Knowledge', which imports data from the 'Knowledge.json' file and uses it to render an SVG icon. You can find the relevant code in the [Knowledge component](https://github.com/langgenius/dify/blob/main/web/app/components/base/icons/src/public/header-nav/knowledge/Knowledge.tsx). I hope this information is helpful. If you have any further questions or need more clarification, please don't hesitate to ask. ## Sources - [web/app/components/app/annotation/batch-add-annotation-modal/csv-downloader.tsx](https://github.com/langgenius/dify/blob/main/web/app/components/app/annotation/batch-add-annotation-modal/csv-downloader.tsx) - [web/app/components/base/icons/src/public/header-nav/knowledge/Knowledge.json](https://github.com/langgenius/dify/blob/main/web/app/components/base/icons/src/public/header-nav/knowledge/Knowledge.json) - [api/core/features/dataset_retrieval.py](https://github.com/langgenius/dify/blob/main/api/core/features/dataset_retrieval.py) - [web/app/components/base/icons/src/public/header-nav/knowledge/Knowledge.tsx](https://github.com/langgenius/dify/blob/main/web/app/components/base/icons/src/public/header-nav/knowledge/Knowledge.tsx) --- This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot.
Author
Owner

@crazywoola commented on GitHub (Jan 30, 2024):

Consider the issue of data security, we might not add this feature. There might be a potential risk of data leak which allow the user to retrieve the data they shouldn't be able to get.

@crazywoola commented on GitHub (Jan 30, 2024): Consider the issue of data security, we might not add this feature. There might be a potential risk of data leak which allow the user to retrieve the data they shouldn't be able to get.
Author
Owner

@andylzming commented on GitHub (Jan 31, 2024):

Consider the issue of data security, we might not add this feature. There might be a potential risk of data leak which allow the user to retrieve the data they shouldn't be able to get.

Could we add a setting feature that allows administrators to configure download capabilities based on actual needs?

@andylzming commented on GitHub (Jan 31, 2024): > Consider the issue of data security, we might not add this feature. There might be a potential risk of data leak which allow the user to retrieve the data they shouldn't be able to get. Could we add a setting feature that allows administrators to configure download capabilities based on actual needs?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#999