AI File Brain
A local-first file assistant that lets you search your disk by meaning — without sending your files to the cloud.
The problem wasn’t search — it was trust
I wanted a way to ask my computer questions like:
- —“Where is that PDF about vector databases that mentioned cosine similarity?”
- —“Show me the doc where I explained the onboarding flow tradeoffs.”
- —“Find the thing that’s basically an invoice template, even if it’s not called invoice.”
Traditional file search fails when you don’t remember filenames. Cloud AI tools solve this—by uploading your data.
But the value of “AI over files” collapses if I can’t trust where my files go.
So the obsession became simple:
Semantic search, but local. No cloud. No “we don’t store your data.” No uncertainty.
If the tool requires you to compromise privacy to be useful, it’s not a tool — it’s a trade.
The walls I had to design around
The bets I placed
Two search modes, not one. I made keyword search and semantic search first-class citizens.
- —
ai searchuses SQLite FTS5 + BM25 for determinism and speed. - —
ai finduses local embeddings (Ollama) + vector search (LanceDB) for meaning-based recall.
This wasn’t just technical—it was about trust: keyword search proves the system is grounded, semantic search expands what you can ask.
Local embeddings via Ollama.
Embeddings are generated on-device using Ollama (ex: nomic-embed-text). No files are uploaded, and the system stays offline-first.
Smart scanning rules. Indexing “everything” is the easiest way to build a useless system. So scanning intentionally skips obvious trash:
- —code projects (via marker files),
- —hidden dirs,
- —heavy folders like
node_modules, - —large files that don’t produce good text.
Chunking as a product decision. Embeddings are only as good as the text you feed them. Chunking has to preserve meaning, but also stay small enough for retrieval and ranking.
Retrieval isn’t one technique — it’s a toolbox. Keyword builds certainty; semantic finds what you didn’t know how to ask for.
What broke (and taught me the most)
The first scans were noisy.
Not “crash” noisy—signal-to-noise noisy.
Indexing codebases, build folders, and hidden directories inflated the index, slowed scans, and made results less relevant. The system worked, but it didn’t feel smart—because it spent its intelligence on the wrong inputs.
The fix was not more AI. It was better boundaries:
- —clear inclusion (allowed paths),
- —explicit file extensions,
- —aggressive ignore lists,
- —and a bias toward indexing documents rather than artifacts.
That failure reinforced a principle I keep relearning:
Most “AI quality” problems are actually data-shaping problems.
How it actually works
AI File Brain has a clear split between indexing and retrieval:
Indexing pipeline
- —Walk allowed directories (recursive)
- —Extract text from documents (PDF/DOCX/MD/TXT)
- —Chunk text
- —Create embeddings locally (Ollama)
- —Store:
- —metadata + FTS index in SQLite
- —vectors in LanceDB
Keyword search (ai search)
Query → FTS5 MATCH → BM25 rank → highlighted snippets
Semantic search (ai find)
Query → embedding → vector similarity → re-ranking (vector + filename/path signals) → results
What I’d tell myself before starting
Where this goes next
The foundation is there: local indexing, hybrid retrieval primitives, and a UX that aims to be trustworthy.
The next step is moving from search to assistance without betraying the local-first premise:
- —Hybrid ranking (merge FTS + vector results with weighted scoring)
- —Incremental scanning (only re-embed changed content)
- —Watch mode (react to filesystem changes)
- —
ai ask: local Q&A over your files with citations - —Clustering + “smart folders” (suggest organization, never auto-move)
The guiding constraint stays the same:
If it can’t be private, it doesn’t ship.

A bored developer is a dangerous developer.