Upstash Documentation

VECTOR.INFO

Get the configuration of a vector index.
2 min read

Use VECTOR.INFO to read the dimension and metric an index was created with.

Both values are fixed at creation, so this is how a client discovers the shape a vector must have before writing to an index it did not create. The reply is null when the index does not exist, which makes it the command to check existence with, since VECTOR.COUNT reports 0 for both a missing index and an empty one.

Vector indexes are an Upstash extension. See the vector command overview for how an index is created, written to, and queried.

Syntax#

Arguments#

ArgumentRequiredRepeatableDescription
<index>YesNoKey holding the vector index.

Response#

The reply reports the result of the operation. Error replies have the same shape in RESP2 and RESP3 and are surfaced as exceptions by the SDKs below.

ProtocolReply
RESP2Flat array of alternating field names and values, or Null array
RESP3Map, or Null

Fields#

FieldDescription
dimensionNumber of elements in every vector in the index.
metricSimilarity metric: COSINE, EUCLIDEAN, or DOT.
Note

Client libraries often decode bulk strings, maps, sets, and numeric strings into language-native values. The table describes the Redis wire reply.

Examples#

TCP examples use the TLS REDIS_URL from the Upstash console. REST examples use UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN.

Redis CLI
@upstash/redis
Note

This command is not supported yet in @upstash/redis.

upstash_redis
Note

This command is not supported yet in upstash_redis.

ioredis
node-redis
redis-py
go-redis
jedis
redis-rs