Memory research

Novel turns should not wait for the clock.

A fixed buffer cadence is easy to reason about, but it can delay the exact moments worth remembering. Surprise-gated flushing watches for semantic novelty and flushes when the conversation changes direction.

This is one research track, not the whole Remnic memory system. Remnic also includes extraction, recall injection, hybrid search, entity tracking, lifecycle hygiene, trust zones, procedural memory, local LLM routing, versioning, retention tiers, disclosure controls, project scoping, importers, benchmarks, recall X-ray, and more. These pages explain focused memory tracks inside that broader system.

The product idea in plain terms.

Measure novelty

Embedding distance estimates how different the current turn is from the recent buffer.

Flush selectively

High-surprise turns can trigger extraction even if the normal time or count threshold has not fired.

Stay additive

Existing signal-based triggers remain. Surprise is another route, not a replacement.

Already in Remnic
  • Buffered extraction avoids writing every turn immediately.
  • Semantic helpers support similarity checks.
  • Stats and audits expose extraction behavior.
Landed in this track
  • PR #571 added the pure computeSurprise helper.
  • PR #618 wired the surprise-gated flush trigger.
  • PR #627 added telemetry and doctor distribution; PR #631 added the A/B benchmark.