Agents 0.0.2
Edge AI Agents SDK
|
Interface for agent memory storage. More...
#include <memory.h>
Public Member Functions | |
virtual void | add (const String &key, const JsonObject &value, MemoryType type=MemoryType::SHORT_TERM)=0 |
Add a memory entry. | |
virtual std::optional< JsonObject > | get (const String &key, MemoryType type=MemoryType::SHORT_TERM) const =0 |
Get a memory entry by key. | |
virtual bool | has (const String &key, MemoryType type=MemoryType::SHORT_TERM) const =0 |
Check if a memory entry exists. | |
virtual void | remove (const String &key, MemoryType type=MemoryType::SHORT_TERM)=0 |
Remove a memory entry. | |
virtual void | clear (MemoryType type=MemoryType::SHORT_TERM)=0 |
Clear all memory of a specific type. | |
virtual void | addMessage (const Message &message)=0 |
Add a conversation message to memory. | |
virtual std::vector< Message > | getMessages () const =0 |
Get all conversation messages. | |
virtual String | getConversationSummary (int max_length=0) const =0 |
Get conversation summary as a string. | |
virtual std::vector< std::pair< JsonObject, float > > | search (const String &query, MemoryType type=MemoryType::LONG_TERM, int max_results=5) const =0 |
Semantic search in memory. | |
Interface for agent memory storage.
Memory stores information that can be retrieved by the agent, such as conversation history, retrieved documents, or intermediate results.
|
pure virtual |
Add a memory entry.
key | The key to add |
value | The value to add |
type | The type of memory to add |
|
pure virtual |
Add a conversation message to memory.
message | The message to add |
|
pure virtual |
Clear all memory of a specific type.
type | The type of memory to clear |
|
pure virtual |
Get a memory entry by key.
key | The key to get |
type | The type of memory to get |
|
pure virtual |
Get conversation summary as a string.
max_length | The maximum length of the summary |
|
pure virtual |
Get all conversation messages.
|
pure virtual |
Check if a memory entry exists.
key | The key to check |
type | The type of memory to check |
|
pure virtual |
Remove a memory entry.
key | The key to remove |
type | The type of memory to remove |
|
pure virtual |
Semantic search in memory.
query | The query to search for |
type | The type of memory to search |
max_results | The maximum number of results to return |