应用程序(App)搜索内存服务(Service)
A persistent MemoryService backed by AndroidX AppSearch in the consumer app's private storage.
Ingested events and explicit memories survive process death and reboot, never leave the device, and are retrieved by AppSearch's native full-text relevance ranking. Use this in place of com.google.adk.kt.memory.InMemoryMemoryService when constructing a com.google.adk.kt.runners.Runner in an Android consumer app:
val memoryService = AppSearchMemoryService.fromContext(applicationContext)Memory is scoped by (appName, userId): a search never returns another user's memory. All three write paths are supported and each event / explicit memory becomes its own retrievable document.
This class holds all behavior and delegates storage to a MemoryIndex so it can be unit-tested on the host JVM; fromContext wires it to the on-device LocalStorageMemoryIndex.
函数
将一个会话添加到内存服务中。
异步地搜索与查询条件匹配的会话(session)。