Skip to content

feat(search): HNSW New Arguments - #3488

Merged
PavelPashov merged 1 commit into
redis:masterfrom
PavelPashov:feat/search-hnsw-sq8-compression
Oct 6, 2026
Merged

PavelPashov merged 1 commit into
redis:masterfrom
PavelPashov:feat/search-hnsw-sq8-compression

Conversation

@PavelPashov

@PavelPashov PavelPashov commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Description

RediSearch 8.12 adds SQ8 scalar quantization to HNSW vector fields. Add two options to SchemaHNSWVectorField:

  • COMPRESSION: 'SQ8' (TYPE must be FLOAT32 or FLOAT16)
  • TRAINING_THRESHOLD: number (0-102400). Applies only with COMPRESSION. 0 disables mean normalization, so an explicit 0 is sent to the server.

Checklist

  • Does npm test pass with this change (including linting)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?

Note

Low Risk
Additive API and command serialization for optional HNSW index parameters, with tests only; no changes to auth, data paths, or existing index behavior.

Overview
Adds RediSearch 8.12 HNSW vector options to client.ft.create: COMPRESSION: 'SQ8' (scalar quantization for FLOAT32 / FLOAT16) and TRAINING_THRESHOLD (0–102400; only meaningful with compression, including explicit 0).

CREATE now maps these fields on HNSW schemas to the matching FT.CREATE tokens (COMPRESSION, TRAINING_THRESHOLD), with TypeScript types and JSDoc on SchemaHNSWVectorField.

Tests cover argument transformation and, on Redis ≥ 8.12, successful index creation/FT.INFO round-trip plus server rejection when TRAINING_THRESHOLD is set without COMPRESSION.

Reviewed by Cursor Bugbot for commit d5c5b5d. Bugbot is set up for automated code reviews on this repo. Configure here.

…ields

RediSearch 8.12 adds SQ8 scalar quantization to HNSW vector fields.
Add two options to SchemaHNSWVectorField:

- COMPRESSION: 'SQ8' (TYPE must be FLOAT32 or FLOAT16)
- TRAINING_THRESHOLD: number (0-102400). Applies only with
  COMPRESSION. 0 disables mean normalization, so an explicit 0 is
  sent to the server.
@PavelPashov
PavelPashov requested a review from nkaradzhov October 5, 2026 13:57

@nkaradzhov nkaradzhov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@PavelPashov
PavelPashov merged commit 0ac209c into redis:master Oct 6, 2026
15 checks passed
@PavelPashov
PavelPashov deleted the feat/search-hnsw-sq8-compression branch October 6, 2026 09:58
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.

2 participants