> ## Documentation Index
> Fetch the complete documentation index at: https://upstash.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# VECTOR.INFO

> Get the configuration of a vector index.

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`](/docs/redis/commands/vector/vector-count) reports `0` for both a missing index and an empty one.

Vector indexes are an Upstash extension. See the [vector command overview](/docs/redis/commands/vector/overview) for how an index is created, written to, and queried.

## Syntax

```redis theme={"system"}
VECTOR.INFO <index>
```

## Arguments

| Argument | Required | Repeatable | Description |
| - | - | - | - |
| `<index>` | Yes | No | Key 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.

| Protocol | Reply |
| - | - |
| RESP2 | Flat array of alternating field names and values, or Null array |
| RESP3 | Map, or Null |

### Fields

| Field | Description |
| - | - |
| `dimension` | Number of elements in every vector in the index. |
| `metric` | Similarity 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**
>
> ```bash theme={"system"}
> VECTOR.INFO my-index
> ```

> **@upstash/redis**
>
> ```ts theme={"system"}
> import { Redis } from "@upstash/redis";
>
> const redis = Redis.fromEnv();
>
> const index = redis.vector.index("my-index");
> const info = await index.info();
> console.log(info); // { dimension, metric } or null
> ```

> **upstash\_redis**
>
> ```python theme={"system"}
> from upstash_redis import Redis
>
> redis = Redis.from_env()
>
> index = redis.vector.index("my-index")
> info = index.info()
> print(info)  # VectorIndexInfo(dimension=..., metric=...) or None
> ```

> **ioredis**
>
> ```ts theme={"system"}
> import Redis from "ioredis";
>
> const redis = new Redis(process.env.REDIS_URL!);
> const result = await redis.call("VECTOR.INFO", "my-index");
> console.log(result);
> ```

> **node-redis**
>
> ```ts theme={"system"}
> import { createClient } from "redis";
>
> const client = await createClient({ url: process.env.REDIS_URL })
>   .on("error", console.error)
>   .connect();
> const result = await client.sendCommand(["VECTOR.INFO", "my-index"]);
> console.log(result);
> ```

> **redis-py**
>
> ```python theme={"system"}
> import os
> import redis
>
> client = redis.from_url(os.environ["REDIS_URL"])
> result = client.execute_command("VECTOR.INFO", "my-index")
> print(result)
> ```

> **go-redis**
>
> ```go theme={"system"}
> package main
>
> import (
>     "context"
>     "fmt"
>     "os"
>
>     "github.com/redis/go-redis/v9"
> )
>
> func main() {
>     opts, err := redis.ParseURL(os.Getenv("REDIS_URL"))
>     if err != nil {
>         panic(err)
>     }
>     client := redis.NewClient(opts)
>     result, err := client.Do(context.Background(), "VECTOR.INFO", "my-index").Result()
>     if err != nil {
>         panic(err)
>     }
>     fmt.Println(result)
> }
> ```

> **jedis**
>
> ```java theme={"system"}
> import java.net.URI;
>
> import redis.clients.jedis.Jedis;
>
> try (Jedis jedis = new Jedis(new URI(System.getenv("REDIS_URL")))) {
>   Object result = jedis.sendCommand(() -> "VECTOR.INFO".getBytes(), "my-index");
>   System.out.println(result);
> }
> ```

> **redis-rs**
>
> ```rust theme={"system"}
> fn main() -> redis::RedisResult<()> {
>     let url = std::env::var("REDIS_URL").expect("REDIS_URL is not set");
>     let client = redis::Client::open(url)?;
>     let mut connection = client.get_connection()?;
>
>     let mut command = redis::cmd("VECTOR.INFO");
>     command.arg("my-index");
>     let result: redis::Value = command.query(&mut connection)?;
>     println!("{result:?}");
>     Ok(())
> }
> ```


## Related topics

- [VECTOR.COUNT](/docs/redis/commands/vector/vector-count.md)
- [Info](/docs/vector/sdks/py/example_calls/info.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.