Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Forma-Native Semantic Memory v0.1 — Gateway

Status: IMPLEMENTED · VERIFIED · LANDED ON MASTER Kind: product/architecture documentation (permanent entry point) Audience: developer, architect, agent — anyone who needs to understand or operate the memory without reconstructing it from campaign history.


1. What the Forma-native memory is

The Forma agent harness’ persistent memory is a first-class semantic evaluation. For every admitted semantic need the harness mints one identifiable SemanticContextEvaluation occurrence that resolves, bounds, retrieves, derives, discriminates and projects persistent prior experience for the current cognitive need — and journals that occurrence as operational evidence.

The ratified law:

Memory is the governed semantic evaluation by which persistent prior experience is resolved, bounded, retrieved, derived, discriminated and projected for a current cognitive need.

The carriers: SemanticNeed → SemanticContextEvaluation → ContextProjection (ContextItems) → served into the CognitiveRound.

2. What problem it solves

A long-running agent must reuse what happened in earlier sessions without turning history into a text dump. MEMORY-v1 (the predecessor) recalled once per task from a frozen block, kept episodes only as journal text, and its whole-corpus fallback discovery did not scale. The Forma-native memory makes recall a typed, bounded, honest semantic evaluation over the SAME journal the agent already keeps — no second store, no embedding index, no keyword search, no silent top-1.

3. How it differs from MEMORY-v1

DimensionMEMORY-v1Forma-native v0.1 (final)
Recall unitonce-per-task frozen channelper-round first-class evaluation, minted occurrence identity
Context carriertext blockContextProjection of typed ContextItems with standing + provenance
Currentnessfrozen foreverreactive invalidation (formasl-reactive DependencyIndex) + revalidation naming the predecessor
Standingflatcurrent / superseded / archived / deactivated / historical — a withdrawn value is current-rejected AND historically retrievable
Round-1 costwhole-history fixpoint alwaysnarrow-first: pinned bounded fixpoint; legacy chain only on genuine broad need or justified escalation
Ambiguitysilent top-1Zero/One/Many honest — Many discloses identities only
Provenancenone on answersderivation handles on every derived item; Explain expands them

Full genealogy + measured behavior: COMPARISON.md.

4. How it works inside the cognitive loop

  1. Round 1 (task start) — the predecessor channel match runs unchanged, then wraps as the FIRST evaluation. When the task pins exactly one path, the need is StandingCurrentPinned{path}: a bounded fixpoint over the sessions that observed that path, under the standing-scoped render. Zero/Unsupported/OutOfGas escalate to the legacy discovery chain (hit = One|Many).
  2. Every round — the world view is rebuilt; the reactive delta (notify_world_delta) names genuinely affected evaluations; a stale evaluation is retired and revalidated (NEW occurrence naming its predecessor); the fresh projection becomes the round’s governed MEMORY-RETRIEVAL section.
  3. Model-directed — the model can ask its own memory question (Step::Semantic with basis agent_memory); it resolves through the SAME evaluator; the answer becomes the next round’s section.

Detailed mechanism: SEMANTIC-MEMORY-IMPLEMENTATION.md (§4 routes, §5 currentness, §7 loop integration).

5. Relation to the FormaSL runtime

The evaluation routes ARE FormaSL runs: the standing route renders a bounded derived module and executes the authored law (CurrentObjective with a stratified WithdrawnNow naf) through the REAL registry (SemanticOperator::Infer, basis agent_memory, 50k gas). Nothing about memory is a second engine: claims, lifecycle marks, observations, episodes — all are the existing journal + render + runtime machinery. A gas exhaustion surfaces as OutOfGas, never silently as Zero.

6. How it uses formasl-reactive

crates/forma-agent/src/memory_reactive.rs wraps the landed formasl_reactive::index::DependencyIndex (the Affected(E, Δ) relation) as the CURRENTNESS authority:

  • coordinates come from what evaluations actually consume: mem-obj:<ovr>, mem-path:<pvr>, mem-session:<s>, mem-entry:<s>:<e> (C1.claim, subject-level) and the exact record identity (C1.obs);
  • registration happens at evaluation time from MEMBER provenance;
  • at each round head the world fingerprint diff emits only REAL appended entries; index.affected names stale evaluations;
  • the drain is SYNCHRONOUS at the round head — there is no continuous scheduler, and none is required;
  • the adopter set is fenced narrowly: {formasl-reactive, forma-agent} (crates/conformance/tests/rac_boundary.rs, with a negative witness).

