Required. The resource name of the ReasoningEngine to generate memories for. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoningEngine}
Request body
The request body contains data with the following structure:
Fields
disableConsolidation
boolean
Optional. If true, generated memories will not be consolidated with existing memories; all generated memories will be added as new memories regardless of whether they are duplicates of or contradictory to existing memories. By default, memory consolidation is enabled.
scope
map (key: string, value: string)
Optional. The scope of the memories that should be generated. Memories will be consolidated across memories with the same scope. Must be provided unless the scope is defined in the source content. If scope is provided, it will override the scope defined in the source content. scope values cannot contain the wildcard character '*'.
source
Union type
Source content used to generate memories. source can be only one of the following:
Defines a direct source of memories that should be uploaded to Memory Bank. This is similar to memories.create, but it allows for consolidation between these new memories and existing memories for the same scope.
Response body
If successful, the response body contains an instance of Operation.
VertexSessionSource
Defines an Agent Engine Session from which to generate the memories. If scope is not provided, the scope will be extracted from the Session (i.e. {"userId": sesison.user_id}).
Fields
session
string
Required. The resource name of the Session to generate memories for. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoningEngine}/sessions/{session}
Optional. time range to define which session events should be used to generate memories. Start time (inclusive) of the time range. If not set, the start time is unbounded.
Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".
Optional. End time (exclusive) of the time range. If not set, the end time is unbounded.
Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".
[[["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.generate\n\n**Full name**: projects.locations.reasoningEngines.memories.generate\n\nGenerate memories. \n\n### Endpoint\n\npost `https:``/``/{service-endpoint}``/v1beta1``/{parent}``/memories:generate` \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 generate memories for. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoningEngine}`\n\n### Request body\n\nThe request body contains data with the following structure:\nFields `disableConsolidation` `boolean` \nOptional. If true, generated memories will not be consolidated with existing memories; all generated memories will be added as new memories regardless of whether they are duplicates of or contradictory to existing memories. By default, memory consolidation is enabled.\n`scope` `map (key: string, value: string)` \nOptional. The scope of the memories that should be generated. Memories will be consolidated across memories with the same scope. Must be provided unless the scope is defined in the source content. If `scope` is provided, it will override the scope defined in the source content. scope values cannot contain the wildcard character '\\*'. \n`source` `Union type` \nSource content used to generate memories. `source` can be only one of the following:\n`vertexSessionSource` `object (`[VertexSessionSource](/vertex-ai/docs/reference/rest/v1beta1/projects.locations.reasoningEngines.memories/generate#VertexSessionSource)`)` \nDefines a Vertex Session as the source content from which to generate memories.\n`directContentsSource` `object (`[DirectContentsSource](/vertex-ai/docs/reference/rest/v1beta1/projects.locations.reasoningEngines.memories/generate#DirectContentsSource)`)` \nDefines a direct source of content as the source content from which to generate memories.\n`directMemoriesSource` `object (`[DirectMemoriesSource](/vertex-ai/docs/reference/rest/v1beta1/projects.locations.reasoningEngines.memories/generate#DirectMemoriesSource)`)` \nDefines a direct source of memories that should be uploaded to Memory Bank. This is similar to `memories.create`, but it allows for consolidation between these new memories and existing memories for the same scope. \n\n### Response body\n\nIf successful, the response body contains an instance of [Operation](/vertex-ai/docs/reference/rest/Shared.Types/ListOperationsResponse#Operation).\n\nVertexSessionSource\n-------------------\n\nDefines an Agent Engine Session from which to generate the memories. If `scope` is not provided, the scope will be extracted from the Session (i.e. {\"userId\": sesison.user_id}).\nFields `session` `string` \nRequired. The resource name of the Session to generate memories for. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoningEngine}/sessions/{session}`\n`startTime` `string (`[Timestamp](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp)` format)` \nOptional. time range to define which session events should be used to generate memories. Start time (inclusive) of the time range. If not set, the start time is unbounded.\n\nUses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than \"Z\" are also accepted. Examples: `\"2014-10-02T15:01:23Z\"`, `\"2014-10-02T15:01:23.045123456Z\"` or `\"2014-10-02T15:01:23+05:30\"`.\n`endTime` `string (`[Timestamp](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp)` format)` \nOptional. End time (exclusive) of the time range. If not set, the end time is unbounded.\n\nUses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than \"Z\" are also accepted. Examples: `\"2014-10-02T15:01:23Z\"`, `\"2014-10-02T15:01:23.045123456Z\"` or `\"2014-10-02T15:01:23+05:30\"`. \n\nDirectContentsSource\n--------------------\n\nDefines a direct source of content from which to generate the memories.\nFields `events[]` `object (`[Event](/vertex-ai/docs/reference/rest/v1beta1/projects.locations.reasoningEngines.memories/generate#Event)`)` \nRequired. The source content (i.e. chat history) to generate memories from. \n\nEvent\n-----\n\nA single piece of conversation from which to generate memories.\nFields `content` `object (`[Content](/vertex-ai/docs/reference/rest/v1beta1/Content)`)` \nRequired. A single piece of content from which to generate memories. \n\nDirectMemoriesSource\n--------------------\n\nDefines a direct source of memories that should be uploaded to Memory Bank with consolidation.\nFields `directMemories[]` `object (`[DirectMemory](/vertex-ai/docs/reference/rest/v1beta1/projects.locations.reasoningEngines.memories/generate#DirectMemory)`)` \nRequired. The direct memories to upload to Memory Bank. At most 5 direct memories are allowed per request. \n\nDirectMemory\n------------\n\nA direct memory to upload to Memory Bank.\nFields `fact` `string` \nRequired. The fact to consolidate with existing memories."]]