The admission threshold this manager applies to long-term memories: config.relevanceThreshold
when set, else the embedder's calibrated threshold, else the library default.
StaticcreateBuild a ready manager. With no arguments it uses the in-memory store and the best local
embedder available (buildLocalEmbedder): bge-small-en-v1.5 through fastembed when that
package is installed (the first run downloads the model, about 130 MB), otherwise the
dependency-free lexical LocalEmbedder, with a one-time warning that recall is keyword-only.
Pass stores / an embedder to back it with Redis + Qdrant + a model of your choice.
Persist a conversation turn to the hot session tier. Returns the turn id.
OptionaltoolResults: readonly {Assemble context for the next LLM call using the 4-phase pipeline: parallel L1/L2 fetch → budget allocation → relevance ranking → priority pruning. The system-prompt + current-turn budget is never consumed here.
Write a fact directly into long-term memory. Returns the memory id.
source and sensitivity are provenance-typing v1: they record where the
fact came from and how sensitive it is, so it can be attributed, filtered,
and erased by policy (the governance seed that graduates to hosted memory).
OptionaltopicTags: readonly string[]Permanently remove a memory by id.
Local right-to-erasure: irreversibly delete an agent's long-term memories.
The governance seed that graduates to hosted provable erasure. When
sessionId is given, the session's hot-tier turns are cleared too; otherwise
only the durable L2 store is wiped (hot-tier turns are ephemeral).
OptionalsessionId: stringDelete all hot-tier turns for a session. Long-term memories persist.
Semantic search over long-term memory, ranked by relevance + recency.
Session stats, or null when the session does not exist / has expired.
Recent session turns, oldest → newest, capped at n (defaults to all
retained). This is the raw history read that framework memory adapters (e.g.
a LangChain BaseChatMessageHistory or a LlamaIndex BaseMemory) build on.
Optionaln: numberExtract durable facts from a session's recent turns and store them as
first-class memories (contentType: "fact", source: "extracted", with an
LLM-classified sensitivity). LLM-gated: a FactExtractor must have been
supplied to create() / the constructor, else a ConfigurationError is thrown.
Returns the stored memory ids (empty when nothing durable is found).
Optionaln: numberRelease resources the stores own, by calling their optional close().
The built-in adapters take an already-connected client the caller constructed, so they
do not implement close() and nothing is torn down here: disconnecting an injected
client stays the application's job. A custom store that opens its own connection should
implement close(), and this is what calls it. Mirrors the Python manager, which closes
both tiers on shutdown.
Two-tier persistent agent memory: a hot session tier (recent turns) + a cold semantic tier (long-term recall). API-compatible with the hosted drop-in
ActroneMemoryManagerfrom@actrone/sdk, so migrating from self-hosted to governed hosted memory is a one-import change.Example