A local-first file chat, without the cloud
LocalLens turns any folder into a private brain. Ask questions, get cited answers — all on your machine. Built with Bun, TypeScript, and the QVAC SDK.
bun run cli examples/sample-brain "your question"Sample brain
12 files · indexed locally
The whole loop, in eight TypeScript files
File discovery, chunking, retrieval, prompting, completion, persistence, and two entry points. Small enough to teach, complete enough to extend.
File discovery
Walks any folder, filters by safe extensions, ignores caches and lockdirs, normalizes paths for the browser file picker.
Local RAG
QVAC ragChunk + ragIngest + ragSearch produce grounded retrieval — no cloud vector database, no API keys.
On-device inference
QWEN3 1.7B (Q4) for chat, GTE-Large FP16 for embeddings. Ships with a 600M fallback for slimmer machines.
Cited answers
Every answer carries bracketed citations linking back to the exact source chunk in the original file.
Plain JSON store
Brains and chunks persist to .locallens/store.json. Inspect them with cat, ship them in a backup, diff them in git.
CLI + Browser
Two entry points over the same core. Prove the pipeline in a terminal, then host it on Bun.serve for a real UI.
Local AI by design
Files never leave the machine
QVAC runs models locally. Ingestion and search happen in process — no document is uploaded anywhere.
Answers stay grounded
The prompt builder forces the model to cite retrieved chunks or admit it doesn't know. No hallucinated paths.
Cloud-optional
Drop the network and LocalLens still works. Add a tunnel later if you want to share a brain with a teammate.
Small enough to read
Eight TypeScript files in src/ split by responsibility. Read the whole codebase in an afternoon.