12#include <agents-cpp/types.h>
93 virtual std::vector<std::pair<JsonObject, float>>
search(
Interface for agent memory storage.
Definition memory.h:26
virtual void add(const String &key, const JsonObject &value, MemoryType type=MemoryType::SHORT_TERM)=0
Add a memory entry.
virtual void clear(MemoryType type=MemoryType::SHORT_TERM)=0
Clear all memory of a specific type.
virtual std::vector< Message > getMessages() const =0
Get all conversation messages.
virtual void remove(const String &key, MemoryType type=MemoryType::SHORT_TERM)=0
Remove a memory entry.
virtual void addMessage(const Message &message)=0
Add a conversation message to memory.
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.
virtual bool has(const String &key, MemoryType type=MemoryType::SHORT_TERM) const =0
Check if a memory entry exists.
virtual std::optional< JsonObject > get(const String &key, MemoryType type=MemoryType::SHORT_TERM) const =0
Get a memory entry by key.
virtual String getConversationSummary(int max_length=0) const =0
Get conversation summary as a string.
Framework Namespace.
Definition agent.h:18
nlohmann::json JsonObject
JSON object type.
Definition types.h:39
std::string String
String type.
Definition types.h:27
std::shared_ptr< Memory > createMemory()
Create a Memory instance.
MemoryType
Memory types.
Definition types.h:155
@ LONG_TERM
Long term memory.
Definition types.h:163
@ SHORT_TERM
Short term memory.
Definition types.h:159
Message in a conversation.
Definition types.h:105