Distinctions preserved: NeedChanged → new evaluation is DISCOVERY and never consults reactive state; DependencyChanged → invalidate affected evaluations is CURRENTNESS and never discovers.

7. What is persisted vs derived

  • Persisted (append-only, digest-chained journal): sessions, member entries, claim lifecycle records, observations, typed MemoryStandingMarked lifecycle marks, and content-free ContextEvaluationObserved evidence (ids + classes, never values).
  • Derived (rebuildable): the MemorySemanticView interpretation, rendered modules (general, standing-scoped, episode opt-in), evaluation outcomes, projections, episodes, derivations.
  • There is NO memory store: every memory carrier re-derives from the same journal the agent already keeps (MEM-INV-28).

8. Semantic guarantees

  • Need ≠ Evaluation ≠ Projection ≠ Round; every evaluation mints a fresh occurrence (no rebind-in-place).
  • Only One discloses values; Many discloses identities only — ambiguity preserved, no silent top-1; OutOfGas survives as itself.
  • Standing-aware: a superseded/archived/deactivated value is current-rejected and historically retrievable WITH its standing and original text (Summary ≠ source).
  • Fail-closed disclosure by source policy + validity cutoff.
  • Provenance handles on every derived item; Explain expands them as new occurrences.
  • Currentness: zero false-positive and zero false-negative invalidations on the frozen corpus; stale evaluations never silently reused.

Witness inventory: SEMANTIC-MEMORY-IMPLEMENTATION.md §10.

9. Limits (see also docs/user/SUPPORT-LIMITATIONS.md)

  • Harness-INTERNAL capability (crates forma-agent + harness-*): there is no public CLI command or service endpoint for memory queries; the surfaces are the cognitive loop and the evaluator API.
  • Sync drain only at round heads; no continuous scheduler; no cross-process notification of memory changes.
  • The directed whole-scope standing fixpoint still grows with N (37.7s at N=3000 — inside the verified envelope, still growing); broad-need escalation inherits the legacy chain’s corpus-wide cost.
  • The general F06 (fixpoint match superlinearity) ENGINE constraint is NOT solved; the memory envelope was closed by semantic work reduction, preserving results — not by making the engine faster.
  • Scenario runtime, semantic codec, and model-facing episode query arm are documented non-goals of v0.1.
  • N=10000 bounded verification not yet run (permitted by the bounded semantics; recorded as follow-up).

10. Where to find everything

NeedGo to
Architecture/implementation reference (file:line-cited)SEMANTIC-MEMORY-IMPLEMENTATION.md
Practical usage patterns (real APIs)USAGE-GUIDE.md
MEMORY-v1 → v0.1 genealogy + measured behaviorCOMPARISON.md
User-facing limitationsdocs/user/SUPPORT-LIMITATIONS.md
Contracts (authority)docs/forma-agent-harness-synthesis-package/MEMORY-ARCHITECTURE-DECISION.md, SEMANTIC-CONTEXT-EVALUATION-CONTRACT.md, FORMA-NATIVE-MEMORY-RETRIEVAL-CONTRACT.md, MEMORY-IMPLEMENTATION-CONTRACT.md
Finalization evidence (corpus, harnesses, results)docs/memory-finalization-v0.1/
Original differential evidencedocs/memory-differential-v0.1/
Predecessor referencedocs/memory-v1/
Core codecrates/forma-agent/src/memory_context.rs, memory_reactive.rs, memory_retrieval.rs, agent.rs (loop); crates/harness-cognitive/src/msv.rs; crates/harness-record/src/record.rs
Testscrates/forma-agent/tests/macro_mem_evaluator.rs (11), macro_mem_loop.rs (5), crates/forma-agent/tests/agent_loop.rs family, crates/conformance/tests/rac_boundary.rs