vertexai: add memory customization fields to google_vertex_ai_reasoning_engine - #18577
Conversation
…ing Engine feat(tests): implement tests for new memory customization features in Reasoning Engine The commit introduces new customizable properties in the Reasoning Engine's YAML configuration, specifically for managing memory generation. This includes the ability to disable natural language memory generation and provide example memory configurations. Additionally, tests are added to verify the expected behavior of these changes, ensuring robustness and reliability as the system evolves.
wadhah101
left a comment
There was a problem hiding this comment.
Inline source references for each new attribute — note the REST API reference page is not up to date: its MemoryBankConfig section currently omits customizationConfigs, so the references below point to the discovery document and the published guides.
| type: Boolean | ||
| description: |- | ||
| Optional. Generate memories in the third person if set to true. | ||
| - name: 'disableNaturalLanguageMemories' |
There was a problem hiding this comment.
Source: disableNaturalLanguageMemories in GoogleCloudAiplatformV1beta1MemoryBankCustomizationConfig (v1beta1 discovery doc):
Optional. Indicates whether natural language memory generation should be disabled for all requests. By default, natural language memory generation is enabled. Set this to
truewhen you only want to generate structured memories.
Also documented in the Memory Profiles guide and the Python SDK type reference. Not yet listed on the REST reference page (API docs page is out of date).
| Optional. If true, natural language memory generation is disabled for the | ||
| scopes that this customization config applies to. Set this to true when you | ||
| only want to generate structured memories. | ||
| - name: 'generateMemoriesExamples' |
There was a problem hiding this comment.
Source: generateMemoriesExamples in GoogleCloudAiplatformV1beta1MemoryBankCustomizationConfig (v1beta1 discovery doc):
Optional. Provides examples of how to generate memories for a particular scope.
Nested types: ...GenerateMemoriesExample (conversationSource, generatedMemories), ...ConversationSource (events[].content), ...GeneratedMemory (fact — Required, topics). Usage documented with code samples in the Memory Bank setup guide — "Natural language memory customization configuration" and the Python SDK type reference. Not yet listed on the REST reference page (API docs page is out of date).
| item_type: | ||
| type: NestedObject | ||
| properties: | ||
| - name: 'managedMemoryTopic' |
There was a problem hiding this comment.
Source: topics[] is GoogleCloudAiplatformV1beta1MemoryTopicId in the discovery doc: managedMemoryTopic (enum: USER_PERSONAL_INFO, USER_PREFERENCES, KEY_CONVERSATION_DETAILS, EXPLICIT_INSTRUCTIONS) or customMemoryTopicLabel (string). Modeled as plain strings to match the API shape.
|
Googlers: For automatic test runs see go/terraform-auto-test-runs. @slevenick, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look. You can help make sure that review is quick by doing a self-review and by running impacted tests locally. |
|
hey @BBBmau can you check this ? I have added all references to attributes not yet included in the API page, but included in the rest version https://aiplatform.googleapis.com/$discovery/rest?version=v1beta1 |
Follow-up to #18498, split out per reviewer request.
Adds the two remaining
contextSpec.memoryBankConfig.customizationConfigs[]fields for API parity:disable_natural_language_memoriesgenerate_memories_examples(few-shot examples: input conversation → expected memories)On documentation: the REST API reference page is not up to date — its
MemoryBankConfigsection omitscustomizationConfigsentirely. The fields are public and documented in:GoogleCloudAiplatformV1beta1MemoryBankCustomizationConfig,...GenerateMemoriesExampledisable_natural_language_memories)Per-attribute source references are added as inline review comments on the YAML.
Test coverage: new handwritten
TestAccVertexAIReasoningEngine_memoryCustomizationUpdateexercises both fields (create with examples + managed/custom topics, update to structured-only with NL memories disabled, import verify at each step), and thevertex_ai_reasoning_engine_context_specexample now includesgenerate_memories_examples.Release Note Template for Downstream PRs (will be copied)