Skip to main content

Module memory

Module memory 

Source
Expand description

Transport-free memory administration.

WHY THIS DOES NOT GO THROUGH PersistenceLayer

PersistenceLayer::save_memory and search_memory are documented NO-OP STUBS on SurrealDbProvider — they log “use AppState::memory_service for real persistence” and return Ok(()) / vec![]. Memories live in surreal-memory’s own SurrealDB instance, which MemoryService owns. Routing admin calls through the persistence layer would compile, run, and silently do nothing — the worst possible failure for a store.

WHY THE SERVICE IS AN Option HERE

MemoryService opens a second embedded store and can fail to initialise, so the embedded kernel holds it as Option. Every function takes that Option and returns a typed error rather than panicking or returning an empty list, so a caller can tell “no memories saved” from “memory is off on this host”.

Functions§

add
Add a memory.
delete
Delete a single memory.
get
Load one memory by id.
list
Memories visible to a user, optionally narrowed to an agent or session.
search
Semantic search over a user’s memories.
update
Replace a memory’s content.