|
| virtual void | add (const std::string &key, const JsonObject &value, MemoryType type=MemoryType::SHORT_TERM)=0 |
| | Add a memory entry.
|
| virtual std::optional< JsonObject > | get (const std::string &key, MemoryType type=MemoryType::SHORT_TERM) const =0 |
| | Get a memory entry by key.
|
| virtual bool | has (const std::string &key, MemoryType type=MemoryType::SHORT_TERM) const =0 |
| | Check if a memory entry exists.
|
| virtual void | remove (const std::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 std::string | getConversationSummary (int max_length=0) const =0 |
| | Get conversation summary as a string.
|
| virtual JsonObject | getConversationHistory () const =0 |
| | Get conversation history as a JSON object.
|
| virtual void | flushToPersistent (std::shared_ptr< LLMInterface > llm=nullptr)=0 |
| | Flush ephemeral memory to persistent storage (pre-compaction hook). If an LLM is provided, performs a silent agentic turn to intelligently extract and persist key facts from the conversation before compaction.
|
| virtual std::vector< std::pair< JsonObject, float > > | search (const std::string &query, MemoryType type=MemoryType::LONG_TERM, int max_results=5) const =0 |
| | Semantic search in memory with hybrid scoring (vector + BM25 + temporal decay).
|
| virtual void | addFact (const std::string &key, const JsonObject &value)=0 |
| | Add a fact to long-term memory (persistent facts).
|
| virtual std::optional< JsonObject > | getFact (const std::string &key) const =0 |
| | Get a fact from long-term 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.