Skip to content

The procedural wedge

The wedge is the part of mnesio that has no equivalent in storage-shaped memory systems: the agent doesn’t just remember facts, it compiles its own behavior into something measurably better — and the only way that better thing ships is by passing an eval gate.

The primary loop (mnesio-procedural) turns batches of agent Outcomes into improved, versioned PolicyArtifacts — system prompts, heuristics, skills, and retrieval rules. It’s a GEPA-style reflective loop:

  1. Reflect. Read a batch of outcomes; diagnose what went wrong and why.

  2. Propose K candidates. Generate K improved artifact variants from the reflection.

  3. Shadow-evaluate. Run each candidate against an EvalSuite of benchmark tasks plus canaries and a safety probe, producing an EvalReport.

  4. Pareto-select. Pick the winner on the Pareto front of objective score vs. safety — never trading a probe regression for a higher score.

  5. Gated commit. Only if EvalReport::is_committable() holds does the winner become the new active version, via an atomic hot-swap of the active-version pointer. Otherwise it’s rejected and logged.

Credit assignment is multi-prompt: when several prompts contribute to an outcome, the compiler attributes the delta across them rather than crediting one blindly.

Phase 2 is only considered done when there’s a positive learning curve on an ALFWorld-style suite with no safety-probe regression — a real curve, dashboarded live, not a claim.

When a memory is written, a bounded async worker runs three A-MEM-style LLM steps to retroactively re-tag and re-link related memories — keeping the knowledge graph the compiler learns from adaptive. It is:

  • Async — never on the write path (Hard Rule #5).
  • BoundedEvolveConfig caps max_evolve_per_write, cooldown, and a lifetime limit (Hard Rule #6). A-MEM has no convergence guarantee; the bounds replace it.
  • Non-destructive — every evolution invalidates-and-supersedes with a parent pointer; history is kept (Hard Rule #2).

The wedge extends into the frontier phases, all behind the same gate:

  • Causal credit assignment (Phase 10) scores each memory’s counterfactual contribution by replaying outcome evaluation with it masked, then GCs by provable zero contribution.
  • Self-falsifying memory (Phase 11) re-runs acceptance probes and, on Refuted, auto-supersedes the memory with no human in the loop.
  • Negative memory + dreaming (Phase 14) compiles bad outcomes into gated suppression rules and runs bounded offline consolidation that prunes provable dead weight and re-anchors drifted notes.

Next: see the measured results in Benchmarks.