Skip to content

ES2-979: score-returning similarity search#6

Merged
euphoria0-0 merged 16 commits into
mainfrom
feature/ES2-979-score-searches
Dec 8, 2025
Merged

ES2-979: score-returning similarity search#6
euphoria0-0 merged 16 commits into
mainfrom
feature/ES2-979-score-searches

Conversation

@inkme9
Copy link
Copy Markdown
Contributor

@inkme9 inkme9 commented Oct 12, 2025

  • add tuple-returning similarity search API
  • add similarity_search_with_score / _by_vector wrappers
  • dedupe code through shared helper and keep metadata intact
  • extend unit/integration coverage

@inkme9 inkme9 changed the base branch from feature/ES2-975-add-documents to main October 12, 2025 23:58
@inkme9 inkme9 marked this pull request as draft October 12, 2025 23:58
@inkme9 inkme9 marked this pull request as ready for review October 29, 2025 01:37
@inkme9 inkme9 requested review from euphoria0-0 and seung-woni and removed request for seung-woni October 29, 2025 01:37
@inkme9 inkme9 requested a review from Copilot October 29, 2025 06:25
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_score and similarity_search_with_score_by_vector methods
  • 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.

Comment thread libs/envector/langchain_envector/vectorstore.py
Comment thread libs/envector/langchain_envector/vectorstore.py
@euphoria0-0
Copy link
Copy Markdown
Contributor

euphoria0-0 commented Dec 1, 2025

테스트 완료

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'), ...)]

@euphoria0-0
Copy link
Copy Markdown
Contributor

@inkme9 테스트 완료했습니다! 머지해도 될까요?

…ctor

[ES2-1256] convert es2 to pyenvector
@euphoria0-0 euphoria0-0 merged commit 3f842ed into main Dec 8, 2025
1 check passed
@euphoria0-0 euphoria0-0 deleted the feature/ES2-979-score-searches branch December 8, 2025 07:40
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.

5 participants