Ask HN: How are you doing RAG locally?
413 pointsI am curious how people are doing RAG locally with minimal dependencies for internal code or complex documents?
Are you using a vector database, some type of semantic search, a knowledge graph, a hypergraph?
Comments (156) 83 threads
Earlier commentsThis took about one hour to set up and works very well.
(+) At least, I don't think this counts as RAG. I'm honestly a bit hazy on the definition. But there's no vectordb anyway.
The backing method doesn’t matter as long as it works. This is clear from good RAG survey papers, Wikipedia, and (broadly) understanding the ethos of machine learning engineers and researchers: specific implementation details are usually means to an end, not definitional boundaries.
This may be of interest:
https://github.com/ibm-self-serve-assets/Blended-RAG
> So we'd probably find an even split of people who would call this RAG or not.
Maybe but not likely. This is sometimes called the 50-50 fallacy or the false balance of probability or the equiprobability bias.
https://pmc.ncbi.nlm.nih.gov/articles/PMC4310748/
“The equiprobability bias (EB) is a tendency to believe that every process in which randomness is involved corresponds to a fair distribution, with equal probabilities for any possible outcome. The EB is known to affect both children and adults, and to increase with probability education. Because it results in probability errors resistant to pedagogical interventions, it has been described as a deep misconception about randomness: the erroneous belief that randomness implies uniformity. In the present paper, we show that the EB is actually not the result of a conceptual error about the definition of randomness.”
You can also find an ELI5 Reddit thread on this topic where one comment summarizes it as follows:
“People are conflating the number of distinguishable outcomes with the distribution of probability directly.”
https://www.reddit.com/r/explainlikeimfive/comments/1bpor68/...
After some time we noticed a semi-structured field in the prompt had a 100% match with the content needed to process the prompt.
Turns out operators started puting tags both in the input and the documents that needed to match on every use case (not much, about 50 docs).
Now we look for the field first and put the corresponding file in the prompt, then we look for matches in the database using the embedding.
85% of the time we don't need the vectordb.
It uses LanceDB and has dozens of different extraction/embedding models to choose from. It even has evals for checking retrieval accuracy, including automatically generating the eval dataset.
You can use its UI, or call the RAG via MCP.
https://github.com/kiln-ai/kiln
https://docs.kiln.tech/docs/documents-and-search-rag
All comments shown.
Couldn't load more comments. Check your connection and try again.