M05 · Vector DB · episodic and semantic memory

Memory fabric

Scratchpad, episodic and semantic tiers with eviction, provenance and validation.

$ python -m fde_toolkit memory

Workflow

the order an FDE actually runs it in

  1. 1Write working state to the scratchpad for the current task only.
  2. 2Promote outcomes and decisions to episodic memory with a timestamp and actor.
  3. 3Validate and govern durable facts before they enter semantic memory.
  4. 4Retrieve by similarity (vector) and by relationship (graph) together.
  5. 5Evict on budget with a recorded reason so context rot is visible.

Function output

deterministic trace

scratchpad: 12 items  episodic: 340 items  semantic: 87 facts
recall('small-alert policy') -> episodic#118 similarity 0.91 RECALL
evict(scratchpad#3) reason=token budget, context rot at 62% of window