Xiao.Hu_19879 downloads调用本地混合检索服务(bge-small-zh 向量 + FTS5 全文 + RRF 融合),在 Obsidian 内进行中文语义搜索并跳转笔记.
Chinese semantic search inside Obsidian: the plugin calls a local hybrid retrieval service that you run yourself, fusing vector search (bge-small-zh) with SQLite FTS5 full-text search via RRF, and lets you jump straight to the matching note from the result card.
⚠️ Important dependency — this plugin is not self-contained It requires a local HTTP retrieval service listening on
http://127.0.0.1:8765. That service is not bundled with this plugin and is not started by it. Without the service running, the search panel opens but returns no results.
/health).The plugin calls exactly two endpoints:
| Method | Path | Purpose |
|---|---|---|
GET |
/health |
Health check: engine mode, indexed document count, last update time (used by Test connection and the status command) |
POST |
/search |
Semantic search; body {"query": "...", "top_k": 10, "filters": {"dirs": [...]}} |
The service is a plain-Python HTTP server listening only on 127.0.0.1:8765, backed by a retrieval library (KBSearcher / KBIndexer) that owns the vector index, the FTS5 index, and the local embedding model.
Start it on your own machine (either way):
# foreground, for debugging (the first run loads the local embedding model, 5–15s)
python3 scripts/kb_api_server.py
# or as a resident service (macOS launchd, auto-restart on crash)
launchctl load -w launchd/com.kbautomation.kb-api.plist
Verify it is up:
curl -s http://127.0.0.1:8765/health
Then set Service URL to http://127.0.0.1:8765 in the plugin settings and press Test connection to see the engine and index summary.
main.js, manifest.json, and styles.css from the latest release.<your vault>/.obsidian/plugins/kb-semantic-search/.Add the beta plugin repository Xiao-HU1987/obsidian-kb-semantic-search in BRAT.
This plugin is submitted to the official plugin directory through the Obsidian developer dashboard. Once published, search for KB Semantic Search in Browse → Community plugins.
| Setting | Description | Default |
|---|---|---|
| Service URL | Base URL of the retrieval service | http://127.0.0.1:8765 |
| Results per query | Number of results returned | 10 |
| Directory filter (optional) | Only search notes whose path contains one of these fragments (comma-separated); empty = whole vault | empty |
| Connection check | Reads /health and shows the engine and index summary |
— |
fetch to reach 127.0.0.1, which mobile clients cannot reach on your machine — hence isDesktopOnly: true.npm install
npm run build # type-check, then bundle main.ts into main.js at the repo root
npm run dev # watch mode
main.ts is the source of truth; main.js is the bundled CommonJS artifact built by esbuild (format: cjs, external: obsidian, minified for production).
MIT © 2026 huxiao
在 Obsidian 中做中文语义搜索:调用你本机自建的本地混合检索服务,融合向量检索(bge-small-zh)与 FTS5 全文检索(RRF 融合),结果卡片可直接跳转到对应笔记。
http://127.0.0.1:8765 上的本地检索服务;该服务不在插件内、也不会被插件启动。服务未运行时,面板能打开但没有结果。