Stay organized with collections
Save and categorize content based on your preferences.
This guide provides information about optional metadata for vector embeddings.
Vector Search lets you define metadata for each embedding.
Metadata is non-filterable, arbitrary information that Vector Search
can store for each embedding. This can provide embeddings with useful context
such as:
Product details, such as name, price, and an image URL.
Descriptions, snippets, dates, and authorship for text embeddings.
User information for user embeddings.
Coordinates for place embeddings.
Key features and benefits
Features and benefits of using metadata include:
Context with results: Information can be provided directly in
your search results, which eliminates the need for separate lookups
and reduces latency.
Flexible structure: Metadata is provided as a JSON object,
which allows the metadata to be defined as complex, nested data.
Non-Filterable: Vector embedding metadata is for storing and retrieving
non-filterable information that's distinct from restricts and
numeric_restricts.
Efficient updates: The update_mask field lets you specify that APIs
only update metadata to avoid resubmitting embedding vectors.
Decoupled Information: Non-filterable information can be separated from
filterable attributes like restricts.
Streamlined development: Search responses include metadata associated
with a vector embedding, while reducing the complexity needed for features
such as displaying rich search results and performing context-based
post-processing.
Data format
An optional embedding_metadata field holds a JSON object that
flexibly associates rich, non-filterable information with embeddings in
Vector Search. This can streamline applications by returning context
with results and allows efficient metadata-only updates using update_mask
for the upsertDatapoints API.
Example data point structure:
{"id":"movie_001","embedding":[0.1,0.2,...,0.3],"sparse_embedding":{"values":[-0.4,0.2,-1.3],"dimensions":[10,20,30]},"numeric_restricts":[{'namespace':'year','value_int':2022}],"restricts":[{'namespace':'genre','allow':['action','comedy']}],#---Newembedding_metadatafield---"embedding_metadata":{"title":"Ballet Train","runtime":{"hours":2,"minutes":6},"review_info":{"review":"This movie is fun and...","rotten_potatoes_rating":76}}#------------------------------------},#...otherdatapoints
Ingesting data with embedding_metadata
When adding data points, you can include embedding_metadata when one of the
following actions occurs:
Uploading a file (Cloud Storage):
Use JSON or AVROformats.
CSV isn't supported for embedding_metadata.
Using the upsertDatapoints API:
Pass data point objects (including embedding_metadata) in the API request
payload.
Retrieving embedding_metadata during queries
When performing a standard nearest-neighbor search using the
findNeighbors API, the embedding_metadata field for each neighbor is
automatically included in the response if returnFullDatapoint
is set to True.
Update metadata using the upsertDatapoints API and an update_mask
using the value embedding_metadata. The update_mask field might also
include additional mask values. For uses of a field mask, see
Update embedding metadata.
The update_mask field helps to ensure that only embedding_metadata is updated,
avoiding resubmission of restrict and embedding fields.
The following example demonstrates how to define and update metadata to create a
targeted IndexDatapoint, specifying update_mask, and calling
upsertDatapoints.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Vector Search embeddings with metadata\n\n| **Preview**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nThis guide provides information about optional metadata for vector embeddings.\nVector Search lets you define metadata for each embedding.\n\nMetadata is non-filterable, arbitrary information that Vector Search\ncan store for each embedding. This can provide embeddings with useful context\nsuch as:\n\n- Product details, such as name, price, and an image URL.\n\n- Descriptions, snippets, dates, and authorship for text embeddings.\n\n- User information for user embeddings.\n\n- Coordinates for place embeddings.\n\nKey features and benefits\n-------------------------\n\nFeatures and benefits of using metadata include:\n\n- **Context with results**: Information can be provided directly in\n your search results, which eliminates the need for separate lookups\n and reduces latency.\n\n- **Flexible structure** : Metadata is provided as a **JSON object**,\n which allows the metadata to be defined as complex, nested data.\n\n- **Non-Filterable** : Vector embedding metadata is for storing and retrieving\n non-filterable information that's distinct from `restricts` and\n `numeric_restricts`.\n\n- **Efficient updates** : The `update_mask` field lets you specify that APIs\n *only* update metadata to avoid resubmitting embedding vectors.\n\n- **Decoupled Information** : Non-filterable information can be separated from\n filterable attributes like `restricts`.\n\n- **Streamlined development**: Search responses include metadata associated\n with a vector embedding, while reducing the complexity needed for features\n such as displaying rich search results and performing context-based\n post-processing.\n\nData format\n-----------\n\nAn optional `embedding_metadata` field holds a JSON object that\nflexibly associates rich, non-filterable information with embeddings in\nVector Search. This can streamline applications by returning context\nwith results and allows efficient metadata-only updates using `update_mask`\nfor the `upsertDatapoints` API.\n| **Note:** Use `restricts` and `numeric_restricts` for filtering data.\n\nExample data point structure: \n\n {\n \"id\": \"movie_001\",\n \"embedding\": [0.1, 0.2, ..., 0.3],\n \"sparse_embedding\": {\n \"values\": [-0.4, 0.2, -1.3],\n \"dimensions\": [10, 20, 30]\n },\n \"numeric_restricts\": [{'namespace': 'year', 'value_int': 2022}],\n \"restricts\": [{'namespace': 'genre', 'allow': ['action', 'comedy']}],\n\n # --- New embedding_metadata field ---\n \"embedding_metadata\": {\n \"title\": \"Ballet Train\",\n \"runtime\": {\n \"hours\": 2,\n \"minutes\": 6\n },\n \"review_info\": {\n \"review\": \"This movie is fun and...\",\n \"rotten_potatoes_rating\": 76\n }\n }\n # ------------------------------------\n },\n # ... other data points\n\nIngesting data with `embedding_metadata`\n----------------------------------------\n\nWhen adding data points, you can include `embedding_metadata` when one of the\nfollowing actions occurs:\n\n- Uploading a file (Cloud Storage):\n - Use **JSON** or **AVRO** [formats](/vertex-ai/docs/vector-search/setup/format-structure). **CSV isn't supported** for `embedding_metadata`.\n- Using the `upsertDatapoints` API:\n - Pass data point objects (including `embedding_metadata`) in the API request payload.\n\n| **Note:** `embedding_metadata` has a size limit of 2 KB for each datapoint.\n\nRetrieving `embedding_metadata` during queries\n----------------------------------------------\n\nWhen performing a standard nearest-neighbor search using the\n`findNeighbors` API, the `embedding_metadata` field for each neighbor is\n**automatically included** in the response if `returnFullDatapoint`\nis set to `True`. \n\n### curl\n\n curl -X POST -H \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n \"https://${PUBLIC_ENDPOINT_DOMAIN}/v1/projects/${PROJECT_ID}/locations/${LOCATION}/indexEndpoints/${INDEX_ENDPOINT_ID}:findNeighbors\" \\\n -d '{deployedIndexId:\"${DEPLOYED_INDEX_ID}\", \"queries\":[{datapoint:{\"featureVector\":\"\u003cFEATURE_VECTOR\u003e\"}}], returnFullDatapoint:true}'\n\nUpdating `embedding_metadata`\n-----------------------------\n\nUpdate metadata using the `upsertDatapoints` API and an `update_mask`\nusing the value `embedding_metadata`. The `update_mask` field might also\ninclude additional mask values. For uses of a field mask, see\n[Update embedding metadata](/vertex-ai/docs/vector-search/update-rebuild-index#upsert-metadata).\n\nThe `update_mask` field helps to ensure that only `embedding_metadata` is updated,\navoiding resubmission of restrict and embedding fields.\n| **Note:** This can also include existing `FieldMask` values, such as [all_restricts](/vertex-ai/docs/vector-search/update-rebuild-index#upsert-metadata), along with `embedding_metadata` in the request.\n\nThe following example demonstrates how to define and update metadata to create a\ntargeted `IndexDatapoint`, specifying `update_mask`, and calling\n`upsertDatapoints`. \n\n### curl\n\n curl -H \"Content-Type: application/json\" -H \"Authorization: Bearer `gcloud auth print-access-token`\" https://${LOCATION}-aiplatform.googleapis.com/v1/projects/${PROJECT_ID}/locations/${LOCATION}/indexes/${INDEX_ID}:upsertDatapoints \\\n -d '{\n datapoints:[\n {\n datapoint_id: \"'${DATAPOINT_ID_1}'\",\n feature_vector: [...],\n embedding_metadata:{\"title\": \"updated title\", \"rating\": 4.5, \"tags\": [\"updated\", \"reviewed\"]\n }, update_mask: \"embedding_metadata\"}'"]]