Hybrid BM25 + vector search for Obsidian vaults with frontmatter awareness
Project description
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
uv tool install qkb-search # isolated install (like pipx / npm -g); or: pipx install qkb-search
ollama pull embeddinggemma
qkb ingest # index your vault (reads ~/.config/qkb/config.toml)
qkb query "certificate renewal" # hybrid search
qkb mcp # stdio MCP server for Claude Code / Desktop
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 locally via Ollama, 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 (once released)
qkb is a command-line tool, so install it into an isolated environment —
the same idea as pipx or npm i -g, and independent of whichever Python
happens to be active:
# Recommended (uv):
uv tool install qkb-search
uv tool install 'qkb-search[local]' # + in-process embeddings, no Ollama
# Run without installing:
uvx --from qkb-search qkb search "certificate renewal"
# Alternatives (pipx isolates like uv; plain pip drops into the current env):
pipx install qkb-search
pip install qkb-search
The package installs the qkb command. Requires Python ≥3.11 and, for local embeddings, Ollama with embeddinggemma pulled (multilingual, CPU-friendly; other models configurable).
No Ollama? Use the in-process provider
The [local] extra runs embeddings in-process via llama-cpp-python — no Ollama service required. Useful on a laptop used for occasional searches where a resident Ollama process isn't worth keeping around.
[embedding]
provider = "local"
The first qkb ingest downloads the GGUF (~300 MB, one-time, cached under ~/.cache/qkb/models/) and then embeds normally. Switching providers forces a full re-embed — run qkb ingest --full after changing provider.
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qkb_search-0.1.0.tar.gz.
File metadata
- Download URL: qkb_search-0.1.0.tar.gz
- Upload date:
- Size: 120.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
993a7b6353020cf102d5fc5f30c4a8114bc2aac9a8846072fc1a43763a495330
|
|
| MD5 |
439a42a4ad68ccb64ebff892b82bfb6d
|
|
| BLAKE2b-256 |
c9de26fb203f412e1d4bb5e136fe0ac73a25533196dbebe27a0d1113227aa043
|
Provenance
The following attestation bundles were made for qkb_search-0.1.0.tar.gz:
Publisher:
release.yml on miguelarios/qkb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qkb_search-0.1.0.tar.gz -
Subject digest:
993a7b6353020cf102d5fc5f30c4a8114bc2aac9a8846072fc1a43763a495330 - Sigstore transparency entry: 2193361953
- Sigstore integration time:
-
Permalink:
miguelarios/qkb@55ed39d3fcaafb94499863b2e7c3b5fdca66af48 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/miguelarios
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@55ed39d3fcaafb94499863b2e7c3b5fdca66af48 -
Trigger Event:
push
-
Statement type:
File details
Details for the file qkb_search-0.1.0-py3-none-any.whl.
File metadata
- Download URL: qkb_search-0.1.0-py3-none-any.whl
- Upload date:
- Size: 42.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
785d82a5dbbbdc38056b2677f183c1871eab8c3670dd167cda9ad563eac7f675
|
|
| MD5 |
fd86887a7feadfb672a461587d9f0269
|
|
| BLAKE2b-256 |
16707c21f5078449e9295e872078c153ccadfdd0db135eb65e02c8413f456eb1
|
Provenance
The following attestation bundles were made for qkb_search-0.1.0-py3-none-any.whl:
Publisher:
release.yml on miguelarios/qkb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qkb_search-0.1.0-py3-none-any.whl -
Subject digest:
785d82a5dbbbdc38056b2677f183c1871eab8c3670dd167cda9ad563eac7f675 - Sigstore transparency entry: 2193361967
- Sigstore integration time:
-
Permalink:
miguelarios/qkb@55ed39d3fcaafb94499863b2e7c3b5fdca66af48 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/miguelarios
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@55ed39d3fcaafb94499863b2e7c3b5fdca66af48 -
Trigger Event:
push
-
Statement type: