qkb
Provides a hybrid search engine for Obsidian vaults, enabling LLM agents to query notes with BM25 keyword and vector semantic search, metadata filtering, and sibling-document retrieval.
README
qkb — Query Knowledge Base
An on-device hybrid search engine for Obsidian vaults that understands YAML frontmatter metadata. Combines BM25 keyword search (SQLite FTS5) and vector semantic search (sqlite-vec) with metadata filtering, sibling-document surfacing, and two first-class interfaces: a CLI for humans and an MCP server for LLM agents.
Status: Phase 1 (ingest, search tiers 1–3, CLI, MCP stdio).
Quickstart
1. Install (isolated, like pipx / npm -g):
uv tool install qkb-search
2. Point qkb at your vault — create ~/.config/qkb/config.toml:
[vault]
path = "~/Documents/MyVault" # your Obsidian vault (read-only to qkb)
name = "MyVault" # used to build obsidian:// links
3. Opt notes in. Only notes whose frontmatter has a context and/or
source property are indexed — and an opted-in note also needs an id and
a parseable date (created or date):
---
id: f47ac10b-58cc-4372-a567-0e02b2c3d401
context: homelab
created: 2026-03-15
---
4. Index in two phases, then search:
qkb status # verify config, vault, and model resolve
qkb ingest # keyword index — fast, no model needed
qkb search "certificate renewal" # keyword (BM25) search works right away
qkb embed # compute vectors (downloads the model once; resumable)
qkb query "certificate renewal" # full hybrid (keyword + semantic) search
qkb mcp # stdio MCP server for Claude Code / Desktop
Indexing is split so nothing blocks for hours: qkb ingest builds the
keyword index in seconds (no model), so qkb search works immediately;
qkb embed then computes the vectors that power semantic/hybrid search.
qkb embed is resumable — Ctrl-C is safe, and re-running continues where
it left off — and qkb status shows how many vectors are still pending.
No separate service, no compile: embeddings run in-process via ONNX Runtime,
whose prebuilt wheels install with the package. The default model is
embeddinggemma-300M (multilingual — the same embedding model
QMD uses), cached after the first download.
Re-running qkb ingest/qkb embed is incremental: unchanged notes are skipped
and only new/changed chunks get embedded, so it's cheap to keep up to date.
Claude Code MCP registration:
claude mcp add qkb -- qkb mcp
Documents
- PRD — what we're building and why
- Technical Design — architecture, schema, search algorithms
- Architecture Decision Records — the decision log
- Implementation Plans — milestone-by-milestone build plan
The Short Version
Notes opt in to indexing via frontmatter (context and/or source properties). An ingestion pipeline walks the vault, chunks markdown with structure-aware break-point scoring, embeds in-process (fastembed/ONNX by default; Ollama or GGUF optional), and stores everything in a single SQLite file. A search engine layers BM25 (document-level, weighted columns), vector similarity (chunk-level), and Reciprocal Rank Fusion on top — exposed as qkb search / vsearch / query, qkb get <UUID>, and qkb mcp.
Inspired by QMD's search architecture, adapted for structured knowledge systems with frontmatter metadata.
Installation
qkb is a command-line tool, so install it into an isolated environment —
the same idea as pipx or npm i -g:
# Recommended (uv):
uv tool install qkb-search
# Run without installing:
uvx --from qkb-search qkb query "certificate renewal"
# Alternatives (pipx isolates like uv; plain pip uses the current env):
pipx install qkb-search
pip install qkb-search
That's the whole setup — no service, no compile. The default embedding provider runs in-process via fastembed / ONNX Runtime, whose prebuilt wheels ship with the package (the C/C++ work is done upfront by the wheel builders, the way QMD relies on node-llama-cpp's prebuilt native binaries). Requires Python ≥3.11.
The default model is embeddinggemma-300M — the same embedding model QMD
uses. GGUF (QMD) and ONNX (qkb) are just different packagings of the same
weights for different runtimes; search quality comes from the model, not the
file format. The ~310 MB quantized ONNX downloads once on first qkb ingest
and is cached.
Embedding providers
Three interchangeable providers, set via [embedding].provider:
| provider | how it runs | when to use |
|---|---|---|
local (default) |
in-process fastembed / ONNX (prebuilt wheels) | just works — no service, no compile |
ollama |
the Ollama HTTP API | you already run Ollama (e.g. a Linux box) |
gguf |
in-process llama-cpp-python (the [gguf] extra) |
you want a specific GGUF; compiles on install |
Switching provider or model changes the vectors, so run qkb ingest --full
afterward to re-embed. Any model in
fastembed's catalog
also works — e.g. a smaller/faster one:
# ~/.config/qkb/config.toml
[embedding]
provider = "local"
model = "sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2" # 384-dim, ~220 MB
dimension = 384
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。