
Obsidian Hybrid Search
io.github.flowing-abyss由 GitHub 账号 flowing-abyss 发布v0.17.4更新于 Nov 5, 2026
Search Obsidian vaults with hybrid full-text, fuzzy, semantic, and graph retrieval.
概览
为本地 Obsidian 仓库建立索引,让 AI 助手按关键词、语义、标题或链接关系检索笔记,并读取笔记及其元数据。
- 可以做什么
- 以混合、语义、全文或模糊标题模式检索笔记,并按文件夹、标签和 frontmatter 过滤
- 查找与某篇笔记语义相近的笔记,并按指定深度遍历出链与反向链接
- 按仓库相对路径读取一篇或多篇笔记,返回正文、标题、别名、标签、链接与反向链接
- 重建或更新索引,并查看索引状态、笔记数量与最近索引时间
- 适用场景
- 适合笔记存放在 Obsidian 仓库、希望助手基于自己的笔记而非粘贴文本作答的场景,也适合需要沿笔记间链接查找相关内容、从原始笔记中提取可引用上下文的场景。
- 运行要求
- 通过 npx 以 stdio 在本地运行,或作为共享的本地 HTTP 服务运行在 127.0.0.1:3939。需要 Node.js,并在 OBSIDIAN_VAULT_PATH 中提供仓库的绝对路径。本地嵌入可离线使用,但首次运行会下载约 117 MB 模型;远程嵌入需要 OPENAI_API_KEY,可选 OPENAI_BASE_URL 与 OPENAI_EMBEDDING_MODEL。启用重排序会额外下载模型。
安装
在 SourceWeft 中
- 打开 控制台中的 Obsidian Hybrid Search,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Obsidian Hybrid Search
[npm version] [Tests] [Total downloads]
[Obsidian Hybrid Search explains hybrid retrieval from Obsidian notes]
Your Obsidian vault already contains your best thinking. Obsidian Hybrid Search makes that thinking easier to find, reuse, and bring into AI-assisted work.
It gives your vault one retrieval engine and three practical ways to use it. The native Obsidian plugin gives you fast search, previews, similar notes, link discovery, and graph views while you write. The MCP server lets AI agents search and read your notes as tool calls. The CLI gives power users the same engine for indexing, filtering, reranking, reading, and scripting.
The search understands how real vaults are built. It combines semantic search, BM25 full text, fuzzy title and alias matching, tags, folders, frontmatter, wikilinks, backlinks, and similar-note lookup. You can search by idea, phrase, title, relationship, or metadata without remembering the exact words you wrote.
That turns Obsidian into a stronger personal knowledge system and a better starting point for AI work. Agents can begin from your own notes, pull cited context from source files, follow related material, and work with knowledge you already trust. OHS runs locally by default with SQLite, FTS5, sqlite-vec, RRF ranking, and optional OpenAI-compatible embedding APIs.
Search quality
Evaluated on the Obsidian Help vault (171 notes, 58 queries, local model):
¹ CPU (Apple Silicon), hybrid mode, no rerank. ² GPU (Apple Silicon Metal), LLM query expansion + reranking.
OHS uses Xenova/multilingual-e5-small. How to reproduce → · Full benchmark →
Real knowledge-vault benchmark
OHS is also evaluated on Andy Matuschak’s public evergreen notes, converted into an Obsidian vault with title-based note filenames, source URLs in frontmatter, local attachments, and 5,000+ internal note links across 1,357 notes.
The curated golden set includes 78 hand-judged queries across known-item lookup, paraphrases, quote fragments, ambiguous topics, citation lookup, and multi-note evidence.
Using the default local embedding model, OHS performs strongly on this dense note network.
The benchmark exercises retrieval over a highly connected real-world knowledge vault, including queries that do not simply repeat note titles.
Result JSON · Reproduce and interpret →
Large memory benchmark
To test retrieval on a larger public dataset,
LongMemEval-S
was converted into a 22,419-note Obsidian-style vault with 470 retrieval
queries. Using baai/bge-m3 embeddings, OHS ranked the answer-bearing notes
strongly:
For this benchmark, each query uses the LongMemEval-provided haystack as its search scope. That makes the result reproducible and easy to inspect query by query, while still exercising retrieval over a large generated memory vault.
Result JSON · Reproduce and interpret →
Features
- Hybrid search
- BM25 + fuzzy title + semantic embeddings, fused with RRF
- Alias search
- notes with
aliases:in frontmatter are indexed and searchable by any alias; alias matches are boosted in BM25 (weight 5×) and fuzzy title scoring
- notes with
- Four search modes
hybrid,semantic,fulltext,title(for text queries)
- Similar note lookup
- pass
--pathto find semantically related notes using stored chunk embeddings, with a title + content fallback
- pass
- Graph traversal
--path --relatedshows linked notes at configurable depth; filter by--direction outgoing|backlinks|both
- Links & backlinks
- every result includes outgoing links and backlinks
- Scope filtering
- restrict to subfolder(s); supports multiple values and exclusions (
-notes/dev/)
- restrict to subfolder(s); supports multiple values and exclusions (
- Tag filtering
- filter by tag(s); supports multiple values and exclusions (
-category/cs)
- filter by tag(s); supports multiple values and exclusions (
- Snippet control
--snippet-lengthsets the context window; empty snippets always fall back to note content
- Extended output
--extendedadds a TAGS/ALIASES column to the CLI table showing frontmatter tags (#tag) and aliases
- Incremental indexing
- only re-indexes changed files; watches for edits in real time
- Multi-query fan-out
- pass multiple queries at once (
ohs "q1" "q2"orqueries[]in MCP); results are merged via RRF, so a note that ranks well in any one query floats to the top; useful when the note may use different vocabulary than the query
- pass multiple queries at once (
- Cross-encoder reranking
--rerankre-scores results withgte-multilingual-reranker-base(ONNX int8, ~341 MB download once); improves precision for conceptual and multilingual queries; applied after multi-query merge
- Local embeddings
- works offline via
@huggingface/transformers(no API key required); default model: Xenova/multilingual-e5-small, 100+ languages
- works offline via
- Remote embeddings
- OpenAI-compatible API (OpenRouter, Ollama, etc.)
- Note reading
readfetches one or more notes by vault-relative path; returns full content with title, aliases, tags, links, and backlinks; on path miss returns top-3 fuzzy suggestions
- Ignore patterns
- exclude folders, extensions, or specific files
- Obsidian plugin
- native search modal inside Obsidian powered by the same CLI; see obsidian-hybrid-search-plugin
Installation
CLI usage
Quick start
The recommended setup is to set OBSIDIAN_VAULT_PATH once in ~/.zshrc or ~/.bashrc. This lets you run the CLI from any directory.
Open a new terminal and index the vault once.
You can now search from any directory.
Run from a vault
Alternatively, run the CLI without an environment variable from any directory inside your vault. It finds the vault root by walking up to the nearest .obsidian/ folder.
From outside the vault, set OBSIDIAN_VAULT_PATH or pass --db /path/to/vault/.obsidian-hybrid-search.db explicitly.
Optional remote embeddings
By default, the CLI uses the local Xenova/multilingual-e5-small model. It works offline without an API key, downloads about 117 MB on first use, and supports more than 100 languages.
To use a remote API, add its settings to your shell profile.
Search modes
The CLI supports four search modes called hybrid, fulltext, semantic, and title, plus graph traversal for linked notes. The commands below show how to use them, apply filters, rerank results, and control the output.
Shell aliases
Add to your ~/.zshrc or ~/.bashrc for quick access:
Then reload (source ~/.zshrc) and use:
Output example
Hybrid search returns a table with scores and snippets. Scores are color-coded by relevance:
With --extended, a TAGS/ALIASES column is added. Tags are prefixed with #, aliases are shown as-is:
Title mode omits the snippet column automatically.
MCP server
Most AI assistants operate without access to your personal knowledge and can only work with what you paste into the conversation. Adding this server gives any MCP-compatible assistant a persistent, searchable index of your entire vault. It becomes a tool call, not a copy-paste session: the assistant queries your notes the same way it calls any other tool, gets ranked results with snippets and links, and can navigate your knowledge graph on request.
Add to your MCP config (.mcp.json, claude_desktop_config.json, or equivalent for your client).
Minimal config (local embeddings, no API key)
Uses the built-in Xenova/multilingual-e5-small model. It works fully offline and supports 100+ languages. Downloads ~117 MB on first run.
Full config (OpenRouter)
Note: On first run,
npxwill install the package automatically. Ignore patterns are persisted in the database and restored on every subsequent startup even if the env var is missing.
Shared HTTP server
Use this when multiple MCP clients should share one long-lived search/indexing process.
Start or reuse the background server:
serve starts the MCP server over HTTP by default; serve --http is the explicit equivalent. The command prints the server URL, PID, log path, and a client config snippet. The default bind address is 127.0.0.1:3939.
Then add this to a URL-based MCP client config (.mcp.json, claude_desktop_config.json, or equivalent):
Manage the server:
HTTP mode uses stateless MCP Streamable HTTP. It does not issue or validate Mcp-Session-Id, so an MCP client can continue making tool calls after the daemon restarts even if it still sends a stale session header. This mode is intended for the server's request/response tools and does not provide persistent SSE streams, server-initiated notifications, or SSE resume.
If port 3939 is already in use, the command exits with an error instead of choosing another port automatically. Use --port for separate vaults.
When binding beyond localhost, allow every hostname or address that MCP clients will use.
Repeat --allowed-host for multiple values. You can also set a comma-separated list with OBSIDIAN_MCP_ALLOWED_HOSTS. The --allow-any-host option disables Host-header protection for trusted networks.
Available MCP tools
Set OBSIDIAN_PREFIX to add a prefix to every tool name. For example, myvault_ produces myvault_search and myvault_read. The prefix is empty by default.
Configuration
Ignore patterns
- Use
folder/**to ignore a directory and all its contents. - Use
*.canvasto ignore files by extension. - Use
exact/path.mdto ignore a specific file. - Use
**/node_modules/**to ignore a directory at any depth.
Root and nested .gitignore files are respected by default. Set OBSIDIAN_RESPECT_GITIGNORE=false to disable this behavior. Use OBSIDIAN_INCLUDE_PATTERNS to re-include Markdown notes that are ignored only by .gitignore. Include patterns do not override OBSIDIAN_IGNORE_PATTERNS or internal exclusions.
The database stores the ignore configuration and restores it when the server restarts, even if the environment variable is missing.
How it works
- Indexing splits notes by headings with a sliding-window fallback, creates embeddings, and stores the results in SQLite with FTS5 and
sqlite-vec. - Search runs BM25, fuzzy trigram title and alias search, and vector KNN search in parallel. BM25 uses weights of 10× for titles, 5× for aliases, and 1× for content. RRF then gives semantic and BM25 results a weight of 1.5× each, exact alias matches 2×, and partial fuzzy matches 0.25×. The final scores range from 0 to 1, where higher scores mean greater relevance.
- Links are resolved from wikilinks such as
[[note]], mapped to note paths, and stored. Every search result includeslinksandbacklinksarrays. - Watcher uses
chokidarto detect file changes and update the index in the background.
License
MIT
来源:README.md,提交 a450eff
工具
0版本历史
13- v0.17.4最新Nov 5, 2026
- v0.17.3Nov 4, 2026
- v0.17.2Oct 26, 2026
- v0.17.1Oct 25, 2026
- v0.16.4Oct 22, 2026
- v0.16.3Oct 19, 2026
- v0.16.2Oct 12, 2026
- v0.16.1Oct 5, 2026
- v0.16.0Sep 29, 2026
- v0.15.6Sep 21, 2026
- v0.15.5Sep 20, 2026
- v0.15.3Sep 17, 2026
- v0.15.2Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
