-
Notifications
You must be signed in to change notification settings - Fork 787
feat(query): Implement Vector Index with HNSW Algorithm #18134
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
Open
b41sh
wants to merge
6
commits into
databendlabs:main
Choose a base branch
from
b41sh:feat-vector-hnsw
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+7,662
−121
Conversation
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
01352f1
to
ec5e851
Compare
Docker Image for PR
|
Docker Image for PR
|
🤖 Smart Auto-retry Analysis (Retry 3)
📊 Summary
❌ NO RETRY NEEDEDAll failures appear to be code/test issues requiring manual fixes. 🔍 Job Details
🤖 AboutAutomated analysis using job annotations to distinguish infrastructure issues (auto-retried) from code/test issues (manual fixes needed). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
ci-cloud
Build docker image for cloud test
pr-feature
this PR introduces a new feature to the codebase
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.
I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/
Summary
This PR introduces a vector index to Databend, leveraging the Hierarchical Navigable Small World (HNSW) algorithm for efficient similarity search.
Key Features:
Vector Index with HNSW: Implements a vector index based on the HNSW algorithm, enabling fast and accurate approximate nearest neighbor search on
VECTOR
data. Creating a vector index requires specifying the following parameters to fine-tune performance and accuracy:m
: Controls the number of connections (edges) per node in the HNSW graph. Higher values generally improve recall but increase index size and construction time.ef_construct
: Controls the search width during index construction, representing the number of neighbors considered during the building process. Higher values lead to better index quality but increase construction time.distance
: Specifies the supported distance calculation function(s) for the index. Acceptable values arecosine
,l1
, andl2
. Multiple distance functions can be configured for a single index.Distance Function Support: Provides comprehensive distance metric support for various similarity calculations:
cosine_distance
: Calculates the cosine distance between vectors, suitable for measuring the angle between vectors and identifying semantic similarity.l1_distance
: Calculates the L1 distance (Manhattan distance) between vectors.l2_distance
: Calculates the L2 distance (Euclidean distance) between vectors.L1 Distance Function Implementation: As part of this PR, the
l1_distance
function was implemented to provide a complete set of distance functions.Implementation Details:
The implementation of the HNSW algorithm is primarily based on modifications to the excellent open-source HNSW implementation from github.com/qdrant/qdrant. We would like to express our sincere gratitude to the
Qdrant
team for their valuable work, which significantly accelerated the development of this feature.Example Usage:
part of: #17972
Tests
Type of change
This change is