Local RAG over a markdown notes directory. Multilingual embeddings (offline after first download) + cosine search + optional answer generation via your local LLM.
cd /home/jooyu/notes-rag
uv venv && source .venv/bin/activate
uv pip install -e '.[dev]'First run downloads the embedding model (~80MB).
# Index a notes directory
notes-rag index ~/notes --rebuild
# Pure semantic search (no LLM needed)
notes-rag search "WSL에서 로컬 LLM 접근하는 법"
# RAG answer (requires local LLM at base-url)
HOST=$(ip route show default | awk '{print $3}')
notes-rag ask "내가 정리한 cloudflared 설정 핵심이 뭐였지?" \
--base-url "http://$HOST:4000/v1" --model darwin
notes-rag statussrc/notes_rag/
chunker.py # heading-aware markdown chunker
embedder.py # sentence-transformers wrapper (cached)
index_store.py # SQLite (metadata) + .npy (vectors)
indexer.py # walk + chunk + embed + persist
searcher.py # cosine top-k
chat.py # OpenAI-compatible LLM call with retrieved context
cli.py # typer: index | search | ask | status | version
- Embedding model:
paraphrase-multilingual-MiniLM-L12-v2(good Korean+English at small size) - Index dir:
.notes-rag/in cwd - LLM endpoint:
http://172.24.0.1:4000/v1(WSL→Windows host)
- The index is append-only by default. Use
--rebuildto wipe. - All vectors are normalized; cosine = dot product.
- For larger corpora swap the model for
BAAI/bge-m3and update the embedding dim by re-indexing.