Here are the 4 most prevalent themes from the Hacker News discussion on local RAG and document retrieval:
1. Hybrid Search is Superior to Pure Vector Search
Many users argue that combining traditional keyword search (BM25, FTS) with vector similarity search ("hybrid search") provides better results than using vector embeddings alone, especially for code and structured data.
"IME most documentation is coming from the web via web search. I like agentic RAG for this case, which you can achieve easily with a Claude Code subagent." —
CuriouslyC"keyword search is superior to embeddings based search. The moment google switched to bert based embeddings for search everyone agreed it was going down hill." —
Der_Einzige"Most forms of early enshittification were simply switching off BM25 to embeddings based search." —
Der_Einzige
2. Simplicity and Using Existing Tools (SQLite, Grep, Ripgrep)
A significant portion of the discussion emphasizes the effectiveness of simple, existing tools like grep, ripgrep, and SQLite (with FTS5) over complex vector databases for local use cases.
"For all intents and purposes, running gpt-oss 20B in a while loop with access to ripgrep works pretty dang well." —
postalcoder"SQLite FTS5 works well." —
porridgeraisin"Well, I already had the index so I just wired it up to my mastra agents. This took about one hour to set up and works very well." —
esperent
3. The Definitional Debate: What Actually Constitutes RAG?
There is confusion and debate over the definition of RAG itself, specifically whether retrieval requires a vector database or if simpler keyword-based retrieval qualifies.
"Well, that is what the acronym stands for. But every source I've ever seen quickly follows by noting it's retrieval backed by a vectordb." —
esperent"What you described is a perfect example of a RAG. An embedding-based search might be more common, but that's a detail." —
dmos62"Retrieval-augmented generation. What you described is a perfect example of a RAG." —
dmos62
4. Code Search Is Unique (Embeddings Are Bad for Code)
Multiple users specifically called out that vector embeddings are often poor for searching code, suggesting alternatives like BM25, trigrams, or AST-based tools (Tree-sitter, ast-grep) instead.
"Don't use a vector database for code, embeddings are slow and bad for code. Code likes bm25+trigram, that gets better results while keeping search responses snappy." —
CuriouslyC"Code likes bm25+trigram, that gets better results while keeping search responses snappy." —
CuriouslyC"I don't see ast-grep as being very useful to an agent. What a coding agent needs is to be able to locate portions of source code relevant to what it has been tasked with..." —
HarHarVeryFunny