Lurker News
I 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 comments
m00dy1 reply#
does duckdb scale well over large datasets for vector search ?
lgrebe1 reply#
What order of magnitude would you define as „large“ in this case?
m00dy2 replies#
like over 1tb.

Continue this thread — 2 replies

jlarks32#
+1 on this one, I've been pleasantly surprised by this for a small (<3GB) local project
acutesoftware2 replies#
I am using LangChain with a SQLite database - it works pretty well on a 16G GPU, but I started running it on a crappy NUC, which also worked with lesser results.

The real lightbulb moment is when you realise the ONLY thing a RAG passes to the LLM is a short string of search results with small chunks of text. This changes it from 'magic' to 'ahh, ok - I need better search results'. With small models you cannot pass a lot of search results ( TOP_K=5 is probably the limit ), otherwise the small models 'forget context'.
It is fun trying to get decent results - and it is a rabbithole, next step I am going into is pre-summarising files and folders.
I open sourced the code I was using - https://github.com/acutesoftware/lifepim-ai-core

reactordev#
You can expand your context window to something like 100,000 to prevent memory loss.
IXCoach#
You can modify this, theres settings for - how much context - chunk size

We had to do this, 3 best matches but about 1000 characters each was far more effective than the default I ran into of 15-20 snippets of 4 sentences each
We also found a setting for "when do you cut off and/or start" the chunk, and set it to double new lines
Then just structured our agentic memory into meaningful chunks with 2 new lines between each, and it gelled perfectly.
( hope this helps )

amscotti2 replies#
More of a proof of concept to test out ideas, but here's my approach for local RAG, https://github.com/amscotti/local-LLM-with-RAG

Using Ollama for the embeddings with “nomic-embed-text”, with LanceDB for the vector database. Recently updated it to use “agentic” RAG, but probably not fully needed for a small project.

threecheese#
There are so many of us doing the same, just had a similar conversation at $work. It’s pretty exciting. I feel like I’m having to shove another 20 years of development experience into my brain with all these new concepts and abstractions, but the dots have been connecting!
vaylian1 reply#
Thank you for being the kind of person who explains what the abbreviation RAG stands for. I have been very confused reading this thread.
someguyiguess#
I feel this pain! It feels like in the world of LLMs there is a new acronym to learn every day!

For the curious RAG = Retrieval Augmented Generation. From wikipedia: RAG enables large language models (LLMs) to retrieve and incorporate new information from external data sources

miohtama#
+1 for Haiku! It's very simple to get up and running.

Load more comments