Class: Mneme::RecallRunner

Inherits:
BaseRunner show all
Defined in:
lib/mneme/recall_runner.rb

Overview

Mneme in recall mode — a phantom LLM loop that decides whether any older memory would help Aoide with what she’s working on now, and surfaces it if so. Triggered whenever Aoide’s context shifts in ways worth re-remembering around (new user message, goal change).

The muse searches long-term memory through her search tool (which automatically excludes Aoide’s current viewport), drills into candidate messages when she needs to decide, and surfaces only what genuinely helps. Silence — nothing surfaced — is the default answer.

This is not the eviction loop (Runner); same muse, different work.

Examples:

Mneme::RecallRunner.new(session).call

Constant Summary collapse

TOOLS =
[
  ::Tools::SearchMessages,
  ::Tools::ViewMessages,
  Tools::SurfaceMemory,
  Tools::NothingToSurface
].freeze
TASK_PROMPT =
<<~PROMPT
  Right now your work is recall. Aoide's focus has just shifted — a new message, a changed goal — and you're here to decide whether any memory from before would genuinely help her now.

  ──────────────────────────────
  WHAT MAKES RECALL USEFUL
  ──────────────────────────────
  Recall is a tax on Aoide's viewport. Every memory you surface takes tokens away from the present exchange. Return empty-handed far more often than you return something. One well-chosen memory beats five that nearly-match. Most of the time, nothing is worth surfacing — and that is the right answer.

  A memory is worth surfacing when it carries weight Aoide can't reconstruct from what's already in front of her: a prior decision about this exact problem, a specific constraint she encountered before, a voice from another session relevant to the one unfolding. Not tangential echoes. Not mere keyword overlap. Something she'd want to have remembered.

  ──────────────────────────────
  THE QUERY IS THE JUDGMENT
  ──────────────────────────────
  Composing your query is where the thinking happens. Read what Aoide is doing right now and ask: what specific words, phrases, or names would only appear in past messages that meaningfully help her? Not the topic. Not the domain. The signal that distinguishes "she'd want this" from "this contains overlapping vocabulary."

  When a candidate looks promising but its meaning is unclear, read the full context around it before surfacing.
PROMPT

Constants inherited from BaseRunner

BaseRunner::BASE_IDENTITY

Method Summary

Methods inherited from BaseRunner

#call, #initialize

Constructor Details

This class inherits a constructor from Mneme::BaseRunner