LocalLens

What LocalLens does

Create a brain from a local folder, then ask grounded questions over its contents.

Pick a folder. LocalLens turns it into a brain — an index you can chat with. Ask a question, get an answer, and see exactly which chunks of which files the model leaned on.

You can drive it two ways:

  • the CLI, when you just want to point at a folder, ask one question, and get out;
  • the browser UI (served by Bun.serve), when you're juggling several brains and want follow-ups in a real chat thread.

Both go through the same LocalLensApp class, so anything that lands in one usually lights up the other without extra plumbing.

The four-step flow

  1. Pick a folder. Pass a path to the CLI, or click Choose folder in the browser UI.
  2. Index it. LocalLens walks the folder, keeps the text-shaped files, chunks them, and writes the chunks into a QVAC RAG workspace as embeddings.
  3. Ask something. The question is embedded and matched against the workspace. The top hits become numbered excerpts in the prompt.
  4. Read the answer. The chat model streams a reply that cites excerpts as [1], [2], and the UI lists those citations as links back to the original files.

Where the data lives

Brains and chunks land in .locallens/store.json. Embeddings stay in QVAC's own workspace directory. Delete a brain and both go with it in one step.

Where the code lives

FileWhat it owns
src/cli.tsThe no-UI path. One folder, one question, one answer, then cleanup.
src/server.tsOptional Bun HTTP server that backs the browser UI.
src/ui/The static browser UI: index.html, app.js, styles.css.
examples/sample-brain/A demo folder for the CLI and the UI to chew on.

If you want the deeper map, the architecture and code structure pages do that work.

What this looks like

A CLI run:

$ bun run cli examples/sample-brain "Why does LocalLens use QWEN3_1_7B_INST_Q4?"

LocalLens uses QWEN3_1_7B_INST_Q4 because it offers a strong balance of answer
quality and local resource use [1]. A 600M fallback is wired in for slimmer
machines [2].

Sources:
- locallens.md#0
- qvac-notes.md#1

The browser UI shows the same answer rendered as Markdown, with each [1] and [2] linked to the chunk it came from.

On this page