| name | memex |
| description | Use MemEX epistemic memory — record beliefs with trust/conviction/importance scores, recall them ranked, trace provenance, and keep contradictions and corrections as data instead of overwriting. |
| version | 0.1.0 |
| author | ai-2070 |
| license | Apache-2.0 |
| metadata | {"hermes":{"tags":["Memory","Epistemic Memory","Knowledge Graph","Provenance","MemEX"],"requires_tools":["recall","belief"]}} |
MemEX — Epistemic Memory
MemEX is your long-term memory as a belief graph, not a notepad. Every belief
carries who said it, why you believe it, what it conflicts with, and how
confident you are. You interact through two tools:
recall — retrieve beliefs ranked by trust × salience (not text similarity).
belief — record and manage beliefs (remember, why, contradict, supersede, forget, stats).
The whole point is to preserve structure a flat note store throws away. Use it.
When to use
- Before answering anything about the user, their projects, prior decisions, or facts you may have stored →
recall first. Do not answer from guesswork if memory might hold it.
- After learning a durable fact, preference, decision, or conclusion →
belief remember, with scores set deliberately and parents linking the evidence it came from.
- When sources disagree →
belief contradict (keep both; never silently pick one).
- When something is corrected, updated, restated, or overruled →
belief supersede (replace without deleting).
- When asked "why do you think that?" →
belief why to trace the support chain.
The three scores (the core idea)
Every belief has three independent 0..1 scores. They do not move together — set each on purpose. This is the cell flat memory can't represent (e.g. worth checking, not worth trusting).
| Score | Question | Set it high when… |
|---|
authority | How much should the system trust this, regardless of who said it? | primary/official source (filing, statute, the user stating a fact) |
conviction | How sure was the author when they said it? | the source asserted it firmly / without hedging |
importance | How much does this matter right now? (salience) | it drives a current decision or you'll need it soon |
Quick reads of common combinations:
- High authority, high importance → a load-bearing fact. (audited number, user's hard requirement)
- Low authority, high importance → worth checking, not trusting — a rumor or unverified lead. Store it, flag it, verify later.
- High authority, low importance → true but currently irrelevant background.
- High authority, low conviction → a trusted source that hedged.
Belief fields (what each property does)
| Field | Purpose |
|---|
content | The belief itself, as a short statement. |
scope | Namespacing key. Group related beliefs: user:<name>/profile, project:<name>, case:<id>. Recall can filter by exact scope or scope_prefix. |
kind | What the belief is (see below). Default observation. |
source_kind | How it got here (see below). Default agent_inferred. |
parents | Ids of the beliefs this one was derived from — the provenance edge. Set this whenever a belief follows from others; it powers why. |
kind — observation (something witnessed) · assertion (a claim) · assumption · hypothesis (unverified, may be wrong) · derivation (computed/reasoned from parents) · simulation · policy (a rule/standing instruction) · trait (a durable property of the user). Use policy/trait for things that should persist indefinitely; hypothesis for things you're not sure of yet.
source_kind — user_explicit (the user stated it) · observed (you saw it happen) · derived_deterministic (computed) · agent_inferred (you concluded it) · simulated · imported (from an external doc/source).
Tool: recall
Retrieve beliefs ranked by a weighted blend of the scores. Returns each belief's id, content, scores, and — when relevant — contradicted_by.
| Param | Default | Notes |
|---|
query | — | Keywords to match in content/scope (optional; omit for a pure ranked pull). |
scope / scope_prefix | — | Restrict to a scope or scope tree. |
kinds | — | Restrict to specific kinds. |
min_authority | — | Drop beliefs below this trust floor. |
weights | {authority:0.6, importance:0.4} | Raise importance for an attention queue; raise authority for high-trust recall. |
contradictions | surface | surface returns both sides flagged with contradicted_by; filter keeps only the stronger side; none ignores conflicts. |
decay | false | Down-weight stale beliefs by age. |
limit | 8 | Max results. |
{ "scope_prefix": "user:laz/", "decay": true, "limit": 6 }
{ "query": "deploy process", "contradictions": "surface" }
{ "weights": { "importance": 0.8, "authority": 0.2 }, "min_authority": 0.0, "limit": 5 }
Tool: belief
remember — store a belief
Set the scores deliberately and add parents for anything derived.
{ "action": "remember", "content": "Vegetarian — no meat or fish",
"kind": "trait", "scope": "user:laz/profile", "source_kind": "user_explicit",
"authority": 0.95, "conviction": 0.95, "importance": 0.85 }
{ "action": "remember", "content": "Works as a structural engineer",
"kind": "trait", "scope": "user:laz/profile", "source_kind": "user_explicit",
"authority": 0.9, "importance": 0.6 }
{ "action": "remember", "content": "Prefers hiking holidays in the mountains to beach resorts",
"kind": "trait", "scope": "user:laz/profile", "source_kind": "user_explicit",
"authority": 0.9, "importance": 0.35 }
{ "action": "remember", "content": "staging DB may be undersized for the new load",
"kind": "hypothesis", "scope": "project:cyberdeck", "source_kind": "agent_inferred",
"authority": 0.3, "importance": 0.85 }
{ "action": "remember", "content": "the p99 regression came from the cache change",
"kind": "derivation", "scope": "project:cyberdeck", "source_kind": "derived_deterministic",
"parents": ["<trace-belief-id>", "<commit-belief-id>"], "authority": 0.8, "importance": 0.9 }
why — trace provenance
{ "action": "why", "id": "<belief-id>" }
contradict — record a conflict (keep both)
{ "action": "contradict", "id_a": "<belief-a>", "id_b": "<belief-b>",
"rationale": "opposing readings of the same clause" }
Both beliefs stay live; future recall (in surface mode) flags each with contradicted_by.
supersede — a correction replaces the old belief without deleting it
Use for restatements, corrections, updated guidance, overrules. The loser's authority is lowered but it stays queryable ("what did we believe before?").
{ "action": "supersede", "winner_id": "<corrected-belief>", "loser_id": "<old-belief>",
"reason": "user corrected the staging URL" }
forget — retract
{ "action": "forget", "id": "<belief-id>" }
{ "action": "forget", "id": "<root-id>", "cascade": true }
stats — graph overview
{ "action": "stats" }
Workflows
- New conversation →
recall the user's scope to load context before responding.
- You learned something durable →
remember it immediately (don't wait for session end). Pick the right kind/source_kind and scores; add parents if it followed from other beliefs.
- Two sources conflict → store both as separate beliefs, then
contradict them. Surface the disagreement in your answer.
- Something changed/was corrected →
remember the new version (with parents: [old-id]), then supersede old with new. Never edit-over the old belief.
- Asked to justify a claim →
why on that belief and report the chain.
Worked examples
Illustrative scenarios — the point is the tool usage, not the facts. <...-id> is the id returned by an earlier remember.
Legal research (famous civil cases)
1 — Precedent + derived proposition (provenance). Store a binding precedent as a durable, high-authority belief; link the proposition you build on it via parents so why can justify the memo.
{ "action": "remember",
"content": "Donoghue v. Stevenson [1932] AC 562 — manufacturer owes a duty of care to the ultimate consumer",
"kind": "policy", "scope": "doctrine:negligence/duty-of-care",
"source_kind": "imported", "authority": 0.95, "conviction": 0.95, "importance": 0.8 }
{ "action": "remember",
"content": "client's contaminated-drink injury supports a duty-of-care claim against the bottler",
"kind": "derivation", "scope": "case:acme-bottling",
"source_kind": "agent_inferred", "parents": ["<donoghue-id>"],
"authority": 0.6, "conviction": 0.7, "importance": 0.85 }
2 — Supersession without deletion (point-in-time law). A later case overrules an earlier rule; the old rule must stay queryable for claims that arose while it controlled.
{ "action": "remember", "content": "Winterbottom v. Wright (1842) — no duty without privity of contract",
"kind": "policy", "scope": "doctrine:product-liability/privity",
"source_kind": "imported", "authority": 0.9, "importance": 0.4 }
{ "action": "remember", "content": "MacPherson v. Buick (1916) — manufacturer liable in negligence absent privity",
"kind": "policy", "scope": "doctrine:product-liability/privity",
"source_kind": "imported", "parents": ["<winterbottom-id>"], "authority": 0.95, "importance": 0.85 }
{ "action": "supersede", "winner_id": "<macpherson-id>", "loser_id": "<winterbottom-id>",
"reason": "privity requirement abolished for negligence" }
3 — Preserved disagreement (majority vs dissent). Don't flatten a split into one answer — store both and contradict so a memo surfaces the tension.
{ "action": "remember", "content": "Palsgraf majority (Cardozo): duty runs only to foreseeable plaintiffs (zone of danger)",
"kind": "assertion", "scope": "doctrine:negligence/proximate-cause",
"source_kind": "imported", "authority": 0.9, "conviction": 0.9, "importance": 0.7 }
{ "action": "remember", "content": "Palsgraf dissent (Andrews): proximate cause is a policy line, not foreseeability",
"kind": "assertion", "scope": "doctrine:negligence/proximate-cause",
"source_kind": "imported", "authority": 0.6, "conviction": 0.8, "importance": 0.6 }
{ "action": "contradict", "id_a": "<majority-id>", "id_b": "<dissent-id>",
"rationale": "competing tests for proximate cause" }
Geopolitical research (US–China trade war, 2024–25)
1 — Differential trust on one event. The same impact claim from an institution, a state ministry, and an unverified lead must not rank equally. Set authority/conviction/importance to the source, not the topic.
{ "action": "remember", "content": "IMF: 2025 tariff escalation trims global growth ~0.5pp",
"kind": "observation", "scope": "geo:us-china/trade-war/impact",
"source_kind": "imported", "authority": 0.85, "importance": 0.8 }
{ "action": "remember", "content": "MOFCOM: US tariffs will 'inevitably fail', minimal impact on China",
"kind": "assertion", "scope": "geo:us-china/trade-war/impact",
"source_kind": "imported", "authority": 0.5, "conviction": 0.9, "importance": 0.7 }
{ "action": "remember", "content": "rumor: a major exporter is rerouting via Vietnam to dodge tariffs",
"kind": "hypothesis", "scope": "geo:us-china/trade-war/impact",
"source_kind": "agent_inferred", "authority": 0.2, "importance": 0.85 }
2 — A fact that changes over time (supersession). A tariff rate is restated after negotiations; keep the old one for "as-of" analysis.
{ "action": "remember", "content": "US tariff on Chinese imports raised to 145% (Apr 2025)",
"kind": "observation", "scope": "geo:us-china/trade-war/tariffs",
"source_kind": "imported", "authority": 0.9, "importance": 0.95 }
{ "action": "remember", "content": "Geneva talks: US tariff cut to 30% for a 90-day pause (May 2025)",
"kind": "observation", "scope": "geo:us-china/trade-war/tariffs",
"source_kind": "imported", "parents": ["<apr-rate-id>"], "authority": 0.9, "importance": 0.95 }
{ "action": "supersede", "winner_id": "<may-rate-id>", "loser_id": "<apr-rate-id>",
"reason": "Geneva 90-day tariff reduction" }
3 — Competing analog frames (hypotheses + contradiction + provenance). Strategic reads are conditional; hold the rival frames simultaneously, each anchored to its evidence.
{ "action": "remember", "content": "analog: 2025 rhymes with Smoot-Hawley 1930 — escalating retaliation, contraction risk",
"kind": "hypothesis", "scope": "geo:us-china/trade-war/frame",
"source_kind": "agent_inferred", "parents": ["<apr-rate-id>", "<imf-impact-id>"],
"authority": 0.5, "conviction": 0.6, "importance": 0.85 }
{ "action": "remember", "content": "analog: closer to US–Japan 1980s — managed friction, negotiated settlement, no systemic break",
"kind": "hypothesis", "scope": "geo:us-china/trade-war/frame",
"source_kind": "agent_inferred", "parents": ["<may-rate-id>"],
"authority": 0.5, "conviction": 0.55, "importance": 0.85 }
{ "action": "contradict", "id_a": "<smoot-id>", "id_b": "<usjapan-id>",
"rationale": "rupture vs managed-friction framing" }
Reacting to the maintenance block
Between turns, MemEX runs a cheap, read-only sweep and may inject a ## Memory maintenance (MemEX) block into your context. It is a to-do list — act on it:
- ⚠ stale (a belief whose
parents were retracted) → its support is gone. Re-derive it from current evidence, or belief forget it.
- ⚠ unresolved contradiction → resolve it with
belief supersede (winner replaces loser) once you know which side holds, or leave it and surface the disagreement to the user.
- 🔎 verify (low-trust, high-importance) → these are worth checking. Confirm or refute, then update: raise
authority via a fresh remember+supersede, or forget if false.
The sweep never changes scores on its own — it only points; you decide.
Pitfalls
- Don't overwrite — supersede. Being corrected/restated is not the same as being wrong; the old belief is part of the record.
- Don't default every score to 0.7. Undifferentiated scores defeat the entire system. A user requirement and a hunch must not rank the same.
- Recall before asserting from memory. If the user asks about themselves or past work,
recall first.
- Use scopes consistently so
scope_prefix recall works (user:<name>/..., project:<name>, case:<id>).
- Link
parents on derived beliefs — without them, why and cascade cleanup can't follow the chain.
- Low authority ≠ ignore. Low-authority/high-importance is worth checking; store it and verify, don't discard it.
Verification
After remember, confirm the belief is retrievable and scored as intended:
{ "query": "<a keyword from the content>", "limit": 3 }
Use belief stats to sanity-check the graph is growing as expected (counts by kind/source).