ES2-979: score-returning similarity search#6
Merged
Conversation
…ine test runner, and doc updates (README, VECTORSTORE.md)
There was a problem hiding this comment.
Pull Request Overview
This PR adds score-returning similarity search functionality to the Envector vector store, enhancing the API with tuple-based methods that return both documents and their similarity scores.
- Introduces
similarity_search_with_scoreandsimilarity_search_with_score_by_vectormethods - Refactors similarity search to use a shared internal helper method
_similarity_search_with_scores - Extends test coverage with comprehensive unit and integration tests for the new functionality
Reviewed Changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
libs/envector/langchain_envector/vectorstore.py |
Core implementation of score-returning similarity search methods and refactored search logic |
tests/test_vectorstore.py |
Comprehensive unit tests for new score-returning methods and existing functionality |
tests/integration/test_es2_integration.py |
Code formatting improvements for better readability |
| Multiple other files | Code formatting, import cleanup, and removal of unused imports |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
euphoria0-0
approved these changes
Nov 14, 2025
Contributor
|
테스트 완료 store.similarity_search(query, k=3)
> [Document(metadata={'source': 'paper.pdf', 'page': 1, 'chunk': 0, '_score': 0.5060499906539917, '_id': 3}, page_content='chunk-1'), ...]store.similarity_search_with_score(query, k=3)
> [(Document(metadata={'source': 'paper.pdf', 'page': 1, 'chunk': 0, '_score': 0.5060520768165588, '_id': 1}, page_content='chunk-1'), 0.5060520768165588), ...]store.similarity_search_by_vector(query_embedding, k=3)
> [Document(metadata={'source': 'paper.pdf', 'page': 1, 'chunk': 0, '_score': 0.5060375332832336, '_id': 1}, page_content='chunk-1'), ...)] |
Contributor
|
@inkme9 테스트 완료했습니다! 머지해도 될까요? |
…ctor [ES2-1256] convert es2 to pyenvector
SongHyeopPark
approved these changes
Dec 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.