Live data from Hacker News

Build a search engine, not a vector DB

blog.elicit.com

31–40 of 84 posts

Re: Build a search engine, not a vector DB

#32
post #30
post #17

Many, many big companies don't see any value in search. They simply use the defaults, and when those defaults are abysmal (like in the case of Confluence for example), well... they just suffer through it in silence. I have so far mostly failed in trying to explain 1/ why search matters and 2/ that not all "search" functionality are equal and that building good search is an art form.

"we have no stemming support in Confluence" goes far beyond unfortunate defaults.

I didn't understand why Confluence's search engine works so poorly before I built my own search engine, and I especially don't understand why it works so poorly after. It's an absolute mystery and goes far beyond misconfiguration. Feels like they're just using a binary index and completely the skipping relevance ranking.

Re: Build a search engine, not a vector DB

#33
post #30
post #17

Many, many big companies don't see any value in search. They simply use the defaults, and when those defaults are abysmal (like in the case of Confluence for example), well... they just suffer through it in silence. I have so far mostly failed in trying to explain 1/ why search matters and 2/ that not all "search" functionality are equal and that building good search is an art form.

"we have no stemming support in Confluence" goes far beyond unfortunate defaults.

Which is the height of bullshit since Confluence uses Lucene internally, which obviously does support stemming (at least it didn't. Luckily, I haven't had to use Confluence for ages). Confluence search is what happens when some dev gets told "hey, add search, we need to mark a checkbox", searches for 30s for "Java search lib" and just adds Lucene without knowing anything about it.

Re: Build a search engine, not a vector DB

#34
I think a fundamental issue with search, and the reason why many companies do not invest in tuning a good search experience, is that the main metric usually is to minimise embarrassing/irrelevant results, rather than get the best possible set of results. How can you even know what is the best answer to your query? Systematic evaluation is very hard.

Re: Build a search engine, not a vector DB

#35
post #26
post #23

Earlier quoted context omitted.

> "Has somebody experience with Apache Lucene / Solr or Elasticsearch?" I've been working on a RAG with Solr, and quickly hit some of the issues you describe when dealing with real-world messy data and user input, e.g. using all-MiniLM-L6-v2 and cosine similarity, "Can you summarize Immanuel Kant's biography?" matched a chunk containing just the word "Biography" rather than one which started "Immanuel Kant, born in 1…

If you know that your search queries will be actual questions (like in the example you listed), you can possibly use the HyDE[0] to create a hypothetical answer which will usually have an embedding that's closer to the RAG chunks you are looking for. It has the downside that an LLM (rather than just a embedding model) is used in the query path, but it has helped me multiple times in the past to strongly reduce proble…

Thanks, sounds interesting, not-dissimilar from some of the query expansion techniques. But in my case (open source, zero budget) I'm doing (slow) CPU inference, so an LLM in the query chain isn't really viable. As it is there is a near-instant "Source: [url]" returned by the vector search, followed by the LLM-generated "answer" (quite some time) later. So I think next steps will be "traditional" techniques such as query re-ranking and hybrid search, in line with the original "Build a search engine, not a vector DB" article.

Re: Build a search engine, not a vector DB

#36
I agree that RAG doesn't have to be paired with vector search. Other types of search can work in some cases.

Where vector search excels is that it can encode a complex question as a vector and does a good job bringing back the top n results. Its not impossible to do some of this with keyword search (term expansion, stopwords and so forth). Vector search just makes it easy.

In the end, yes this is a better search system. And thinking about this step is a good point. I would go a step further and say it's also worth thinking about the RAG framework. Lots of examples use a OpenAI/Langchain/Chroma stack. But it's also worth evaluating RAG framework options. There might be frameworks that are easier to integrate and perform better for your use case.

Disclaimer: I am the author of txtai: https://github.com/neuml/txtai

Re: Build a search engine, not a vector DB

#37
I just used postgres to build my search engine and it also helps with the last 2 questions. Keeping the content context consistent helps with the first. Unscatter.com for example is content shared only in the last 30 days. Helps with keeping my operating costs under $50 a month too.

I wish I had time to mess with it more. Job and life has taken over. My first goal with AI would be to use it to for key word and phrase extraction and also analyzing all the links I pull in hourly to see if there is a larger story I could make visible.

Re: Build a search engine, not a vector DB

#38
Couldn't agree more. To give an example, to go beyond a simple "generic" search.

I have a company finding buyers for commercial real estate. One of the search features are the locations of the buyers (usually family offices etc, always companies they have headquarters, preferences on where to buy etc.). You can then for example calculate the distance to those locations.

LLMs are extremely useful in creating these features from unstructured info on the companies. But just throwing an embedding on this and hoping it works doesn't.

However, embeddings work super well in the parts of the search.

Re: Build a search engine, not a vector DB

#39

How do RAG implementations usually get around the context size limitations in LLMs? Since it usually deals with PDFs and other docs that can be quite big, do they take only the first N tokens? Are abstractive summarisation techniques used?

They split the document. Here’s an example of Markdown splitting. All this is far more an art than science at this point.

https://python.langchain.com/docs/modules/data_connection/do...

Post reply on HN