Dify Knowledge Base Search for Openclaw

Search and retrieve contextual data from Dify datasets to power high-accuracy RAG workflows for AI agents.

xiaowenzhou
v1.1.1
Feb 8, 2026
1
2.2k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install dify-kb-search

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install dify-kb-search using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Dify Knowledge Base Search?

The Dify Knowledge Base Search skill provides a robust interface for AI agents to interact with Dify datasets. It allows agents to perform Retrieval-Augmented Generation (RAG) by fetching precise information from uploaded documentation, wikis, or product guides. By leveraging this tool within the ecosystem of Openclaw Skills, developers can ensure their agents provide answers that are grounded in specific, up-to-date business data rather than relying solely on pre-trained model knowledge.

This skill automates the process of finding and querying knowledge bases, supporting multiple search strategies including semantic, keyword, and hybrid methods. It is an essential component for building technical support bots, research assistants, and any AI application requiring high-fidelity information retrieval from private or curated datasets.

Dify Knowledge Base Search Use Cases

  • Automating customer support by searching internal product documentation for accurate answers.
  • Powering technical research agents that need to query specific API references or codebase documentation.
  • Enhancing RAG pipelines with hybrid search and reranking to improve context quality.
  • Dynamic discovery of available datasets within a Dify workspace to handle diverse user queries.

How Dify Knowledge Base Search Works

  1. The skill connects to your Dify instance using the configured API key and base URL.
  2. When a search is triggered, the agent can first use the list tool to identify relevant knowledge bases if a specific ID isn't provided.
  3. The search tool sends a retrieval request to the Dify API, utilizing parameters like query string, top-k results, and preferred search method.
  4. Dify processes the request using its vector database and returns the most relevant text chunks along with metadata and confidence scores.
  5. The skill parses these results into a structured format, allowing the AI agent to incorporate the findings directly into its response context.

Dify Knowledge Base Search Setup

To get started with this skill, ensure you have Python 3 installed. You must also install the requests library to handle API communication:

pip3 install requests

Next, configure your environment variables in your configuration file. You will need your Dify API Key and the base URL for your Dify instance:

{
  "env": {
    "vars": {
      "DIFY_API_KEY": "your_api_key_here",
      "DIFY_BASE_URL": "https://api.dify.ai/v1"
    }
  }
}

Dify Knowledge Base Search Data Schema & Taxonomy

The skill interacts with the Dify Dataset API and returns data structured for easy ingestion by AI agents. Below is the primary data structure for search results:

Property Type Description
content String The text fragment retrieved from the knowledge base.
score Float The similarity or relevance score of the result.
title String The name of the source document containing the chunk.
document_id String The unique identifier for the source file in Dify.
dataset_id String The ID of the knowledge base that provided the result.

Dify Knowledge Base Search Advanced Features

  • Hybrid Search Support: Combines semantic vector search with keyword matching for superior retrieval accuracy.
  • Dataset Auto-Discovery: Automatically identifies and queries the most appropriate knowledge base if no specific ID is defined.
  • Reranking Integration: Supports Dify reranking models to further refine the relevance of the top-k results.
  • Flexible Configuration: Fully customizable search parameters including top-k limits and specific search strategies per query.
  • Integration Ready: Designed to fit seamlessly into any complex RAG workflow utilizing Openclaw Skills.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*