← 返回 Skills 市场
kadbbz

Knowledge Base with Faiss and Bailian (embedding and rerank)

作者 宁伟 · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ 安全检测通过
165
总下载
1
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install rag-kb
功能描述
使用 Python、FAISS、BM25、阿里云百炼 text-embedding-v4 与可选的 qwen3-rerank,维护基于文件目录的本地知识库;适用于在 OpenClaw 预先抽取文本后,遍历 chunks 与 T2Q 建立索引,以及对指定知识库或全部知识库做综合、语义或关键词查询。
安全使用建议
This skill appears to do what it says: it builds and queries a local FAISS + BM25 knowledge base and sends text only to the Bailian embedding/rerank endpoints using the BAILIAN_SK key. Before installing: (1) confirm the registry metadata is corrected so the required environment variable (BAILIAN_SK) is clearly declared; (2) only provide a Bailian key you trust—embeddings and rerank calls send text to Bailian over HTTPS; (3) run the script in a controlled environment because it will read and write all files under the KB root (default /var/openclaw-kb); (4) review the included Python script (scripts/bailian_faiss_kb.py) yourself if you need to ensure no additional telemetry or unexpected network calls; and (5) if you cannot trust the Bailian endpoint or do not want external embeddings, do not provide the API key or avoid invoking the index/query operations that require network calls.
功能分析
Type: OpenClaw Skill Name: rag-kb Version: 1.0.1 The skill bundle implements a local RAG (Retrieval-Augmented Generation) system using FAISS for semantic search and BM25 for keyword search. The Python script `scripts/bailian_faiss_kb.py` handles indexing, querying, and maintenance of a knowledge base stored in a local directory (defaulting to `/var/openclaw-kb`). It communicates exclusively with Alibaba Cloud's DashScope API (`dashscope.aliyuncs.com`) for text embeddings and reranking, using the `BAILIAN_SK` environment variable for authentication. The documentation in `SKILL.md` and the `references/` directory provides clear, non-malicious instructions for the agent to manage file layouts and content formatting. No evidence of data exfiltration, unauthorized execution, or prompt injection was found.
能力评估
Purpose & Capability
Name/description match the actual behavior: Python script builds/queries local FAISS and BM25 indices and uses Bailian embedding/rerank endpoints. Required binary (python3) and the primary credential (BAILIAN_SK) are appropriate for this purpose.
Instruction Scope
SKILL.md and the script stay within the described scope: they read/write under the KB root (default /var/openclaw-kb), build indices, and make HTTPS requests only to the declared Bailian endpoints for embeddings and reranking. The skill documents that it does not execute shells, download remote scripts, or open network services; the provided script appears consistent with that statement.
Install Mechanism
This is an instruction-only skill with a Python script and a pip requirements.txt. No external installers or arbitrary URL downloads are used. Dependencies include faiss-cpu, numpy, jieba, and requests which are expected for this functionality.
Credentials
Functionally the only secret needed is the Bailian API key (script checks BAILIAN-SK or BAILIAN_SK), which fits the purpose. However, registry metadata lists 'Required env vars: none' while the skill declares a primaryEnv of BAILIAN_SK and the code requires it; this metadata inconsistency should be resolved before trusting automatic installs or export of credentials.
Persistence & Privilege
The skill does not request always:true and does not modify other skills or system-wide agent settings. It will create and update files under the KB root (vectors.jsonl, index.faiss, bm25.json, manifest.json, protected_terms.json), which is expected behavior for a local KB manager.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install rag-kb
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /rag-kb 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
Version 1.0.1 - Added BM25 支持,实现综合 (hybrid) 检索;支持关键词检索(BM25)与语义检索(FAISS)。 - 新增知识库保护词(protected_terms.json)机制,可通过 protect-add / protect-delete 管理保护词并离线刷新 BM25 工件。 - 支持全量重建知识库索引(rebuild),同时刷新语义与 BM25 索引。 - 查询支持 retrieval-mode 选择(hybrid/semantic/keyword),默认使用 hybrid 。 - 运行规则细化:明确 skill 仅消费文本文件,不再负责文件转文本。 - 文档与目录结构调整,突出“先转文本、后索引”的规范。
v1.0.0
bailian_faiss_kb 1.0.0 – Initial release - Provides local knowledge base management using Python, FAISS, Markdown, and Aliyun Bailian for embeddings. - Converts uploaded files to Markdown, traverses knowledge base directories, and creates/updates vector indexes with FAISS. - Supports semantic queries on specified or all knowledge bases, with optional Qwen3 rerank for higher accuracy. - Enforces strict file and directory structure, with clear roles split between OpenClaw and Python components. - Prioritizes security: only operates on local files and explicit paths, and only communicates with official Aliyun endpoints as needed. - Includes detailed operation rules, format protocols, and command examples for all lifecycle stages (convert, index, delete, query).
元数据
Slug rag-kb
版本 1.0.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

Knowledge Base with Faiss and Bailian (embedding and rerank) 是什么?

使用 Python、FAISS、BM25、阿里云百炼 text-embedding-v4 与可选的 qwen3-rerank,维护基于文件目录的本地知识库;适用于在 OpenClaw 预先抽取文本后,遍历 chunks 与 T2Q 建立索引,以及对指定知识库或全部知识库做综合、语义或关键词查询。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 165 次。

如何安装 Knowledge Base with Faiss and Bailian (embedding and rerank)?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install rag-kb」即可一键安装,无需额外配置。

Knowledge Base with Faiss and Bailian (embedding and rerank) 是免费的吗?

是的,Knowledge Base with Faiss and Bailian (embedding and rerank) 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Knowledge Base with Faiss and Bailian (embedding and rerank) 支持哪些平台?

Knowledge Base with Faiss and Bailian (embedding and rerank) 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Knowledge Base with Faiss and Bailian (embedding and rerank)?

由 宁伟(@kadbbz)开发并维护,当前版本 v1.0.1。

💬 留言讨论