Add hyperspacedb client#816
Conversation
…d tune HNSW defaults
… Cosine metric calculation
…ing for HyperspaceDB client
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: YARlabs The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/assign @XuanYang-cn |
|
@YARlabs Please fix the github actions |
XuanYang-cn
left a comment
There was a problem hiding this comment.
Please address the inline review comments.
| @@ -0,0 +1,4 @@ | |||
| from .config import HyperspaceDBConfig, HyperspaceDBIndexConfig | |||
| from .hyperspacedb import HyperspaceDB | |||
There was a problem hiding this comment.
Please remove this __init__.py; the other client directories do not add one, and the existing lazy DB.init_cls registration already handles loading the adapter when needed. vectordbbench.py imports hyperspacedb.cli unconditionally, so this initializer eagerly imports the optional SDK and makes a base install fail with ModuleNotFoundError: No module named 'hyperspace' before any command can run.
| # Create collection | ||
| try: | ||
| metric = self.case_config.parse_metric() | ||
| client.create_collection( |
There was a problem hiding this comment.
The published SDK's create_collection() and configure() methods return False on RPC errors instead of raising, so this try block does not detect most setup failures. Please check both return values and raise when either operation fails; otherwise the benchmark proceeds without a correctly created/configured collection.
| metas = [{"id": str(idx)} for idx in metadata] | ||
|
|
||
| try: | ||
| self.client.batch_insert( |
There was a problem hiding this comment.
batch_insert() returns a boolean and returns False for RPC/server failures. Its result is ignored here, so a failed batch is reported as (len(embeddings), None) and VectorDBBench skips its retry path. Please return an error when the SDK reports False.
| stats = self.client.get_collection_stats(self.collection_name) | ||
| queue = stats.get("indexing_queue", 0) | ||
| count = stats.get("count", 0) | ||
| if queue == 0 and count > 0: |
There was a problem hiding this comment.
TaskRunner passes the expected dataset size through data_size, but this considers any positive count ready. That can accept a partial or stale collection as fully loaded. Please require count >= data_size; also treat empty stats as an error, because the SDK returns {} on RPC failure and the current code then polls until the one-hour timeout.
| ] | ||
|
|
||
| HyperspaceDBLoadConfig = [ | ||
| CaseConfigParamInput_IndexType, |
There was a problem hiding this comment.
This generic selector exposes IVF, PQ, GPU, Flat, AUTOINDEX, and other choices, while the adapter always configures HNSW and ignores the selected index. A user can therefore publish a result labeled as a different index while actually running HNSW. Please use a HyperspaceDB-specific selector limited to HNSW, or omit the selector.
| @@ -0,0 +1,794 @@ | |||
| { | |||
There was a problem hiding this comment.
Please remove this file and the other two HyperspaceDB result files. We do not accept benchmark results generated by contributors into the repository. You are welcome to paste these results in the PR comments for others' reference, but we only merge results tested by maintainers in our own test environment.
| ] | ||
| ef_construction: Annotated[ | ||
| int, | ||
| click.option("--ef-construction", type=int, help="HNSW efConstruction", default=100), |
There was a problem hiding this comment.
This defaults ef_construction to 100, while HyperspaceDBIndexConfig and the UI default it to 200. The same benchmark therefore changes depending on whether it is started through CLI or UI. Please define and reuse one default.
| | lindorm | `pip install vectordb-bench[lindorm]` | | ||
| | volc_mysql | `pip install vectordb-bench[volc_mysql]` | | ||
| | adbpg | `pip install vectordb-bench[adbpg]` | | ||
| | hyperspacedb | `pip install vectordb-bench[hyperspacedb]` | |
There was a problem hiding this comment.
The PR description promises a short usage section with connection parameters and an example vectordbbench hyperspacedb --help command, but this only adds the installation row. Please document --host, optional --api-key, and a minimal CLI example.
| self.client.close() | ||
| self.client = None | ||
|
|
||
| def ready_to_search(self) -> bool: |
There was a problem hiding this comment.
This method is not part of the current VectorDB readiness API and always returns None. Meanwhile, the PR checklist promises a readiness implementation. Please remove this dead method or implement the current readiness hook, such as poll_insert_readiness(), and update the checklist accordingly.
Proposal: Add HyperspaceDB (
[H]) as a new client in VectorDBBenchSummary
We'd like to contribute a new backend client for HyperspaceDB, a vector database written in Rust (project: YAR.INK), and — if the maintainers are open to it — have it evaluated on the standard leaderboard alongside the existing clients (Milvus, Qdrant, Weaviate, PgVector, etc.).
To keep the comparison fair and easy to review, this proposal is scoped to standard, well-understood ground: HNSW-based ANN search under the same L2 / Cosine metrics are already used for every other client in the leaderboard.
What we are explicitly not proposing (yet)
HyperspaceDB also implements non-Euclidean capabilities — a Lorentz/Poincaré hyperbolic index and an experimental wave-diffusion search mode. We are intentionally leaving all of that out of this PR. Reasons:
MetricType/case definitions in VectorDBBench, and we don't want to ask maintainers to build new infrastructure just to evaluate us.So, this PR tests HyperspaceDB purely as an HNSW vector index over L2/Cosine, competing on the same field as everyone else.
What's included in the PR
vectordb_bench/backend/clients/hyperspacedb/config.py—HyperspaceDBConfig(DBConfig),HyperspaceDBIndexConfig(DBCaseConfig)(HNSW params:m,ef_construction,ef_search; metric restricted toL2/COSINEfor this PR)hyperspacedb.py—HyperspaceDB(VectorDB)implementing the standard insert/search/optimize interfaceHyperspaceDBin theDBenum anddb_config/db_case_configvectordb_bench/cli/vectordbbench.pypyproject.toml: newhyperspacedbextratests/test_hyperspacedb.pyfollowing the existing client test patternvectordbbench hyperspacedb --helpcommand), matching the style used for other clientsWhat we're asking from maintainers
VectorDBinterface conventions.Why we think this is worth your time
We believe HyperspaceDB's HNSW implementation performs competitively against the databases currently on the leaderboard, even under the standard metrics they were designed around — that's the specific claim this PR is meant to let your benchmark verify (or refute) independently, rather than something we're asserting without your test.
Checklist
VectorDBinterface (insert, search, optimize,ready_to_load,need_normalize_cosine)db_config/db_case_configreviewed against project conventionspyproject.tomlextra added (hyperspacedb)