Small Obsidian-to-Memvid importer plus local search and Q&A helpers for local-first knowledge retrieval.
This repo is built on Memvid:
- Homepage: https://memvid.com
- Docs: https://docs.memvid.com
- Repository: https://github.com/memvid/memvid
import.py: ingest an Obsidian vault intoknowledge.mv2find.py: search that memory with the same Ollama embedding model used during ingestionask.py: retrieve relevant chunks, then answer with a local Ollama LLM
Everything here uses the Python SDK plus local Ollama. No memvid CLI is required.
This makes the repo portable and avoids the current CLI limitation around querying memories built with mxbai-embed-large.
- Python 3.8+
- Ollama installed and running
mxbai-embed-largepulled locally for embeddingsqwen3.5:4bpulled locally for answer synthesis- dependencies from
requirements.txt
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
ollama pull mxbai-embed-large
ollama pull qwen3.5:4b
ollama servepython3 import.py --vault-path /absolute/path/to/your/obsidian-vault --memory-path knowledge.mv2What the importer does:
- scans
.mdand.txtfiles - skips
.obsidian - parses YAML frontmatter
- preserves common frontmatter date fields as
created_atandupdated_at - splits large notes into smaller chunks before embedding
- embeds chunks with local Ollama using
mxbai-embed-large - logs failed chunks and continues
Rebuild from scratch:
rm -f knowledge.mv2
python3 import.py --vault-path /absolute/path/to/your/obsidian-vault --memory-path knowledge.mv2If some chunks are too large for the embedder, the importer logs the failures and keeps going.
Basic search:
python3 find.py --memory-path knowledge.mv2 --query "config"Search and show the aggregated retrieval context:
python3 find.py --memory-path knowledge.mv2 --query "config" --show-contextForce lexical-only search if you want a pure text lookup without embeddings:
python3 find.py --memory-path knowledge.mv2 --query "config" --mode lexBasic local Q&A:
python3 ask.py --memory-path knowledge.mv2 --question "Why is determinism important?"Show the retrieved evidence too:
python3 ask.py --memory-path knowledge.mv2 --question "What themes show up across my notes?" --show-sourcesRetrieval-only mode:
python3 ask.py --memory-path knowledge.mv2 --question "What is PersonaSphere?" --context-only --show-sourcesBoth query helpers expose Memvid replay filters.
Results as they were at frame 100:
python3 find.py --memory-path knowledge.mv2 --query "config" --as-of-frame 100
python3 ask.py --memory-path knowledge.mv2 --question "What changed?" --as-of-frame 100Results as of a Unix timestamp:
python3 find.py --memory-path knowledge.mv2 --query "config" --as-of-ts 1704067200
python3 ask.py --memory-path knowledge.mv2 --question "What changed?" --as-of-ts 1704067200Note: --as-of-ts uses Memvid frame timestamps, not your note frontmatter dates.
Import:
--memory-path: output.mv2path. Default:knowledge.mv2--ollama-model: embedding model. Default:mxbai-embed-large--ollama-url: Ollama base URL. Default:OLLAMA_HOSTorhttp://localhost:11434--batch-size: notes per batch. Default:25--chunk-size: max chars per chunk. Default:800--chunk-overlap: overlap between chunks. Default:80--failure-log: skipped-chunk log path. Default:import_failures.log--no-embeddings: import text and metadata only
Search and Q&A:
--mode:auto,lex,sem, orhybrid. Default:hybrid--top-k: retrieved chunk count. Default:8--snippet-chars: snippet size per hit. Default:480--ollama-embed-model: retrieval embedder. Default:mxbai-embed-large--ollama-url: Ollama base URL--as-of-frame: replay at or before a frame id--as-of-ts: replay at or before a Unix timestamp
Q&A only:
--ollama-llm: answer model. Default:qwen3.5:4b--ollama-timeout: generation timeout in seconds. Default:300--context-only: retrieval only, no answer synthesis--show-sources: print retrieved hits after the answer
- generated
.mv2files are gitignored - log files are gitignored
- entries are labeled as
obsidian - top-level vault folders are also stored as labels
- frontmatter tags are preserved as both tags and
frontmatter_tagsmetadata - chunk metadata is stored as
chunk_indexandchunk_totalwhen a note is split --as-of-tsreplays by Memvid frame timestamp, not note frontmatter date metadata
Check installed local models:
ollama listIf some notes are too large for the embedding model, the importer logs the skipped chunks and continues:
cat import_failures.logIf Ollama is running somewhere else:
python3 import.py --vault-path /absolute/path/to/your/obsidian-vault --ollama-url http://localhost:11434
python3 find.py --memory-path knowledge.mv2 --query "config" --ollama-url http://localhost:11434
python3 ask.py --memory-path knowledge.mv2 --question "Why is determinism important?" --ollama-url http://localhost:11434MIT