定位:面向 Dify Marketplace 的知识库数据集管理插件,提供对数据集资源的统一工具封装。
核心功能:
- 列出、创建、更新和删除数据集
- 获取数据集详情与执行检索
- 提供多语言 README 与插件隐私说明
- 包含 Dify 插件 manifest 和发布工作流
技术栈:Python、Dify Plugin SDK、YAML Manifest、GitHub Actions;Python 环境建议使用 uv。
目录与模块:provider/ 定义插件 Provider;tools/ 放置各数据集操作工具;manifest.yaml 是插件元数据;readme/ 保存多语言说明。
使用方式:按 Dify 插件开发流程加载本插件;本地 Python 依赖使用 uv 根据 requirements.txt 管理。
配置说明:.env.example、manifest.yaml 和各 tools/*.yaml 描述运行所需参数。
适用场景:适合在 Dify 工作流中自动化管理知识库数据集。
注意事项:插件会访问 Dify 数据集接口,使用前需确认 API Key 权限和目标工作区。
Knowledge-control-datasets is the dataset management tool plugin in the knowledge-control series. It exposes the Dify “数据集/知识库” API as a set of small, composable tools: list, create, update, delete, inspect details, and test retrieval. Each action is a separate tool to keep user prompts simple and predictable.
- Author: StarsWhere
- Version: 0.0.1
- Type: Dify Tool Plugin (Python 3.12)
- License: Apache-2.0
- Repository: https://github.com/StarsWhere/knowledge-control-datasets
- Contact: starswherevip@gmail.com
- Manage datasets in a workspace: create, update, delete, view detail, list all.
- Test retrieval against a dataset with optional rerank settings.
datasets-list: List datasets with keyword/tag filter and pagination.datasets-create: Create a dataset; supports permission, indexing, embedding model, retrieval/rerank settings, summary index.dataset-detail: Get dataset detail by ID.dataset-delete: Delete a dataset by ID.dataset-update: Update dataset fields (same options as create).dataset-retrieve: Test search/retrieve chunks from a dataset.
api_base(optional): Defaults tohttps://api.dify.ai/v1. Point this to your self-hosted Dify API if needed.api_key(required): Workspace API Key with dataset permissions.
- Embedding & rerank models: fields are optional. If left blank, Dify uses the workspace/dataset defaults.
- Rerank mode options (dropdown):
reranking_modelorweighted_score. Leaving it empty keeps the dataset’s existing setting. - Retrieval options (
semantic_search,full_text_search,hybrid_search,keyword_search, top_k, score_threshold, rerank_enable) are optional; unset values do not override existing dataset settings.
- Install deps in your venv:
pip install -r requirements.txt - Configure credentials in Dify when adding the plugin (api_base/api_key).
- Run locally for debug:
python -m main(or your IDE’s run command). - In Dify, call the tool you need; no aggregator is required.
- Create a dataset: In
datasets-create, fill name and optional settings; leave embedding/rerank fields empty to use workspace defaults or fill them directly if you know the model ids. - Tune retrieval: Use
dataset-updateto changesearch_method,top_k,rerank_enable/mode, thresholds. - Test: Use
dataset-retrievewith a query to verify retrieval quality before wiring into an app.
- Dify tool forms are static; embedding/rerank fields cannot be auto-populated—enter model names manually or leave blank for defaults.
- Network access is required from the plugin runtime to reach your
api_base.
provider/knowledge-control-datasets.yaml— provider definition & credentials schema.tools/*.yaml— per-tool schemas and labels.tools/*.py— per-tool implementations.tools/common.py— shared HTTP client and helpers.LICENSE— Apache-2.0, Copyright 2026 StarsWhere (contact: starswherevip@gmail.com).
This plugin focuses on datasets/knowledge bases. Other knowledge-control series plugins will manage adjacent capabilities; they can be installed independently.