node-redis icon indicating copy to clipboard operation
node-redis copied to clipboard

Vector sets

Open nkaradzhov opened this issue 6 months ago • 0 comments

Add Redis Vector Set Commands Support

Overview

This PR implements Redis Vector Set commands (Redis 8.0+), adding 13 new commands with TypeScript support, test coverage, and RESP2/RESP3 protocol compatibility.

New Commands

Command Description
VADD Add vectors to a set
VCARD Get vector set cardinality
VDIM Get vector dimensions
VEMB Get element embeddings
VEMB_RAW Get raw element embeddings
VGETATTR Get element attributes
VINFO Get vector set metadata
VLINKS Get HNSW graph connections
VLINKS_WITHSCORES Get connections with scores
VRANDMEMBER Get random elements
VREM Remove elements
VSETATTR Set element attributes
VSIM Vector similarity search
VSIM_WITHSCORES Similarity search with scores

JSON Helper Functions Relocation

  • Moved RedisJSON utilities from packages/json/lib/commands/helpers.ts to packages/client/lib/commands/generic-transformers.ts
  • Updated all import statements in JSON package
  • JSON package re-exports helpers for backward compatibility

Protocol Support

  • RESP2: Standard array/numeric responses
  • RESP3: Boolean returns for VSETATTR, Map returns for VSIM_WITHSCORES

Testing

  • Added test files for all 14 commands
  • Tests cover argument parsing, integration testing, and RESP2/RESP3 compatibility
  • Tests run against Redis 8.0.2 Docker container

nkaradzhov avatar Jun 16 '25 17:06 nkaradzhov