{
  "schemaVersion": "1.0",
  "item": {
    "slug": "dify-kb-search",
    "name": "Dify Knowledge Base Search",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/xiaowenzhou/dify-kb-search",
    "canonicalUrl": "https://clawhub.ai/xiaowenzhou/dify-kb-search",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/dify-kb-search",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=dify-kb-search",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "scripts/list_datasets.py",
      "scripts/search.py"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/dify-kb-search"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/dify-kb-search",
    "agentPageUrl": "https://openagent3.xyz/skills/dify-kb-search/agent",
    "manifestUrl": "https://openagent3.xyz/skills/dify-kb-search/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/dify-kb-search/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Dify Knowledge Base Search Skill",
        "body": "🔍 Search your Dify Knowledge Base to get accurate, contextual answers\n\nThis skill enables AI agents to query Dify datasets for RAG (Retrieval-Augmented Generation) context retrieval. Perfect for knowledge base Q&A, documentation search, and contextual AI responses."
      },
      {
        "title": "✨ Features",
        "body": "List Knowledge Bases - Discover all available Dify datasets\nSmart Search - Query datasets with hybrid, semantic, or keyword search\nAuto-Discovery - Automatically find available datasets if ID not provided\nConfigurable Results - Adjust top-k, search method, and reranking\nError Handling - Graceful error messages for debugging\nZero Hardcoding - All configuration via environment variables"
      },
      {
        "title": "1. Configure Environment Variables",
        "body": "Set up in openclaw.json:\n\n{\n  \"env\": {\n    \"vars\": {\n      \"DIFY_API_KEY\": \"${DIFY_API_KEY}\",\n      \"DIFY_BASE_URL\": \"https://dify.example.com/v1\"\n    }\n  }\n}\n\nEnvironment Variables:\n\nVariableRequiredDefaultDescriptionDIFY_API_KEY✅ Yes-Your Dify API Key (from Settings → API)DIFY_BASE_URL❌ Nohttp://localhost/v1Your Dify instance base URL"
      },
      {
        "title": "2. Install Dependencies",
        "body": "pip3 install requests"
      },
      {
        "title": "dify_list",
        "body": "Lists all available knowledge bases (datasets) in your Dify instance.\n\nInvocation: dify_list tool\n\nExample Response:\n\n{\n  \"status\": \"success\",\n  \"count\": 2,\n  \"datasets\": [\n    {\n      \"id\": \"dataset-abc123\",\n      \"name\": \"Product Documentation\",\n      \"doc_count\": 42,\n      \"description\": \"All product guides and tutorials\"\n    },\n    {\n      \"id\": \"dataset-xyz789\",\n      \"name\": \"API Reference\",\n      \"doc_count\": 156,\n      \"description\": \"REST API documentation\"\n    }\n  ]\n}\n\nUsage:\n\n{}"
      },
      {
        "title": "dify_search",
        "body": "Searches a Dify Dataset for relevant context chunks.\n\nInvocation: dify_search tool (mapped to python3 scripts/search.py)\n\nParameters:\n\nParameterTypeRequiredDefaultDescriptionquerystring✅ Yes-Search query or questiondataset_idstring❌ NoAuto-discoverSpecific dataset ID to searchtop_kinteger❌ No3Number of results to returnsearch_methodstring❌ Nohybrid_searchSearch strategyreranking_enableboolean❌ NofalseEnable reranking for better results\n\nSearch Methods:\n\nhybrid_search - Combine semantic + keyword search (recommended)\nsemantic_search - Meaning-based similarity search\nkeyword_search - Exact keyword matching\n\nExample Usage:\n\n{\n  \"query\": \"How do I configure OpenClaw?\",\n  \"top_k\": 5\n}\n\n{\n  \"query\": \"API authentication methods\",\n  \"dataset_id\": \"dataset-xyz789\",\n  \"search_method\": \"semantic_search\",\n  \"reranking_enable\": true\n}\n\nExample Response:\n\n{\n  \"status\": \"success\",\n  \"query\": \"How do I configure OpenClaw?\",\n  \"dataset_id\": \"dataset-abc123\",\n  \"count\": 3,\n  \"results\": [\n    {\n      \"content\": \"To configure OpenClaw, edit the openclaw.json file...\",\n      \"score\": 0.8923,\n      \"title\": \"Installation Guide\",\n      \"document_id\": \"doc-001\"\n    },\n    {\n      \"content\": \"OpenClaw supports environment variables via...\",\n      \"score\": 0.8451,\n      \"title\": \"Configuration Options\",\n      \"document_id\": \"doc-002\"\n    }\n  ]\n}"
      },
      {
        "title": "📋 Complete Workflow Example",
        "body": "[\n  {\n    \"tool\": \"dify_list\",\n    \"parameters\": {}\n  },\n  {\n    \"tool\": \"dify_search\",\n    \"parameters\": {\n      \"query\": \"What are the system requirements?\",\n      \"top_k\": 5,\n      \"search_method\": \"hybrid_search\"\n    }\n  }\n]"
      },
      {
        "title": "Common Errors",
        "body": "ErrorSolutionMissing DIFY_API_KEYSet DIFY_API_KEY in environment variablesConnection refusedCheck DIFY_BASE_URL is correct and accessibleNo datasets foundVerify dataset exists in your Dify workspaceAPI request failedCheck network connectivity and API key permissions"
      },
      {
        "title": "Debug Mode",
        "body": "Run manually to see detailed errors:\n\nDIFY_API_KEY=your-key python3 scripts/search.py <<< '{\"query\":\"test\"}'"
      },
      {
        "title": "RAG Pipeline Integration",
        "body": "# Example: Use search results in AI response\nresults = dify_search(query, top_k=5)\ncontext = \"\\n\".join([r[\"content\"] for r in results[\"results\"]])\nfinal_prompt = f\"Answer based on context:\\n\\n{context}\\n\\nQuestion: {query}\""
      },
      {
        "title": "Multiple Datasets",
        "body": "For searching across multiple datasets, loop through them:\n\n{\n  \"query\": \"Find information about authentication\",\n  \"dataset_id\": \"dataset-api-docs\"\n}\n\nThen query another dataset separately."
      },
      {
        "title": "🔒 Security",
        "body": "Never commit API keys - Use environment variables or .env files\nRotate keys regularly - Generate new keys in Dify Settings\nRestrict access - Limit API key permissions where possible"
      },
      {
        "title": "📖 Implementation Details",
        "body": "This skill uses the Dify Dataset API:\n\nList Datasets: GET /v1/datasets\nSearch: POST /v1/datasets/{id}/retrieve\n\nFor API documentation, see: https://docs.dify.ai/reference/api-reference"
      },
      {
        "title": "📝 Changelog",
        "body": "v1.1.0 (2026-02-08):\n\n✅ Added search method selection (hybrid/semantic/keyword)\n✅ Added reranking support\n✅ Auto-discovery of datasets\n✅ Improved error handling\n✅ Removed hardcoded URLs (fully configurable)\n✅ Added detailed logging\n\nv1.0.0 (2026-02-06):\n\nInitial release\nBasic list and search functionality"
      }
    ],
    "body": "Dify Knowledge Base Search Skill\n\n🔍 Search your Dify Knowledge Base to get accurate, contextual answers\n\nThis skill enables AI agents to query Dify datasets for RAG (Retrieval-Augmented Generation) context retrieval. Perfect for knowledge base Q&A, documentation search, and contextual AI responses.\n\n✨ Features\nList Knowledge Bases - Discover all available Dify datasets\nSmart Search - Query datasets with hybrid, semantic, or keyword search\nAuto-Discovery - Automatically find available datasets if ID not provided\nConfigurable Results - Adjust top-k, search method, and reranking\nError Handling - Graceful error messages for debugging\nZero Hardcoding - All configuration via environment variables\n🚀 Quick Start\n1. Configure Environment Variables\n\nSet up in openclaw.json:\n\n{\n  \"env\": {\n    \"vars\": {\n      \"DIFY_API_KEY\": \"${DIFY_API_KEY}\",\n      \"DIFY_BASE_URL\": \"https://dify.example.com/v1\"\n    }\n  }\n}\n\n\nEnvironment Variables:\n\nVariable\tRequired\tDefault\tDescription\nDIFY_API_KEY\t✅ Yes\t-\tYour Dify API Key (from Settings → API)\nDIFY_BASE_URL\t❌ No\thttp://localhost/v1\tYour Dify instance base URL\n2. Install Dependencies\npip3 install requests\n\n🛠️ Tools\ndify_list\n\nLists all available knowledge bases (datasets) in your Dify instance.\n\nInvocation: dify_list tool\n\nExample Response:\n\n{\n  \"status\": \"success\",\n  \"count\": 2,\n  \"datasets\": [\n    {\n      \"id\": \"dataset-abc123\",\n      \"name\": \"Product Documentation\",\n      \"doc_count\": 42,\n      \"description\": \"All product guides and tutorials\"\n    },\n    {\n      \"id\": \"dataset-xyz789\",\n      \"name\": \"API Reference\",\n      \"doc_count\": 156,\n      \"description\": \"REST API documentation\"\n    }\n  ]\n}\n\n\nUsage:\n\n{}\n\ndify_search\n\nSearches a Dify Dataset for relevant context chunks.\n\nInvocation: dify_search tool (mapped to python3 scripts/search.py)\n\nParameters:\n\nParameter\tType\tRequired\tDefault\tDescription\nquery\tstring\t✅ Yes\t-\tSearch query or question\ndataset_id\tstring\t❌ No\tAuto-discover\tSpecific dataset ID to search\ntop_k\tinteger\t❌ No\t3\tNumber of results to return\nsearch_method\tstring\t❌ No\thybrid_search\tSearch strategy\nreranking_enable\tboolean\t❌ No\tfalse\tEnable reranking for better results\n\nSearch Methods:\n\nhybrid_search - Combine semantic + keyword search (recommended)\nsemantic_search - Meaning-based similarity search\nkeyword_search - Exact keyword matching\n\nExample Usage:\n\n{\n  \"query\": \"How do I configure OpenClaw?\",\n  \"top_k\": 5\n}\n\n{\n  \"query\": \"API authentication methods\",\n  \"dataset_id\": \"dataset-xyz789\",\n  \"search_method\": \"semantic_search\",\n  \"reranking_enable\": true\n}\n\n\nExample Response:\n\n{\n  \"status\": \"success\",\n  \"query\": \"How do I configure OpenClaw?\",\n  \"dataset_id\": \"dataset-abc123\",\n  \"count\": 3,\n  \"results\": [\n    {\n      \"content\": \"To configure OpenClaw, edit the openclaw.json file...\",\n      \"score\": 0.8923,\n      \"title\": \"Installation Guide\",\n      \"document_id\": \"doc-001\"\n    },\n    {\n      \"content\": \"OpenClaw supports environment variables via...\",\n      \"score\": 0.8451,\n      \"title\": \"Configuration Options\",\n      \"document_id\": \"doc-002\"\n    }\n  ]\n}\n\n📋 Complete Workflow Example\n[\n  {\n    \"tool\": \"dify_list\",\n    \"parameters\": {}\n  },\n  {\n    \"tool\": \"dify_search\",\n    \"parameters\": {\n      \"query\": \"What are the system requirements?\",\n      \"top_k\": 5,\n      \"search_method\": \"hybrid_search\"\n    }\n  }\n]\n\n🔧 Troubleshooting\nCommon Errors\nError\tSolution\nMissing DIFY_API_KEY\tSet DIFY_API_KEY in environment variables\nConnection refused\tCheck DIFY_BASE_URL is correct and accessible\nNo datasets found\tVerify dataset exists in your Dify workspace\nAPI request failed\tCheck network connectivity and API key permissions\nDebug Mode\n\nRun manually to see detailed errors:\n\nDIFY_API_KEY=your-key python3 scripts/search.py <<< '{\"query\":\"test\"}'\n\n📚 Integration Tips\nRAG Pipeline Integration\n# Example: Use search results in AI response\nresults = dify_search(query, top_k=5)\ncontext = \"\\n\".join([r[\"content\"] for r in results[\"results\"]])\nfinal_prompt = f\"Answer based on context:\\n\\n{context}\\n\\nQuestion: {query}\"\n\nMultiple Datasets\n\nFor searching across multiple datasets, loop through them:\n\n{\n  \"query\": \"Find information about authentication\",\n  \"dataset_id\": \"dataset-api-docs\"\n}\n\n\nThen query another dataset separately.\n\n🔒 Security\nNever commit API keys - Use environment variables or .env files\nRotate keys regularly - Generate new keys in Dify Settings\nRestrict access - Limit API key permissions where possible\n📖 Implementation Details\n\nThis skill uses the Dify Dataset API:\n\nList Datasets: GET /v1/datasets\nSearch: POST /v1/datasets/{id}/retrieve\n\nFor API documentation, see: https://docs.dify.ai/reference/api-reference\n\n📝 Changelog\n\nv1.1.0 (2026-02-08):\n\n✅ Added search method selection (hybrid/semantic/keyword)\n✅ Added reranking support\n✅ Auto-discovery of datasets\n✅ Improved error handling\n✅ Removed hardcoded URLs (fully configurable)\n✅ Added detailed logging\n\nv1.0.0 (2026-02-06):\n\nInitial release\nBasic list and search functionality"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/xiaowenzhou/dify-kb-search",
    "publisherUrl": "https://clawhub.ai/xiaowenzhou/dify-kb-search",
    "owner": "xiaowenzhou",
    "version": "1.1.1",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/dify-kb-search",
    "downloadUrl": "https://openagent3.xyz/downloads/dify-kb-search",
    "agentUrl": "https://openagent3.xyz/skills/dify-kb-search/agent",
    "manifestUrl": "https://openagent3.xyz/skills/dify-kb-search/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/dify-kb-search/agent.md"
  }
}