Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

notes-rag

Local RAG over a markdown notes directory. Multilingual embeddings (offline after first download) + cosine search + optional answer generation via your local LLM.

Install

cd /home/jooyu/notes-rag
uv venv && source .venv/bin/activate
uv pip install -e '.[dev]'

First run downloads the embedding model (~80MB).

Use

# 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 status

Layout

src/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

Defaults

  • 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)

Notes

  • The index is append-only by default. Use --rebuild to wipe.
  • All vectors are normalized; cosine = dot product.
  • For larger corpora swap the model for BAAI/bge-m3 and update the embedding dim by re-indexing.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages