-
Notifications
You must be signed in to change notification settings - Fork 14
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
Support specifying a similarity threshold #81
Conversation
Related to wagtail#21 Add support for specifying a similarity threshold in vector search methods. * **VectorIndex Class**: Add `similarity_threshold` parameter to `query`, `find_similar`, and `search` methods in `src/wagtail_vector_index/storage/base.py`. * **PgvectorIndexMixin Class**: Update `get_similar_documents` and `aget_similar_documents` methods to accept `similarity_threshold` parameter and filter results based on it in `src/wagtail_vector_index/storage/pgvector/provider.py`. * **QdrantIndexMixin Class**: Update `get_similar_documents` method to accept `similarity_threshold` parameter and filter results based on it in `src/wagtail_vector_index/storage/qdrant/provider.py`. * **WeaviateIndexMixin Class**: Update `get_similar_documents` method to accept `similarity_threshold` parameter and filter results based on it in `src/wagtail_vector_index/storage/weaviate/provider.py`. * **NumpyIndexMixin Class**: Update `get_similar_documents` method to accept `similarity_threshold` parameter and filter results based on it in `src/wagtail_vector_index/storage/numpy/provider.py`. * **Documentation**: Update `docs/vector-indexes.md` to include information on the new `similarity_threshold` parameter and provide examples of its usage. * **Tests**: Add tests for the new `similarity_threshold` parameter in `query`, `find_similar`, and `search` methods in `tests/test_index.py`. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/wagtail/wagtail-vector-index/issues/21?shareId=XXXX-XXXX-XXXX-XXXX).
I've marked this as a draft to indicate that it is work-in-progress, mainly due to failing tests. Early feedback is more than welcome :-) |
This is looking great thanks @brylie! I'll do a more thorough review this week and we get this in. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me, appreciate all the effort that went in to documentation. Left a couple of minor comments.
Thanks @brylie! |
Related to #21
Add support for specifying a similarity threshold in vector search methods.
similarity_threshold
parameter toquery
,find_similar
, andsearch
methods insrc/wagtail_vector_index/storage/base.py
.get_similar_documents
andaget_similar_documents
methods to acceptsimilarity_threshold
parameter and filter results based on it insrc/wagtail_vector_index/storage/pgvector/provider.py
.get_similar_documents
method to acceptsimilarity_threshold
parameter and filter results based on it insrc/wagtail_vector_index/storage/qdrant/provider.py
.get_similar_documents
method to acceptsimilarity_threshold
parameter and filter results based on it insrc/wagtail_vector_index/storage/weaviate/provider.py
.get_similar_documents
method to acceptsimilarity_threshold
parameter and filter results based on it insrc/wagtail_vector_index/storage/numpy/provider.py
.docs/vector-indexes.md
to include information on the newsimilarity_threshold
parameter and provide examples of its usage.similarity_threshold
parameter inquery
,find_similar
, andsearch
methods intests/test_index.py
.For more details, open the Copilot Workspace session.