← Back to Skills Marketplace
kadbbz

Knowledge Base with Faiss and Bailian (embedding and rerank)

by 宁伟 · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ Security Clean
165
Downloads
1
Stars
0
Active Installs
2
Versions
Install in OpenClaw
/install rag-kb
Description
使用 Python、FAISS、BM25、阿里云百炼 text-embedding-v4 与可选的 qwen3-rerank,维护基于文件目录的本地知识库;适用于在 OpenClaw 预先抽取文本后,遍历 chunks 与 T2Q 建立索引,以及对指定知识库或全部知识库做综合、语义或关键词查询。
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install rag-kb
  3. After installation, invoke the skill by name or use /rag-kb
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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).
Metadata
Slug rag-kb
Version 1.0.1
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 2
Frequently Asked Questions

What is Knowledge Base with Faiss and Bailian (embedding and rerank)?

使用 Python、FAISS、BM25、阿里云百炼 text-embedding-v4 与可选的 qwen3-rerank,维护基于文件目录的本地知识库;适用于在 OpenClaw 预先抽取文本后,遍历 chunks 与 T2Q 建立索引,以及对指定知识库或全部知识库做综合、语义或关键词查询。 It is an AI Agent Skill for Claude Code / OpenClaw, with 165 downloads so far.

How do I install Knowledge Base with Faiss and Bailian (embedding and rerank)?

Run "/install rag-kb" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Knowledge Base with Faiss and Bailian (embedding and rerank) free?

Yes, Knowledge Base with Faiss and Bailian (embedding and rerank) is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Knowledge Base with Faiss and Bailian (embedding and rerank) support?

Knowledge Base with Faiss and Bailian (embedding and rerank) is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Knowledge Base with Faiss and Bailian (embedding and rerank)?

It is built and maintained by 宁伟 (@kadbbz); the current version is v1.0.1.

💬 Comments