Skip to content

About

Dify 知识库数据集控制插件,封装数据集列表、详情、创建、更新、删除和检索工具。

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

knowledge-control-datasets

项目概览

定位:面向 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

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.

What it does

  • Manage datasets in a workspace: create, update, delete, view detail, list all.
  • Test retrieval against a dataset with optional rerank settings.

Tools (one action per tool)

  • 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.

Credentials (provider-level)

  • api_base (optional): Defaults to https://api.dify.ai/v1. Point this to your self-hosted Dify API if needed.
  • api_key (required): Workspace API Key with dataset permissions.

Key behaviors / defaults

  • Embedding & rerank models: fields are optional. If left blank, Dify uses the workspace/dataset defaults.
  • Rerank mode options (dropdown): reranking_model or weighted_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.

Quick start (local debug)

  1. Install deps in your venv: pip install -r requirements.txt
  2. Configure credentials in Dify when adding the plugin (api_base/api_key).
  3. Run locally for debug: python -m main (or your IDE’s run command).
  4. In Dify, call the tool you need; no aggregator is required.

Typical workflows

  • 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-update to change search_method, top_k, rerank_enable/mode, thresholds.
  • Test: Use dataset-retrieve with a query to verify retrieval quality before wiring into an app.

Known limitations

  • 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.

Repo layout (key files)

  • 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).

Part of the knowledge-control family

This plugin focuses on datasets/knowledge bases. Other knowledge-control series plugins will manage adjacent capabilities; they can be installed independently.

About

Dify 知识库数据集控制插件,封装数据集列表、详情、创建、更新、删除和检索工具。

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages