Having a vector embedding like [1,2,3,4], I can create a blob byte representation with Python using the NumPy library using something like this:
np.array([1,2,3,4]).astype(dtype=np.float32).tobytes()
This will create an output that looks like this:
\x00\x00\x80?\x00\x00\x00@\x00\x00@@\x00\x00\x80@'
How do I create such a blob string with JavaScript?
From the
node-redisclient https://github.com/redis/node-redis/blob/master/examples/search-knn.js