Skip to content

refactor: remove HNSW vector index support and related code#3095

Merged
robfrank merged 3 commits intomainfrom
feat/3094-remove-hnsw
Jan 7, 2026
Merged

refactor: remove HNSW vector index support and related code#3095
robfrank merged 3 commits intomainfrom
feat/3094-remove-hnsw

Conversation

@robfrank
Copy link
Collaborator

@robfrank robfrank commented Jan 7, 2026

@mergify
Copy link
Contributor

mergify bot commented Jan 7, 2026

🧪 CI Insights

Here's what we observed from your CI run for 3276db5.

🟢 All jobs passed!

But CI Insights is watching 👀

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @robfrank, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request undertakes a significant refactoring effort by completely removing the HNSW vector index implementation and all its related components from the project. This strategic decision streamlines the vector search capabilities, focusing development on the more performant and integrated LSMVector index. The changes span across core engine logic, Python bindings, SQL functions, schema definitions, and associated examples and tests, ensuring a clean transition away from the deprecated HNSW support.

Highlights

  • Complete Removal of HNSW Vector Index Support: All core Java implementations, Python bindings, SQL functions, and schema definitions related to the HNSW (Hierarchical Navigable Small World) vector index have been removed from the codebase. This includes the HnswVectorIndex and HnswVectorIndexRAM classes, their associated distance functions, and the hnswlib dependency.
  • Python Bindings Refactor: The Python example 03_vector_search.py demonstrating HNSW usage has been removed. The VectorIndex class in Python bindings is now explicitly marked as deprecated, and the create_vector_index method has been removed from the Database class, guiding users towards SQL commands for LSMVector indexes.
  • Schema and SQL Function Updates: The HNSW index type has been removed from CREATE INDEX statements, and the vectorDistance SQL function, which relied on HNSW-specific distance calculations, has also been removed. Related imports and factory registrations have been cleaned up across the engine.
  • Cleanup of Importer and Test Code: HNSW-specific importer classes (TextEmbeddingsImporter and related embedding types) and unit tests (test_vector_search, SQLFunctionVectorDistanceTest) have been eliminated, streamlining the codebase and removing deprecated functionality.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@robfrank robfrank added this to the 26.1.1 milestone Jan 7, 2026
@robfrank robfrank added the enhancement New feature or request label Jan 7, 2026
@robfrank robfrank requested a review from lvca January 7, 2026 15:33
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request is a substantial refactoring that removes the HNSW vector index support and its related code. The changes are extensive, touching the Java engine, Python bindings, examples, and build configurations. The removal of the hnswlib dependency and associated classes like HnswVectorIndex is done cleanly. The Python examples and tests for HNSW have also been correctly removed. Overall, this is a great cleanup. I have one suggestion regarding the Python bindings to remove a class that has become orphaned as a result of these changes, which would improve code clarity and maintainability.

@robfrank robfrank requested a review from gramian January 7, 2026 15:37
@lvca
Copy link
Member

lvca commented Jan 7, 2026

@gramian are there any functions you implemented on the old HNSW engine we should port to the new one?

@codacy-production
Copy link

codacy-production bot commented Jan 7, 2026

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-6.39% 80.77%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (5de4add) 77411 49559 64.02%
Head commit (3276db5) 76176 (-1235) 43899 (-5660) 57.63% (-6.39%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#3095) 78 63 80.77%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@gramian
Copy link
Collaborator

gramian commented Jan 7, 2026

No, not as far as I remember.

@robfrank robfrank merged commit 1ee88b7 into main Jan 7, 2026
35 of 41 checks passed
@robfrank robfrank deleted the feat/3094-remove-hnsw branch January 7, 2026 22:09
robfrank added a commit that referenced this pull request Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants