Workspace search & retrieval
Bungu indexes your workspace locally so chat can answer from all your files, with citations.
When you add a folder to the sidebar, Bungu builds a local semantic index of its markdown in the background. From then on, chat doesn’t just see the open document — it retrieves the most relevant passages from your whole workspace.
How it works
- Files are split into heading-aware chunks and embedded entirely on-device.
- The index lives inside your workspace at
.bungu/index/— vectors, chunk metadata, and a file-state manifest for incremental updates. Only files that actually changed get re-embedded; the folder watcher keeps it current as you work. - In git repos,
.bungu/is added to.gitignoreautomatically. - Retrieval is top-K cosine similarity with a relevance gate. Linear scan — comfortably fast up to tens of thousands of chunks.
In the chat
- A toggle pill in the chat input shows the active context mode: “Searching N files” when workspace retrieval is on, or “Current doc only” when it’s off.
- Answers grounded by retrieval get inline superscript citations (¹ ² ³). Tap one and the Sources footer expands with the matching file highlighted — click through to open it at the source.
- When retrieval finds nothing relevant, chat falls back to the open document’s content.
Semantic Quick Open
The same index powers ⌘K Quick Open: find files by what they’re about, not just what they’re called.
Inspecting the index
Settings → AI shows every workspace with file/chunk counts, on-disk size, and re-index controls — plus a test retrieval panel where you can type a query and see exactly which chunks match, with scores. No black box.