@maiar-ai/core / MemoryProvider
Class: abstract MemoryProvider
Defined in: packages/core/src/runtime/providers/memory.ts:60
Interface that all memory providers must implement
Constructors​
new MemoryProvider()​
new MemoryProvider():
MemoryProvider
Defined in: packages/core/src/runtime/providers/memory.ts:65
Returns​
Accessors​
logger​
Get Signature​
get logger():
Logger
Defined in: packages/core/src/runtime/providers/memory.ts:61
Returns​
Logger
Methods​
init()​
abstractinit():void|Promise<void>
Defined in: packages/core/src/runtime/providers/memory.ts:71
Initializes the memory provider. Must be implemented by subclasses.
Returns​
void | Promise<void>
A promise that resolves when initialization is complete.
checkHealth()​
abstractcheckHealth():void|Promise<void>
Defined in: packages/core/src/runtime/providers/memory.ts:77
Checks the health of the memory provider. Must be implemented by subclasses.
Returns​
void | Promise<void>
A promise that resolves when health check is complete.
shutdown()​
abstractshutdown():void|Promise<void>
Defined in: packages/core/src/runtime/providers/memory.ts:83
Shuts down the memory provider. Must be implemented by subclasses.
Returns​
void | Promise<void>
A promise that resolves when shutdown is complete.
getPlugin()​
abstractgetPlugin():Plugin
Defined in: packages/core/src/runtime/providers/memory.ts:89
Get the memory plugin
Returns​
The memory plugin
storeMemory()​
abstractstoreMemory(taskEvent):Promise<string>
Defined in: packages/core/src/runtime/providers/memory.ts:96
Store the incoming task event in the memory store
Parameters​
taskEvent​
Omit<Memory, "id">
The memory to store
Returns​
Promise<string>
A promise that resolves to the id of the memory item
updateMemory()​
abstractupdateMemory(id,patch):Promise<void>
Defined in: packages/core/src/runtime/providers/memory.ts:103
Update the memory item with new content
Parameters​
id​
string
The id of the memory item to update
patch​
Omit<Partial<Memory>, "id">
The update to apply to the memory item
Returns​
Promise<void>
queryMemory()​
abstractqueryMemory(options):Promise<Memory[]>
Defined in: packages/core/src/runtime/providers/memory.ts:113
Search for related memories based on query and filter options
Parameters​
options​
The options for the search
Returns​
Promise<Memory[]>
A promise that resolves to the list of memories