Skip to content

[CPP Runtime] Add get_distance and reconstruct_at to VamanaIndex API#315

Draft
yuejiaointel wants to merge 1 commit intomainfrom
yuejiao/add-get-distance-reconstruct
Draft

[CPP Runtime] Add get_distance and reconstruct_at to VamanaIndex API#315
yuejiaointel wants to merge 1 commit intomainfrom
yuejiao/add-get-distance-reconstruct

Conversation

@yuejiaointel
Copy link
Copy Markdown
Contributor

@yuejiaointel yuejiaointel commented Apr 8, 2026

Summary

  • Add get_distance() and reconstruct_at() methods to the runtime shared library (VamanaIndex and DynamicVamanaIndex)
  • get_distance computes distance between a stored vector (by ID) and a query vector, returning a double
  • reconstruct_at decompresses/reconstructs stored vectors back to float32 by ID — works transparently with all storage kinds (FP32, FP16, SQI8, LVQ, LeanVec)
  • Both methods follow the existing runtime API pattern: pure virtual in the public header, runtime_error_wrapper in the manager, orchestrator dispatch in the impl layer

Needed for the OpenSearch release integration.

Add get_distance() and reconstruct_at() methods to the runtime library
for OpenSearch integration. These expose existing orchestrator-layer
functionality through the shared library ABI.

- get_distance: computes distance between a stored vector and a query
- reconstruct_at: decompresses/reconstructs vectors to float32 by ID
- Works with all storage kinds (FP32, FP16, SQI8, LVQ, LeanVec)
- Added to both VamanaIndex (static) and DynamicVamanaIndex
- Includes tests for both index types
@yuejiaointel yuejiaointel marked this pull request as draft April 9, 2026 00:42
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.

1 participant