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

Update vector_store_component.py to add keyword based search alongside semantic search #1603

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cloudrage999
Copy link

hi,i tried to make a PR in order to increase the accuracy of search results ,im not sure if i did it in the right way but i tried
the idea is to have both semantic search and traditional keyword based search in order to get more relevant results
i hope this feature be implemented in the project in future, maybe more modifications are needed

@semenov-d-v
Copy link

I want to highlight this PR, I think it is really important

Copy link
Collaborator

@jaluma jaluma left a comment

Choose a reason for hiding this comment

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

First of all, I would like to thank you for your PR but, currently, much of this code is unnecessary. The llama-index framework itself takes care of hybrid search if the provider supports it. I recommend looking at the VectorStoreQueryMode enum in the llama-index code.

If you can try, one first possible option to implement it would be to pass the VectorStoreQueryMode parameter to the Retriever. You would define a new setting to define which will be the selected query mode.

from private_gpt.components.vector_store.batched_chroma import BatchedChromaVectorStore
from private_gpt.open_ai.extensions.context_filter import ContextFilter
from private_gpt.paths import local_data_path
from private_gpt.settings.settings import Settings
from langchain.retrievers import BM25Retriever, EnsembleRetriever
Copy link
Collaborator

Choose a reason for hiding this comment

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

You don't should use langchain.retrievers

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.

3 participants