lorag — a private knowledge assistant for your notes
A Go CLI that indexes Apple Notes and local documents and answers questions with local models. Nothing leaves the machine.
Solution architecture
Scroll sideways to see the full diagram.
- Service
- Workflow
- Data
- External
The business problem
Notes and documents pile up across Apple Notes and folders, and finding something written months ago means remembering where it was saved. Cloud assistants solve search but require sending private notes to a third party.
What needed to be built
A complete retrieval-augmented generation (RAG) pipeline — ingestion, embeddings, vector index, retrieval and answer generation — that runs entirely on a laptop.
Engineering approach
Make retrieval-augmented generation work entirely on a laptop: export Apple Notes, parse PDFs and Markdown, embed and index them, and keep the setup simple enough to install with one command.
- 01
A single Go binary with three commands: setup starts Ollama and pulls models, sync exports notes and rebuilds the index, q answers a question.
- 02
Export Apple Notes to Markdown, read .txt, .md and .pdf files from one folder, then chunk and embed them with a local embedding model.
- 03
Store vectors in an embedded on-disk index (chromem-go), so there is no database server to run.
- 04
Answer questions by retrieving the closest chunks and passing them as context to a local chat model; the model is switchable from the CLI.
- 05
Distribute through a Homebrew tap and keep configuration in a small TOML file.
What this means for your business
This is the same architecture behind a company knowledge assistant: ingest your documents, index them, retrieve the right passages and answer with sources. For a business, the index lives in your cloud and connects to Drive, wikis or databases instead of Apple Notes.
Discuss a project like this