tiangong-ai/skills

dify-knowledge-base-search

Dify dataset retrieve API for knowledge base chunk search/testing. Use when integrating or debugging Dify knowledge base retrieval requests, retrieval_model options, or response shaping.

First seen Feb 7, 2026

Installation

$ npx skills add tiangong-ai/skills --skill dify-knowledge-base-search

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from tiangong-ai/skills · top by installs.

npx skills add tiangong-ai/skills

Browse all from tiangong-ai/skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 9
License LICENSE
Default branch main
Open issues 3
Status Active

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,690 B
  • docs SUMMARY.md 220 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 112 installs

SKILL.md

Dify Knowledge Base Search

Prepare required inputs

  • Provide data as JSON containing query and optional retrievalmodel.topk.
  • Read these env vars:

- DIFYAPIBASEURL: base API URL and include /v1 (example: https://api.dify.ai/v1). - DIFYDATASETID: target dataset ID. - DIFYAPIKEY: send as Authorization: Bearer <DIFYAPI_KEY>.

Send request

  • Endpoint: ${DIFYAPIBASEURL}/datasets/${DIFYDATASET_ID}/retrieve
  • Headers:

- Content-Type: application/json - Authorization: Bearer <DIFYAPIKEY>

  • Use assets/example-request.json as the payload template.
curl -sS --location --request POST "$DIFY_API_BASE_URL/datasets/$DIFY_DATASET_ID/retrieve" \
  --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $DIFY_API_KEY" \
  --data @assets/example-request.json

Interpret response

  • Request shape: { "query": string, "retrievalmodel"?: { "topk": number } }
  • Success shape: 200 with { query, records: [...] }
  • If records is empty, increase retrievalmodel.topk moderately and retry.

Troubleshoot quickly

  • If auth fails, verify DIFYAPIKEY and Authorization header format.
  • If route fails, verify DIFYAPIBASE_URL includes /v1.
  • If results are low quality, refine query and tune top_k.

References

  • references/env.md
  • references/request-response.md
  • references/testing.md

Assets

  • assets/example-request.json