Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: add hybrid search retriever using Qdrant in-memory vector store #1176

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

asajatovic
Copy link

@asajatovic asajatovic commented Dec 5, 2024

Description

Adds a new hybrid search retriever that combines dense and sparse embedding models to score documents and return the most relevant results. It uses Qdrant's in-memory vector store and supports filtering, with results fused using the Reciprocal Rank Fusion algorithm.
Implementation wise, the new class HybridQdrantInMemoryRetriever inherits QdrantInMemoryRetriever and acts as a drop in replacement, with the addition of also doing sparse vector search, using the reference BM25 algorithm. By using this hybrid approach, we can improve search relevance.

Before Merging

  • [ x] Review the code changes
    • Unused print / comments / TODOs
    • Missing docstrings for functions that should have them
    • Consistent variable names
    • ...
  • [x ] Update changelog.md if necessary
  • [x ] Commit messages should contain a semantic label and the ticket number
    • Consider squashing if this is not the case

@asajatovic asajatovic changed the title feature: add hybrid search retriever using Qdrant in-memory vector st… feature: add hybrid search retriever using Qdrant in-memory vector store Dec 5, 2024
@asajatovic asajatovic marked this pull request as ready for review December 5, 2024 14:17
@asajatovic asajatovic force-pushed the feature/in-memory-hybrid-search branch from 9953869 to f0d8972 Compare December 5, 2024 14:22
Copy link
Contributor

@NiklasKoehneckeAA NiklasKoehneckeAA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed this, it seems some test code is still missing. Currently IL pipelines are still not fixed after the cluster move, which is something we have are working on, so this is blocked until then.

@asajatovic asajatovic force-pushed the feature/in-memory-hybrid-search branch from f0d8972 to 2d6d24d Compare December 9, 2024 10:37
…uctor

Set default value of `max_workers` in `HybridQdrantInMemoryRetriever` in `__init__`.
In addition, use `min(len(documents), self._max_workers)` as number of concurrent calls to embedding service.
Finally, updates constructor docs to use Google style default values.
@asajatovic asajatovic force-pushed the feature/in-memory-hybrid-search branch from e6b6f8c to b91e180 Compare December 18, 2024 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants