Local query autocomplete with "classical" ML, no LLM needed

Posted by Scared-Tip7914@reddit | LocalLLaMA | View on Reddit | 8 comments

Hey guys! I know this is not fully LLM related (its still local though :D), mods feel free to delete this if you think its off topic, but I just wanted to share something I experimented with, local autocomplete without the use of LLMs or full elastisearch.

My main area is RAG and we realised that there is a bit of gap in the search box autocomplete funcionalty where you dont have to spend a bunch of time generating sample questions that users might ask in order to autocomplete their queries. So I created this tool where you just take the same pdf, docx or txt files that you use for the underlying RAG and throw them into this thing, it creates a local db, and as users type it shows suggestions to them based on the text in the docs themselves so the suggestions list is actually relevant and might guide them somewhere useful.

It uses some of the lingustic algos that predate LLMs, specifically Kneser-Ney scoring and the OG fuzzy match, so its language agnosic, with the caveat that it doesnt support logogramic languages like chinese and japanese (for now).

Check the thing out here on pypi: https://pypi.org/project/query-autocomplete/
And the repo: https://github.com/MarcellM01/query-autocomplete

ALSO if you think the idea is pure garbage or there are easier ways to do this I am also open to that lol because I have no desire to replicate/maintain something thats already solved.