Recollect.WorkingMemory (recollect v0.5.1)

Copy Markdown View Source

Working memory layer (Tier 0).

A bounded buffer for current-session notes, separate from long-term knowledge. Session-scoped, no embeddings, importance-based eviction.

Implemented as a GenServer per scope via DynamicSupervisor.

Summary

Functions

List all active scope IDs.

Clear working memory for a scope and terminate the GenServer.

Semantic alias for clear, used at session boundaries.

Load handoff into working memory on session resume.

Push a new entry into working memory for a scope.

Read working memory entries for a scope, sorted by importance DESC.

Functions

active_scopes()

List all active scope IDs.

clear(scope_id)

Clear working memory for a scope and terminate the GenServer.

flush(scope_id)

Semantic alias for clear, used at session boundaries.

load_handoff(scope_id)

Load handoff into working memory on session resume.

Pushes handoff items as high-importance entries so the session can immediately continue from where it left off.

push(scope_id, content, opts \\ [])

Push a new entry into working memory for a scope.

Starts the scope GenServer if not running. If the scope exceeds max entries, the lowest-importance entry is evicted.

Options

  • :importance - Float 0.0-1.0, default 0.0
  • :metadata - Map, default %{}

read(scope_id, opts \\ [])

Read working memory entries for a scope, sorted by importance DESC.