VertexAI内存银行 API 标识符:bank_api 占位符:{{bank_api}}服务(Service)

A MemoryService backed by Vertex AI Agent Engine Memory Bank.

This is a Kotlin port of the Python ADK VertexAiMemoryBankService. Memories are scoped by {app_name, user_id}; addSessionToMemory and addEventsToMemory send event content for server-side memory generation, addMemory writes explicit memories (directly, or via generation when consolidation is requested), and searchMemory retrieves memories by semantic similarity.

It follows the existing Vertex service ports: a thin VertexAiMemoryBankClient over a shared GoogleApiClient handles the REST calls, and @Serializable wire DTOs live in the dto sub-package.

构造函数(Constructors)

Link copied to clipboard
constructor(project: String, location: String, agentEngineId: String, credentials: GoogleCredentials = GoogleApiClient.defaultCredentials(), httpClient: HttpClient = GoogleApiClient.defaultHttpClient())

为 Agent Engine 创建一个服务。 agentEngineId 在……下面;在……之下 项目 和 位置.

类型

Link copied to clipboard
class Builder

Fluent Builder for VertexAiMemoryBankService该功能主要为 Java 语言的调用者提供支持;如果某个属性未被设置,其值将默认使用构造函数中指定的默认值。

Link copied to clipboard
object Companion

函数

Link copied to clipboard
open suspend override fun addEventsToMemory(appName: String, userId: String, events: List<Event>, sessionId: String? = null, customMetadata: Map<String, Any?>? = null)

添加 事件 用于生成内存数据(memory generation)。 memories:ingestEvents 默认情况下;如果…… customMetadata 仅携带一把钥匙。 memories:generate 接受(例如:) ttl, metadata, disable_consolidation在这种情况下,会使用生成的路径(generate path)。详情请参见…… GENERATE_ONLY_KEYS for the keys.

Link copied to clipboard
open suspend override fun addMemory(appName: String, userId: String, memories: List<MemoryEntry>, customMetadata: Map<String, Any?>? = null)

写入(数据) 回忆;记忆 这些信息要么以明确的事实形式呈现给用户,要么通过 `generate` 函数在服务器端进行整合处理。 enable_consolidation 被设置为…… customMetadata (在……中生成配置密钥) customMetadata 然后执行相应的操作(apply)。只有每个条目的文本会被保存下来;每个条目的其他信息(如时间戳等)都不会被保存。 author, timestamp,以及 customMetadata 这些数据并没有被直接写入文件中(在 Python 2.0 中,这些数据会被映射到相应的修订标签以及合并后的元数据中)。

Link copied to clipboard
open suspend override fun addSessionToMemory(session: Session)

将一个会话添加到内存服务中。

Link copied to clipboard
open suspend override fun searchMemory(appName: String, userId: String, query: String): SearchMemoryResponse

异步地搜索与查询条件匹配的会话(session)。