Latest / Big Iron Radio / Filesystem-Only RAG: When You Don't Need a Vector Database
Transcript
- 0:03RAG Retrieval Augmented Generation,
- 0:06giving an LLM your own documents to answer from has a reputation for being heavy.
- 0:11Vector databases, Docker stacks, Langchain, a pile of moving parts.
- 0:16And for a lot of Homelabers, that reputation is the reason they never build it.
- 0:21So here's the liberating claim I want to defend today.
- 0:25For most Homelab use cases, you don't need any of that.
- 0:28You can build the whole thing in an afternoon with files on disk,
- 0:32and disk.
- 0:33Quick note before we dig in.
- 0:35This is an AI-generated voice,
- 0:38and everything here is adapted from a written guide over at Big Iron.
- 0:42The full write-up, with the roughly 250 lines of Python,
- 0:46is linked in the show notes.
- 0:48Let's state the claim precisely.
- 0:51Most Homelab RAG doesn't need a vector database.
- 0:55Markdown on disk, embeddings generated through Alama,
- 0:59and similarity search via something as simple as SQLite VSS or Honestly.
- 1:04Even a plain JSON file handles under 100,000 chunks for a single user with zero ceremony.
- 1:11That covers a personal knowledge base, your documentation, your notes comfortably.
- 1:16So when do you actually need a real vector database?
- 1:20The guide gives a five-question decision tree.
- 1:23How many chunks, how many concurrent users, how often the data updates,
- 1:27do you need multi-tenancy, and how fast are you growing?
- 1:31The first yes to a genuine requirement is the one that matters.
- 1:35Until you hit one, you're carrying infrastructure you don't need.
- 1:39Let's be concrete about what the file system version is,
- 1:43because, build it in an afternoon, should sound suspicious.
- 1:47It's about 250 lines of Python.
- 1:50No lang chain, no docker, nothing to babysit.
- 1:53You use UV for the virtual environment,
- 1:56NamaChembed text through Alama to generate embeddings,
- 1:59and SQLite VSS for the index.
- 2:02That's the entire stack.
- 2:04An afternoon is not hyperbole.
- 2:07Now, the one decision that matters most, and it's not the database,
- 2:11it's the chunking.
- 2:13How you cut your documents into pieces moves retrieval quality
- 2:17more than anything else you'll do.
- 2:19Get this right, and a simple system feels smart.
- 2:22Get it wrong, and the fanciest vector DB still returns garbage.
- 2:27The recipe.
- 2:29Roughly 512 token chunks, about 12% overlap
- 2:33so ideas that straddle a boundary aren't severed,
- 2:36and respect the markdown headers,
- 2:38don't cut, in the middle of a section.
- 2:40And the subtle, high leverage move.
- 2:42Include the header chain, in the text you embed.
- 2:46Let me explain why that header chain matters,
- 2:49because it's the trick.
- 2:50Imagine a chunk that just says default, deny, inbound.
- 2:53Under a heading path of networking, IPv6 firewall,
- 2:57that means one thing.
- 2:59Under design philosophy, it means something else entirely.
- 3:02By embedding the breadcrumb the chain of headings above the chunk,
- 3:06you give the search that context,
- 3:08so it retrieves the paragraph for the right question.
- 3:12It's a few characters of text, and it noticeably sharpens results.
- 3:16Now some real numbers, so you can size this against your own library.
- 3:2012,000 chunks index to about 80 megabytes on disk, in around 6 minutes, CPU only.
- 3:28That's a whole documentation set, indexed over a coffee break,
- 3:32taking up less space than a phone photo album.
- 3:35And query latency tells the real story.
- 3:38The vector search itself is about 10 milliseconds effectively instant.
- 3:43Then the LLM generates the answer, and that's 9 seconds on CPU,
- 3:48or about a second and a half on a modest GPU.
- 3:51Sit with that gap.
- 3:53The search is 10 milliseconds.
- 3:55The language model is the entire rest of the wait.
- 3:59That reframes where people spend effort completely.
- 4:03Folks agonize over vector database performance,
- 4:06but at Homelab scale, the vector search is nothing a rounding error.
- 4:10The LLM generation dominates the latency budget.
- 4:14If you want your RAG to feel faster, you speed up the model, not the search.
- 4:19The vector store was never your bottleneck.
- 4:22So what are you giving up versus a real vector database?
- 4:26At this scale, genuinely not much.
- 4:29High concurrency, sub-minute updates across millions of chunks,
- 4:33multi-tenant isolation real features,
- 4:36for problems a single homelabber with a knowledge base almost never has.
- 4:41And here's what makes it safe to start simple.
- 4:44The migration path is real.
- 4:46When you genuinely outgrow the file system version,
- 4:49you need sub-minute updates, or multiple tenants,
- 4:52or you're into millions of chunks,
- 4:54you move to posters with PG vector.
- 4:57But you move because you hit an actual wall,
- 5:00with data that proves it, not because a tutorial told you to start there.
- 5:04Which is really the whole point.
- 5:07The anti-pattern this fights is spinning up a Docker Compose Vector stack
- 5:11for a personal knowledge base of 500 notes.
- 5:14That's a dozen moving parts for a problem a single Python file solves,
- 5:19and every one of those parts is something that can break at 2 a.m.
- 5:24So the takeaway?
- 5:25Build the afternoon version.
- 5:27Get the chunking right 512 tokens.
- 5:30Some overlap, respect the headers, embed the header chain,
- 5:34and you will very likely never need anything more.
- 5:37The 250 lines, and the 5 question decision tree,
- 5:41are both in the show notes.
- 5:43Thanks for listening, catch you next time.
- 5:45We'll see you next time.