From 0e8e285339034c3bc1ad28cbf55add550afe0d05 Mon Sep 17 00:00:00 2001 From: A Vertex SDK engineer Date: Wed, 1 Jul 2026 17:17:54 -0700 Subject: [PATCH] feat: Add revision_labels, revision_expire_time, revision_ttl, disable_memory_revisions, metadata, metadata_merge_strategy and overlap_event_count to Memory Bank IngestEvents API PiperOrigin-RevId: 941371961 --- src/converters/_memories_converters.ts | 50 ++++++++++++++++++++++++++ src/types/common.ts | 14 ++++++++ 2 files changed, 64 insertions(+) diff --git a/src/converters/_memories_converters.ts b/src/converters/_memories_converters.ts index 9958666d..c51ec829 100644 --- a/src/converters/_memories_converters.ts +++ b/src/converters/_memories_converters.ts @@ -328,6 +328,56 @@ export function ingestEventsConfigToVertex( common.setValueByPath(parentObject, ['forceFlush'], fromForceFlush); } + const fromRevisionLabels = common.getValueByPath(fromObject, [ + 'revisionLabels', + ]); + if (parentObject !== undefined && fromRevisionLabels != null) { + common.setValueByPath(parentObject, ['revisionLabels'], fromRevisionLabels); + } + + const fromRevisionExpireTime = common.getValueByPath(fromObject, [ + 'revisionExpireTime', + ]); + if (parentObject !== undefined && fromRevisionExpireTime != null) { + common.setValueByPath( + parentObject, + ['revisionExpireTime'], + fromRevisionExpireTime, + ); + } + + const fromRevisionTtl = common.getValueByPath(fromObject, ['revisionTtl']); + if (parentObject !== undefined && fromRevisionTtl != null) { + common.setValueByPath(parentObject, ['revisionTtl'], fromRevisionTtl); + } + + const fromDisableMemoryRevisions = common.getValueByPath(fromObject, [ + 'disableMemoryRevisions', + ]); + if (parentObject !== undefined && fromDisableMemoryRevisions != null) { + common.setValueByPath( + parentObject, + ['disableMemoryRevisions'], + fromDisableMemoryRevisions, + ); + } + + const fromMetadata = common.getValueByPath(fromObject, ['metadata']); + if (parentObject !== undefined && fromMetadata != null) { + common.setValueByPath(parentObject, ['metadata'], fromMetadata); + } + + const fromMetadataMergeStrategy = common.getValueByPath(fromObject, [ + 'metadataMergeStrategy', + ]); + if (parentObject !== undefined && fromMetadataMergeStrategy != null) { + common.setValueByPath( + parentObject, + ['metadataMergeStrategy'], + fromMetadataMergeStrategy, + ); + } + return toObject; } diff --git a/src/types/common.ts b/src/types/common.ts index 80b42ce2..dab1b909 100644 --- a/src/types/common.ts +++ b/src/types/common.ts @@ -603,6 +603,8 @@ export declare interface MemoryGenerationTriggerConfigGenerationTriggerRule { fixedInterval?: string; /** Optional. Specifies to trigger generation if the stream is inactive for the specified duration after the most recent event. The duration must have a minute-level granularity. */ idleDuration?: string; + /** Optional. Re-include the last N already-processed events in the next window. */ + overlapEventCount?: number; } /** The configuration for triggering memory generation for ingested events. */ @@ -1486,6 +1488,18 @@ export declare interface IngestEventsConfig { waitForCompletion?: boolean; /** Optional. Forces a flush of all pending events in the stream and triggers memory generation immediately bypassing any conditions configured in the `generation_trigger_config`. */ forceFlush?: boolean; + /** Labels to apply to the memory revision. For example, you can use this to label a revision with its data source. */ + revisionLabels?: Record; + /** Optional. Input only. Timestamp of when the revision is considered expired. If not set, the memory revision will be kept until manually deleted. */ + revisionExpireTime?: string; + /** Optional. Input only. The TTL for the revision. The expiration time is computed: now + TTL. */ + revisionTtl?: string; + /** Optional. Input only. If true, no revisions will be created for this request. */ + disableMemoryRevisions?: boolean; + /** Optional. User-provided metadata for the generated memories. This is not generated by Memory Bank. */ + metadata?: Record; + /** Optional. The strategy to use when applying metadata to existing memories. */ + metadataMergeStrategy?: MemoryMetadataMergeStrategy; } /** Parameters for purging agent engine memories. */