Skip to main content

vault-ask

CI License: MIT Python 3.9+ Zero dependencies

Ask your Obsidian vault with fail-closed citation validation.

A small, dependency-free question-answering tool over a folder of Markdown notes. It finds relevant notes, asks your LLM to answer only from those excerpts, and fails closed unless the output contains an exact [[wikilink]] copied from the selected source set.

$ vault-ask "what did I decide about the pricing model?"
Q: what did I decide about the pricing model?

Flat 49 EUR/month, no per-seat pricing, decided after the churn analysis.
[[Decisions/2026-Pricing|2026-Pricing]]

Notes consulted:
- [[Decisions/2026-Pricing|2026-Pricing]]
- [[Meetings/2026-01-pricing-review|2026-01-pricing-review]]

When the model emits the fixed refusal, returns no citation, or cites an unselected note, the validator returns the canonical refusal instead:

$ vault-ask "what is my bank account number?"
Q: what is my bank account number?

No note in the vault answers this question.

Why

A second brain is only useful if knowledge comes back out. Many "chat with your notes" tools require a vector database and an indexing pipeline. vault-ask instead uses no index or database: it runs ripgrep over your vault, ranks notes by term rarity, and hands focused excerpts to whatever LLM you already use.

How it works

  1. Candidate search — ripgrep scans the whole vault in milliseconds.
  2. IDF ranking — notes are scored by the rarity of the query terms they contain, so a rare, specific word (a project codename) outweighs a word that appears in hundreds of notes. No embeddings, no index, no warm-up.
  3. Focused excerpts — only the headings and matching lines of the top notes are sent to the model (notes can be long).
  4. Constrained prompt — the model is instructed to cite its claims, avoid outside knowledge, and emit a fixed refusal when evidence is insufficient.
  5. Fail-closed output check — a non-refusal answer is accepted only when it contains at least one exact citation from the selected notes. Unknown or missing citations produce the fixed refusal.

This is a mechanical provenance check, not semantic entailment verification. A valid citation proves which selected note was referenced; it does not prove that the note supports every sentence in the answer.

In JSON output, the backward-compatible grounded field now means that exact selected-source citation validation passed. It does not mean semantic entailment was evaluated. Arbitrary paraphrases of refusal cannot be detected mechanically when they also contain a valid selected-source citation.

Nothing leaves your machine except what your own LLM command chooses to send.

Install

Requires Python 3.9+ and ripgrep (rg) on your PATH.

# pip (installs the `vault-ask` command)
pip install git+https://github.com/guillaumevele/vault-ask.git

Or run it as a single file, no install:

git clone https://github.com/guillaumevele/vault-ask.git
cd vault-ask
python3 vault_ask.py "your question"

No dependencies beyond the Python standard library and ripgrep.

Configure your LLM

vault-ask shells out to whatever LLM command you set in VAULT_ASK_LLM. The prompt is piped on stdin by default, or substituted for {prompt} if the command contains that placeholder.

# Local model via Ollama (prompt on stdin):
export VAULT_ASK_LLM='ollama run llama3.1'

# Simon Willison's `llm` CLI (any provider it supports):
export VAULT_ASK_LLM='llm -m gpt-4o-mini'

# A CLI that takes the prompt as an argument — use the {prompt} placeholder:
export VAULT_ASK_LLM='your-llm-cli --prompt {prompt}'

Point it at your vault once:

export OBSIDIAN_VAULT="$HOME/Obsidian/MyVault"

Usage

vault-ask "what did I decide about X?"
vault-ask --vault ~/notes "when is the contract renewal?"
vault-ask --limit 8 --json "summarize my pricing decisions"

No LLM? Use --sources-only to just rank the most relevant notes — a smart grep for your vault that needs no model at all:

vault-ask --sources-only "pricing model"
# Most relevant notes for: pricing model
# - [[Decisions/2026-pricing|2026-pricing]]
# - [[Meetings/2026-01-pricing-review|2026-01-pricing-review]]
Flag Default Description
--vault $OBSIDIAN_VAULT or . path to the vault
--limit 5 max notes to consult
--llm $VAULT_ASK_LLM LLM command (overrides env)
--sources-only off rank relevant notes, no LLM call
--json off raw structured output
--version print version

What it's good at — and what it isn't

Good at: factual lookups where the words of your question point at a note — decisions, numbers, names, "what did I say about …" — with selected-source citation validation and explicit abstention states.

Not good at: abstract questions whose vocabulary differs from your notes (you ask "my funding strategy", the note says "tax credit"). Keyword retrieval can miss semantically related notes, and an allowed citation can still accompany an unsupported claim. Semantic recall and entailment verification are outside this zero-dependency tool's current scope.

Tests

python3 -m unittest discover -s tests

voice-to-vault is the other half of the loop: it routes your voice captures into the Obsidian vault that vault-ask then answers questions about. One files your thoughts, the other brings them back.

License

MIT — see LICENSE.

Metadata

Release files for vault-ask 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vault-ask 0.2.1
File Size Uploaded Provenance Actions
vault_ask-0.2.1.tar.gz 13.3 kB With provenance Details for vault_ask-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vault-ask 0.2.1
File Interpreter ABI Platform Actions
vault_ask-0.2.1-py3-none-any.whl Python 3 none any Details for vault_ask-0.2.1-py3-none-any.whl

Total release size: 24.6 kB

Release files / vault_ask-0.2.1.tar.gz

Download URL vault_ask-0.2.1.tar.gz
Size 13.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a6617fa177ae482a987714f99bba176df1d9c11d8934d10577ffaa935244543c
BLAKE2b-256 checksum
How to use checksums
71edef53b7049cbd49d598d7d1c206556911bd420499dd99104faf3222f88bf2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / vault_ask-0.2.1-py3-none-any.whl

Download URL vault_ask-0.2.1-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f3c09330510912f8585774f5d0af27ab6299277d02093e38055eb83370f285c5
BLAKE2b-256 checksum
How to use checksums
6d33bc96b89d6d1e6683757229ea5aba32b5f646e58ddc0707edc669a0a8fc24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Security for vault-ask 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for vault_ask-0.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page