Required. The resource name of the ReasoningEngine to retrieve memories from. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoningEngine}
Request body
The request body contains data with the following structure:
Fields
scope
map (key: string, value: string)
Required. The scope of the memories to retrieve. A memory must have exactly the same scope (Memory.scope) as the scope provided here to be retrieved (same keys and values). Order does not matter, but it is case-sensitive.
retrieval_params
Union type
Parameters for retrieval. retrieval_params can be only one of the following:
A token that can be sent as pageToken to retrieve the next page. If this field is omitted, there are no subsequent pages. This token is not set if similarity search was used for retrieval.
Optional. The maximum number of memories to return. The service may return fewer than this value. If unspecified, at most 3 memories will be returned. The maximum value is 100; values above 100 will be coerced to 100.
JSON representation
{"searchQuery": string,"topK": integer}
SimpleRetrievalParams
Parameters for simple (non-similarity search) retrieval.
Fields
pageSize
integer
Optional. The maximum number of memories to return. The service may return fewer than this value. If unspecified, at most 3 memories will be returned. The maximum value is 100; values above 100 will be coerced to 100.
pageToken
string
Optional. A page token, received from a previous memories.retrieve call. Provide this to retrieve the subsequent page.
The distance between the query and the retrieved Memory. Smaller values indicate more similar memories. This is only set if similarity search was used for retrieval.
[[["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-07-31 UTC."],[],[],null,["# Method: memories.retrieve\n\n**Full name**: projects.locations.reasoningEngines.memories.retrieve\n\nRetrieve memories. \n\n### Endpoint\n\npost `https:``/``/{service-endpoint}``/v1beta1``/{parent}``/memories:retrieve` \nWhere `{service-endpoint}` is one of the [supported service endpoints](/vertex-ai/docs/reference/rest#rest_endpoints).\n\n### Path parameters\n\n`parent` `string` \nRequired. The resource name of the ReasoningEngine to retrieve memories from. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoningEngine}`\n\n### Request body\n\nThe request body contains data with the following structure:\nFields `scope` `map (key: string, value: string)` \nRequired. The scope of the memories to retrieve. A memory must have exactly the same scope (`Memory.scope`) as the scope provided here to be retrieved (same keys and values). Order does not matter, but it is case-sensitive. \n`retrieval_params` `Union type` \nParameters for retrieval. `retrieval_params` can be only one of the following:\n`similaritySearchParams` `object (`[SimilaritySearchParams](/vertex-ai/docs/reference/rest/v1beta1/projects.locations.reasoningEngines.memories/retrieve#SimilaritySearchParams)`)` \nParameters for semantic similarity search based retrieval.\n`simpleRetrievalParams` `object (`[SimpleRetrievalParams](/vertex-ai/docs/reference/rest/v1beta1/projects.locations.reasoningEngines.memories/retrieve#SimpleRetrievalParams)`)` \nParameters for simple (non-similarity search) retrieval. \n\n### Response body\n\nResponse message for [MemoryBankService.RetrieveMemories](/vertex-ai/docs/reference/rest/v1beta1/projects.locations.reasoningEngines.memories/retrieve#google.cloud.aiplatform.v1beta1.MemoryBankService.RetrieveMemories).\n\nIf successful, the response body contains data with the following structure:\nFields `retrievedMemories[]` `object (`[RetrievedMemory](/vertex-ai/docs/reference/rest/v1beta1/projects.locations.reasoningEngines.memories/retrieve#RetrievedMemory)`)` \nThe retrieved memories.\n`nextPageToken` `string` \nA token that can be sent as `pageToken` to retrieve the next page. If this field is omitted, there are no subsequent pages. This token is not set if similarity search was used for retrieval. \n\nSimilaritySearchParams\n----------------------\n\nParameters for semantic similarity search based retrieval.\nFields `searchQuery` `string` \nRequired. Query to use for similarity search retrieval. If provided, then the parent ReasoningEngine must have [ReasoningEngineContextSpec.MemoryBankConfig.SimilaritySearchConfig](/vertex-ai/docs/reference/rest/v1beta1/projects.locations.reasoningEngines#SimilaritySearchConfig) set.\n`topK` `integer` \nOptional. The maximum number of memories to return. The service may return fewer than this value. If unspecified, at most 3 memories will be returned. The maximum value is 100; values above 100 will be coerced to 100. \n\nSimpleRetrievalParams\n---------------------\n\nParameters for simple (non-similarity search) retrieval.\nFields `pageSize` `integer` \nOptional. The maximum number of memories to return. The service may return fewer than this value. If unspecified, at most 3 memories will be returned. The maximum value is 100; values above 100 will be coerced to 100.\n`pageToken` `string` \nOptional. A page token, received from a previous `memories.retrieve` call. Provide this to retrieve the subsequent page. \n\nRetrievedMemory\n---------------\n\nA retrieved memory.\nFields `memory` `object (`[Memory](/vertex-ai/docs/reference/rest/v1beta1/projects.locations.reasoningEngines.memories#Memory)`)` \nThe retrieved Memory.\n`distance` `number` \nThe distance between the query and the retrieved Memory. Smaller values indicate more similar memories. This is only set if similarity search was used for retrieval."]]