Building a Pip-Installable RAG with Hybrid Search and Streaming

The article discusses the author's experience building a Retrieval Augmented Generation (RAG) pipeline using LangChain and the motivation behind creating a new library called 'ragwise' that provides hybrid search and streaming capabilities by default.

šŸ’”

Why it matters

Ragwise provides a convenient and powerful RAG solution that addresses the shortcomings of existing options, making it easier for teams to implement hybrid search and streaming capabilities in their applications.

Key Points

  • 1Existing RAG libraries either have a low barrier to entry but weak retrieval performance, or strong retrieval but heavy infrastructure requirements.
  • 2The author built 'ragwise' to provide hybrid search (BM25 + dense retrieval) as the default, without the need for additional configuration.
  • 3Ragwise uses Reciprocal Rank Fusion to combine the ranked results from BM25 and dense search, providing robust and accurate retrieval.
  • 4Ragwise includes streaming capabilities to enable real-time text generation in user interfaces.

Details

The author explains that they spent a weekend integrating a RAG pipeline into a client project using LangChain, but ended up with a cumbersome setup and suboptimal retrieval quality. This was because the default was dense-only search, which misses exact keyword queries, error codes, and other specific information that is better captured by BM25 search. The article then discusses the two main types of RAG libraries available - those that are easy to start but weak on retrieval, and those that are strong on retrieval but require heavy infrastructure. The author saw a need for a pip-installable library that provides hybrid search as the default, which led to the creation of 'ragwise'. Ragwise uses a combination of BM25 and dense retrieval, with Reciprocal Rank Fusion to merge the ranked results. This approach is simple, robust, and does not require any training data. The article also highlights Ragwise's streaming capabilities, which enable real-time text generation in user interfaces.

Like
Save
Read original
Cached
Comments
?

No comments yet

Be the first to comment

AI Curator - Daily AI News Curation

AI Curator

Your AI news assistant

Ask me anything about AI

I can help you understand AI news, trends, and technologies