Memory
Episodic, semantic, procedural and autobiographical memory; retrieval, decay, consolidation and provenance.
Memory is where a mind keeps what it has experienced and learned. Noema separates what happened from what is generally true from how to do things from what happened to me, keeps the provenance of every item, and makes retrieval a scored, inspectable operation rather than a black box.
On this page
Encoding
Memories are created by the executive when a thought is important enough to keep (attention-gated encoding), by consolidation when episodes generalise, by operators through the interface or API, and autobiographically when the mind itself is changed. Every memory records its kind, epistemic kind, content, source and trust, credibility, confidence, importance, salience, the time it refers to, the event that created it and any memory it supersedes. Nothing is ever overwritten: corrections retract or supersede.
Retrieval
Retrieval fuses several signals into one score and keeps the parts visible:
| Component |
Source |
Notes |
| lexical |
PostgreSQL full-text search over content, any-term matching, ranked |
always available |
| semantic |
cosine similarity over embeddings in pgvector |
only when the extension and an embedding model are present |
| recency |
time since the memory occurred |
half-life scaled by importance |
| importance |
stored importance |
set at encoding, raised by reinforcement |
| activation |
decaying activation, boosted on each retrieval |
models spreading availability |
| relations |
typed links to memories already in the workspace |
structural relevance |
A retrieval is a memory_retrieved event that carries the breakdown, and the memory's activation and retrieval count are reinforced. The interface shows the breakdown on every recall, so "why did it remember that" is always answerable.
Decay
A scheduled job lowers activation for memories not retrieved recently, with importance slowing the decay. Decay never deletes: a memory with activation near zero is still there, still searchable and still cited by the beliefs that rest on it; it simply competes less strongly for attention.
Relationships
Memories link to each other with typed, weighted relationships. Consolidation writes derived_from edges from a generalisation to its episodes; dreaming writes similar_to edges; perception writes caused_by and contradicts when it can justify them; operators can add any. Edges are shown on the memory page and used as a retrieval signal.
Consolidation
Consolidation groups recent episodes that share distinctive terms into clusters (deterministically), writes one semantic memory and one evidenced belief per cluster, links the generalisation back to every episode, and never touches the originals. A model may propose better wording within a per-run budget; the cluster, the evidence and the confidence come from code. Confidence requires diversity of sources: ten repetitions from one source do not make something true. Operators review generalisations and can reject them, which retracts the memory and the belief while leaving the episodes alone.
Operator corrections
An operator can retract a memory, mark it inaccurate, or supersede it with a corrected one. The correction is recorded, the beliefs whose evidence cited the memory are re-evaluated, and a "do not infer this again" rule can be attached so that consolidation and association do not quietly rebuild the same conclusion.
Noema keeps four long-term memory systems in one table (memories) distinguished by kind, plus an in-process working memory. Every record carries an explicit epistemic kind (observation, fact, memory, claim, hypothesis, belief, prediction, assumption, inference, opinion) so the system never confuses what it saw with what it inferred.
| Kind |
What it holds |
Created by |
| episodic |
things that happened, with time, participants, channel, source |
the attend handler when an observation wins attention; conversation |
| semantic |
propositions and general knowledge |
operators, belief formation, consolidation |
| procedural |
how to do things (steps, preconditions, outcomes) |
reflection, operators |
| autobiographical |
the mind's own significant history |
operator actions on the mind, reflection |
Fields that matter
confidence how well supported the content is (the epistemic score defined in docs/beliefs.md, not a probability); importance how much it matters; salience how strongly it presented itself.
trust and credibility come from the channel the information arrived through (operator > user ≈ system > tool > source > low). Credibility weighs retrieval and, later, belief confidence.
activation is accessibility. It rises on retrieval and decays over time (half-life 14 days, slowed by importance). Decay never deletes: a memory with activation 0.01 is still there, still linked, still readable.
status is active, retracted (an operator said it is inaccurate), superseded (replaced by a newer version) or archived. Non-active memories stay for provenance and are excluded from normal recall.
origin_event links to the event that produced the memory; memory_created events link back. Relationships (related_to, supports, contradicts, derived_from, ...) carry confidence and source.
Retrieval
memory.Store.Retrieve fuses independent signals, each recorded on the result:
| Component |
Weight |
Source |
| text |
0.40 (0.65 when vectors are unavailable) |
PostgreSQL full-text rank; any-term matching by default, websearch syntax when strict |
| vector |
0.25 |
pgvector cosine similarity for the configured embedding model |
| recency |
0.10 |
exp(−age/30 days) |
| activation |
0.10 |
current accessibility |
| importance |
0.10 |
stored importance |
| credibility |
0.05 |
source credibility |
The retrieve process runs this for every new observation and proposes recalled memories as thought candidates. Recall therefore competes for attention like everything else; admitted recalls are reinforced and produce memory_retrieved events containing the component scores.
Embeddings
memory_embeddings exists only when pgvector is available. Rows carry the model name and dimensions, so switching embedding models never mixes vector spaces; a background job embeds memories that lack a vector for the current model. Without an embedder, retrieval is text plus graph plus recency and the system stays fully functional.
Working memory
Working memory is the small, decaying set of items the mind is actively holding (default nine). It is part of the workspace snapshot, persists across restarts, and feeds the context-relevance feature of attention scoring. See docs/adr/0001-global-workspace.md.
Operator corrections
"This memory is inaccurate" sets status=retracted, writes an operator_action event with the reason and an audit entry. The memory remains visible with a retracted badge; nothing is rewritten.