Qianfan KnowledgeBase Search

👤 hannatao 📦 v1.0.1 ⭐ 4.3 ⬇️ 1.9K 下載
📚 知識管理 免費 🔑 需 API Key

📖 技能介紹


name: qianfan-knowledgebase-search description: Search knowledge from Qianfan Knowledgebase. Use this when you need to retrieve information from user's private knowledge bases on Baidu Qianfan platform. metadata: { "openclaw": { "emoji": "📚", "requires": { "bins": ["python3"], "env":["BAIDU_API_KEY", "QIANFAN_KNOWLEDGEBASE_IDS"]},"primaryEnv":"BAIDU_API_KEY" } }


Qianfan Knowledgebase Search Skill

Search and retrieve knowledge from Baidu Qianfan platform knowledge bases. Supports semantic search, fulltext search, hybrid search, and reranking.

Workflow

  1. The skill executes the Python script located at search.py
  2. The script makes a POST request to the Qianfan Knowledgebase Search API
  3. The API returns structured search results with chunks, scores, and metadata

Environment Variables

env required description
BAIDU_API_KEY yes Qianfan platform API Key
QIANFAN_KNOWLEDGEBASE_IDS no Knowledgebase IDs, comma-separated (used if not specified in request)

Parameters

request body structure

param type required default description
query str yes Search query content
knowledgebase_ids list[str] no Knowledgebase ID list (uses env var if not specified)
top_k int no 6 Number of chunks to return, range [1, 40]
score_threshold float no 0.4 Score threshold for filtering, range [0, 1]
enable_graph bool no false Enable knowledge graph
enable_expansion bool no false Return expanded chunks
recall obj no Recall strategy configuration
+recall.type str no hybrid Recall type: fulltext/semantic/hybrid
+recall.top_k int no 100 Recall phase top_k, range [1, 400]
+recall.vec_weight float no 0.75 Vector weight when type=hybrid, range [0, 1]
rerank obj no Rerank configuration
+rerank.enable bool no true Enable reranking
+rerank.top_n int no 20 Rerank top_n, range [1, 40]

Note: Use flattened parameter names in input (e.g., recall_type, recall_top_k), the script will convert to nested structure automatically.

Example Usage

# Configure knowledgebase IDs via environment variable
export BAIDU_API_KEY="your_api_key"
export QIANFAN_KNOWLEDGEBASE_IDS="kb_id_1,kb_id_2"
python3 skills/qianfan-knowledgebase-search/search.py '{"query":"請介紹下千帆大模型知識庫"}'
# Or specify knowledgebase IDs in request parameters
python3 skills/qianfan-knowledgebase-search/search.py '{"query":"如何使用API","knowledgebase_ids":["kb_id_1","kb_id_2"],"top_k":10,"recall_type":"hybrid","rerank_enable":true}'

Response Structure

Response contains the following fields:

  • id: Request unique identifier
  • created_at: Request timestamp

    7w4.net收錄了海量優質技能外掛。

  • total_count: Total number of chunks returned
  • chunks: Chunk list
  • chunk_id: Chunk unique identifier
  • content: Chunk content (supports text/figure/table/graph types)
  • rerank: Rerank score and position
  • recall: Recall score and position
  • meta: Metadata (chunk_type, tokens, word_count, doc_info, etc.)
  • neighbors: Related chunks

Current Status

The Qianfan Knowledgebase Search skill is fully functional and can be used to retrieve knowledge from private knowledge bases on the Baidu Qianfan platform.

🤖 AI 評測

這個 Skill 質量不錯,專門用於在百度千帆平臺的知識庫裡搜尋資訊。它的工作原理清晰,文件寫得很詳細,即使是新手也能快速上手使用。程式碼執行穩定,錯誤處理完善,遇到問題時會給出明確的提示。不過它功能比較專一,只做知識庫檢索這一件事,而且使用前需要配置好 API 金鑰,對新手來說有一定門檻。總體來說功能實用、文件完善,是一個可靠的知識檢索工具。

📊 多維度評分

適應性4.2
規範性4
有效性4.6
可靠性4.2
可信度5

📁 包含檔案 (3 個)

📄 SKILL.md 3.4 KB
📄 _meta.json 147 B
📄 search.py 3.2 KB