Short-Term Memory Design #40
Replies: 3 comments 4 replies
-
|
A couple of questions:
|
Beta Was this translation helpful? Give feedback.
-
|
A few more questions:
|
Beta Was this translation helpful? Give feedback.
-
IntroduceIn Flink-Agents, actions pass relevant messages through events and share state through short-term memory. When large data (such as conversation history or complex custom object) need to be passed between multiple actions, passing data directly through events can incur significant performance overhead due to repeated serialization and deserialization. To solve this problem, we introduce MemoryRef—a persistent reference to data in Short-Term Memory. It has two main benefits:
OverviewA MemoryRef is a serializable data structure that does not store the actual memory data itself. Instead, it acts as a "pointer" or "handle" to a specific data item in Short-Term Memory. A MemoryRef instance contains just two key pieces of information:
Interface DesignMemoryRef MemoryRef itself is serializable. It defines the data structure for the reference and its associated operations. Extension to MemoryObject To make operations more flexible and convenient, we extend the core methods of MemoryObject to support the creation and resolution of MemoryRef. Agent ExampleScenario Description: This example involves two Actions. Action A receives an InputEvent, stores a large data object in Short-Term Memory, and passes the corresponding reference. Action B then receives this reference, resolves it to get the actual data, processes it, and outputs the final result. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Clarification of Concepts
Design Overview
The above figure shows the design of Short-Term Memory.
Please notice that the root node in the figure is also an object. Therefore, the key to the short-term memory design is around storing and accessing of objects.
APIs
MemoryObject
We introduced MemoryObject as the interface for accessing an object in the short-term memory.
RunnerContext
Examples
Beta Was this translation helpful? Give feedback.
All reactions