Live data from Hacker News

Ask HN: I have many PDFs – what is the best local way to leverage AI for search?

news.ycombinator.com

81–90 of 92 posts

Re: Ask HN: I have many PDFs – what is the best local way to leverage AI for search?

#81

For macOS, there's this: https://pdfsearch.app/ Without AI, but searching the PDF content, I use Recoll ( https://www.recoll.org/ ) or ripgrep-all ( https://github.com/phiresky/ripgrep-all )

The best indexer for macOS, bar none is Foxtrot Professional. https://foxtrot-search.com/foxtrot-professional.html Very sophisticated searching, including regex, its own query language, and proximity searches - x within z words of y - which for me is the biggest win. I have 2TB of files indexed with this.

Re: Ask HN: I have many PDFs – what is the best local way to leverage AI for search?

#82
post #66

If you haven’t given some serious thought to getting rid of most of the documents then consider it. There is very little need to keep most routine documents for more than a few years. If you think you need your electric bill for March 2006 at your fingertips, why?

I was hoping someone would make this point. A lot of digital archiving is just delaying tossing things - a hard drive is easier to deal with than boxes of paper. The contents can still be useless. When it comes to a search solution - what kind of searches have you done in the past? What kind of problems did you come across? If the answer to either is "none" you are planning on building a useless system.

You never know when you will need a 10 year old doc. Audits and disputes for example. In addition I suspect keeping all the docs uses 1% of the spaces of photos people back up anyway.

I agree that search is overkill - just drudge manually or use grep when the time comes to dig.

Re: Ask HN: I have many PDFs – what is the best local way to leverage AI for search?

#83
post #45
post #35

Earlier quoted context omitted.

I found that grep actually outperformed vector search for many queries. The only thing I was missing was when I didn't know how exactly to phrase something (the exact keyword to use). Do keyword search systems have workarounds for this? My own idea was for each keyword to generate a list of neighbor keywords in semantic space. I figured with such a dataset, I'd get something approximating vector search for free. I ma…

The point of vector search is to support semantic search. It makes sense that grep will outperform if you're just looking for verbatim occurrences of a string.

A combination of both could help!

Re: Ask HN: I have many PDFs – what is the best local way to leverage AI for search?

#86

Devonthink would do this with a tiny model to translate your natural length search prompts into its syntax and your folder/tag tree. If you're okay with some false positives, Devonthink would work as is, actually.

I used to use this, but the LLM approach allows for much deeper interactions. Not "find all times I've typed X" but "act as an expert in Y, looking across all times I've typed X, summarize my changing position over thee years, and suggest other terms that have a similar pattern of change, in a list." The kind of thing I used to give to an intern over a month, with results that are not far off what that intern produce…

I’d love to see that built in as well.

The devonthink crab-bucket community is hostile to any use of LLMs but I don’t think they understand how the app would structure and augment the input and output to keep it from returning fanciful output.

Re: Ask HN: I have many PDFs – what is the best local way to leverage AI for search?

#87

I am a medical students with thousands and thousands of PDF and was unsatisfied with RAG tools so I made my own. It can consume basically any type of content (pdf, epub, youtube playlist, anki database, mp3, you name it) and does a multi step RAG by first using embedding then filtering using a smaller LLM then answering using by feeding each remaining document to the strong LLM then combine those answers. It supports…

Nvidia's 'Chat with RTX' can do this as well https://www.nvidia.com/en-us/ai-on-rtx/chatrtx/ You do need a beefy GPU to run the local LLM, but I think it's a similar requirement for running any LLM on your machine.

I am deeply unsatisfied with how most RAG systems handle questions, chunking, embeddings, storage, and even those used for summaries are usually rubbish. That's why I created my own tool. Check it out I updated it a lot! It supports ollama too for private use.

Re: Ask HN: I have many PDFs – what is the best local way to leverage AI for search?

#89
Thank you all for the comments. Got a lot of good input and ways to think thru the tried and true tools (enjoying ripgrep-all + fzf) plus the standard ai/rag-style tools. I do think there is room for a bridge or an integrated way to pipe in similarity / embedding into the ripgreps of the world. Maybe something close to fzf’s piping model. Will explore if I have some time.
Post reply on HN