diff --git a/content/commands/vadd.md b/content/commands/vadd.md index 8c3dbeeca..735077229 100644 --- a/content/commands/vadd.md +++ b/content/commands/vadd.md @@ -38,7 +38,7 @@ is the name of the key that will hold the vector set data.
FP32 vector or VALUES num vector -either a 32-bit floating point (FP32) blob of values or `num` floating point numbers as strings. +either a 32-bit floating point (FP32) blob of values or `num` floating point numbers as strings. When using the FP32 format, the blob must use little-endian encoding. On platforms with different endianness, you should either manually adjust the byte order or use the VALUES syntax instead.
diff --git a/content/commands/vemb.md b/content/commands/vemb.md index 998ff6c6a..40eefa024 100644 --- a/content/commands/vemb.md +++ b/content/commands/vemb.md @@ -82,7 +82,7 @@ One of the following: * [Array reply](../../develop/reference/protocol-spec#arrays): consisting of the following elements: 1. The quantization type as a [simple string](../../develop/reference/protocol-spec#simple-strings): `fp32`, `bin`, or `q8`. 1. A [bulk string](../../develop/reference/protocol-spec#bulk-strings) blob with the following raw data: - * 4-byte floats for fp32 + * 4-byte floats for fp32 (little-endian encoding) * A bitmap for binary quantization * A byte array for q8 1. The L2 norm, as a [simple string](../../develop/reference/protocol-spec#simple-strings), of the vector before normalization. @@ -95,7 +95,7 @@ One of the following: * [Array reply](../../develop/reference/protocol-spec#arrays): consisting of the following elements: 1. The quantization type as a [simple string](../../develop/reference/protocol-spec#simple-strings): `fp32`, `bin`, or `q8`. 1. A [bulk string](../../develop/reference/protocol-spec#bulk-strings) blob with the following raw data: - * 4-byte floats for fp32 + * 4-byte floats for fp32 (little-endian encoding) * A bitmap for binary quantization * A byte array for q8 1. The [double](../../develop/reference/protocol-spec#doubles) L2 norm of the vector before normalization. diff --git a/content/commands/vlinks.md b/content/commands/vlinks.md index f6288764a..4de1fd909 100644 --- a/content/commands/vlinks.md +++ b/content/commands/vlinks.md @@ -66,14 +66,16 @@ includes similarity scores for each neighbor. tab2="RESP3" >}} One of the following: -* [Array reply](../../develop/reference/protocol-spec#arrays) containing the names of adjacent elements as [strings](../../develop/reference/protocol-spec#simple-strings); interleved with scores when using the WITHSCORES option. +* An [array](../../develop/reference/protocol-spec#arrays) of [array replies](../../develop/reference/protocol-spec#arrays) containing the names of adjacent elements as [bulk strings](../../develop/reference/protocol-spec#bulk-strings); interleaved with scores as [bulk strings](../../develop/reference/protocol-spec#bulk-strings) when used with the `WITHSCORES` option. +* [Simple error reply](../../develop/reference/protocol-spec/#simple-errors) for incorrect syntax. * [Bulk string reply](../../develop/reference/protocol-spec#bulk-strings) (null bulk string) for unknown keys and/or elements. -tab-sep- One of the following: -* [Array reply](../../develop/reference/protocol-spec#arrays) containing the names of adjacent elements as [strings](../../develop/reference/protocol-spec#simple-strings) when used without the WITHSCORES option. -* [Map reply](../../develop/reference/protocol-spec#maps) containing the names of adjecent elements as [strings](../../develop/reference/protocol-spec#simple-strings), together with their scores as [doubles](../../develop/reference/protocol-spec#doubles) when used with the WITHSCORES option. +* An [array](../../develop/reference/protocol-spec#arrays) of [array replies](../../develop/reference/protocol-spec#arrays) containing the names of adjacent elements as [bulk strings](../../develop/reference/protocol-spec#bulk-strings) when used without the `WITHSCORES` option. +* An [array](../../develop/reference/protocol-spec#arrays) of [map replies](../../develop/reference/protocol-spec#maps) containing the names of adjecent elements as [bulk strings](../../develop/reference/protocol-spec#bulk-strings), together with their scores as [doubles](../../develop/reference/protocol-spec#doubles) when used with the `WITHSCORES` option. +* [Simple error reply](../../develop/reference/protocol-spec/#simple-errors) for incorrect syntax. * [Null reply](../../develop/reference/protocol-spec#nulls) for unknown keys and/or elements. {{< /multitabs >}} diff --git a/content/commands/vsim.md b/content/commands/vsim.md index 78a568a3c..f7bb587ef 100644 --- a/content/commands/vsim.md +++ b/content/commands/vsim.md @@ -70,7 +70,7 @@ is the name of the key that holds the vector set data.
ELE | FP32 | VALUES num -specifies how the input vector is provided. Use `ELE` to refer to an existing element, `FP32` for binary float format, or `VALUES num` for a list of stringified float values. +specifies how the input vector is provided. Use `ELE` to refer to an existing element, `FP32` for binary float format (little-endian encoding required), or `VALUES num` for a list of stringified float values.
diff --git a/content/develop/data-types/vector-sets/_index.md b/content/develop/data-types/vector-sets/_index.md index f730a52f6..b9046b705 100644 --- a/content/develop/data-types/vector-sets/_index.md +++ b/content/develop/data-types/vector-sets/_index.md @@ -40,6 +40,14 @@ The following commands are available for vector sets: - [VSETATTR]({{< relref "/commands/vsetattr" >}}) - set or replace attributes on a vector set element. - [VSIM]({{< relref "/commands/vsim" >}}) - retrieve elements similar to a given vector or element with optional filtering. +## Endianness considerations for FP32 format + +When using the FP32 blob format with vector set commands like [`VADD`]({{< relref "/commands/vadd" >}}) and [`VSIM`]({{< relref "/commands/vsim" >}}), the binary data must be encoded in little-endian byte order. This is important for cross-platform compatibility, as some ARM variants and other architectures may use different endianness. + +If your platform uses big-endian or mixed-endian encoding, you have two options: +- Manually convert the byte order to little-endian before passing the blob to Redis. +- Use the `VALUES` syntax instead, which accepts floating-point numbers as strings and is platform-independent. + ## Examples The following examples give an overview of how to use vector sets. For clarity,