Skip to main content
MemoryManager offers convenience methods for common operations. They do not provide universal CRUD for every enabled store. Use a dedicated store API when you need precise ownership, sharing, or deletion semantics.

remember

remember(content, { userId?, scope?, importance? }) first writes a manual user fact when user facts are enabled and a user ID is supplied. Otherwise it tries learned knowledge, then a user-scoped entity fallback. Without a suitable store it can do nothing. For learned knowledge, scope is used as a context/namespace label; it is not a substitute for the record’s explicit sharing scope. Prefer the store’s saveLearning() API when choosing agent, tenant, or global visibility. Always pass the required owner identifiers.

recall

recall(query, { userId?, topK?, scope? }) returns { content, score, source } records. The default topK is 10. It gathers from supported facts, entities, learnings, and graph stores; it does not search all session turns, summaries, profiles, decisions, procedures, and corrections. Facts/entities require a user ID. The optional scope field is not an implemented universal authorization filter. Raw graph recall searches its configured backend; use a backend already scoped to the caller. For the filtered graph-memory prompt path, use its documented context methods instead. See scoring for the actual store-specific ranking signals. A composite score is not a calibrated probability that a fact is correct.

forget

An entity ID alone does not select an owner. The returned count reflects operations/store clearing, not an exact count of every erased record. scope does not implement broad scope deletion. This method does not erase sessions, vector indexes, graph stores, external artifacts, or all application data.

Full Example

Run this complete example with @agentium/core@4.0.0 and tsx. It needs no provider key:
Substitute a persistent driver only after testing the intended scope. Call these methods behind verified identity and resource authorization. For a complete application deletion operation, enumerate the data stores your application actually uses; see maintenance limits.