{
  "schema_version": 2,
  "id": "commands/vemb",
  "title": "VEMB",
  "url": "https://redis.io/docs/latest/commands/vemb/",
  "summary": "Return the vector associated with an element.",
  "since": "8.0.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-18T09:47:58+01:00",
  "page_type": "content",
  "content_hash": "b07de4c4db1b9fba43f7d2b176851133c322b0fa438fa42d4526cbcd07899ecd",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Return the approximate vector associated with a given element in the vector set.\n\n[code example]\n\nVector sets normalize and may quantize vectors on insertion. `VEMB` reverses this process to approximate the original vector by de-normalizing and de-quantizing it.\n\nTo retrieve the raw internal representation, use the `RAW` option:\n\n[code example]"
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open>\n<summary><code>key</code></summary>\n\nis the name of the key that holds the vector set.\n</details>\n\n<details open>\n<summary><code>element</code></summary>\n\nis the name of the element whose vector you want to retrieve.\n</details>"
    },
    {
      "id": "optional-arguments",
      "title": "Optional arguments",
      "role": "parameters",
      "text": "<details open>\n<summary><code>RAW</code></summary>\n\nreturns the raw vector data, its quantization type, and metadata such as norm and range.\n</details>"
    },
    {
      "id": "redis-software-and-redis-cloud-compatibility",
      "title": "Redis Software and Redis Cloud compatibility",
      "role": "content",
      "text": "| Redis<br />Software | Redis<br />Cloud | <span style=\"min-width: 9em; display: table-cell\">Notes</span> |\n|:----------------------|:-----------------|:------|\n| <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Not supported\"><nobr>&#x274c; Active-Active</nobr></span> | <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Not supported\"><nobr>&#x274c; Active-Active</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\nOne of the following:\n* [Array reply](../../develop/reference/protocol-spec#arrays): of real numbers as [bulk strings](../../develop/reference/protocol-spec#bulk-strings), representing the vector.\n* [Array reply](../../develop/reference/protocol-spec#arrays): consisting of the following elements:\n    1. The quantization type as a [simple string](../../develop/reference/protocol-spec#simple-strings): `fp32`, `bin`, or `q8`.\n    1. A [bulk string](../../develop/reference/protocol-spec#bulk-strings) blob with the following raw data:\n        * 4-byte floats for fp32 (little-endian encoding)\n        * A bitmap for binary quantization\n        * A byte array for q8\n    1. The L2 norm, as a [simple string](../../develop/reference/protocol-spec#simple-strings), of the vector before normalization.\n    1. (Only for q8): The quantization range as a [simple string](../../develop/reference/protocol-spec#simple-strings). Multiply this by integer components to recover normalized values.\n\n**RESP3:**\n\nOne of the following:\n* [Array reply](../../develop/reference/protocol-spec#arrays): of [doubles](../../develop/reference/protocol-spec#doubles), representing the vector.\n* [Array reply](../../develop/reference/protocol-spec#arrays): consisting of the following elements:\n    1. The quantization type as a [simple string](../../develop/reference/protocol-spec#simple-strings): `fp32`, `bin`, or `q8`.\n    1. A [bulk string](../../develop/reference/protocol-spec#bulk-strings) blob with the following raw data:\n        * 4-byte floats for fp32 (little-endian encoding)\n        * A bitmap for binary quantization\n        * A byte array for q8\n    1. The [double](../../develop/reference/protocol-spec#doubles) L2 norm of the vector before normalization.\n    1. (Only for q8): The quantization range as a [double](../../develop/reference/protocol-spec#doubles). Multiply this by integer components to recover normalized values."
    },
    {
      "id": "related-topics",
      "title": "Related topics",
      "role": "related",
      "text": "- [Vector sets](https://redis.io/docs/latest/develop/data-types/vector-sets)"
    }
  ],
  "examples": [
    {
      "id": "overview-ex0",
      "language": "shell",
      "code": "VEMB word_embeddings SQL\n1) \"0.18208661675453186\"\n2) \"0.08535309880971909\"\n3) \"0.1365649551153183\"\n4) \"-0.16501599550247192\"\n5) \"0.14225517213344574\"\n... 295 more elements ...",
      "section_id": "overview"
    },
    {
      "id": "overview-ex1",
      "language": "shell",
      "code": "VEMB word_embeddings apple RAW\n1) int8\n2) \"\\xf1\\xdc\\xfd\\x1e\\xcc%E...\\xde\\x1f\\xfbN\" # artificially shortened for this example\n3) \"3.1426539421081543\"\n4) \"0.17898885905742645\"",
      "section_id": "overview"
    }
  ]
}
