skillZs
★ LIVE SKILL TAGS ★
>>> LIVE SKILLS INDEX <<<
* OPEN SOURCE *
NO LOGIN, NO TRACKING
※ REAL INSTALL DATA ※
← back to all skills
tiangong-ai/agent-skills113 installs

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.

How do I install this agent skill?

npx skills add https://github.com/tiangong-ai/agent-skills --skill dify-knowledge-base-search
view source ↗

Is this agent skill safe to install?

  • Gen Agent Trust Hubpass

    The skill provides a standard interface for interacting with Dify's Knowledge Base API using environment variables for secure credential management. It is subject to a low risk of indirect prompt injection when processing data retrieved from the external API.

  • Socketpass

    No alerts

  • Snykwarn

    Risk: MEDIUM · 1 issue

What does this agent skill do?

Dify Knowledge Base Search

Prepare required inputs

  • Provide data as JSON containing query and optional retrieval_model.top_k.
  • Read these env vars:
    • DIFY_API_BASE_URL: base API URL and include /v1 (example: https://api.dify.ai/v1).
    • DIFY_DATASET_ID: target dataset ID.
    • DIFY_API_KEY: send as Authorization: Bearer <DIFY_API_KEY>.

Send request

  • Endpoint: ${DIFY_API_BASE_URL}/datasets/${DIFY_DATASET_ID}/retrieve
  • Headers:
    • Content-Type: application/json
    • Authorization: Bearer <DIFY_API_KEY>
  • 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, "retrieval_model"?: { "top_k": number } }
  • Success shape: 200 with { query, records: [...] }
  • If records is empty, increase retrieval_model.top_k moderately and retry.

Troubleshoot quickly

  • If auth fails, verify DIFY_API_KEY and Authorization header format.
  • If route fails, verify DIFY_API_BASE_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

Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.

<a href="https://skillzs.dev/skills/tiangong-ai/agent-skills/dify-knowledge-base-search">View dify-knowledge-base-search on skillZs</a>