feat(provider): add automatic recall via prefetch with per-session seen-set
authorSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Fri, 23 Oct 2026 13:59:28 +0000 (16:59 +0300)
committerSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Fri, 23 Oct 2026 13:59:28 +0000 (16:59 +0300)
commit171b31b50e4bea485a80947e6ec8d138f5671d1c
treed553b77c52bd28913f2688361c9fafdfa8af49a3
parenteb3a6287df02d9d251b2cad683d741016c2b4a20
feat(provider): add automatic recall via prefetch with per-session seen-set

- prefetch() embeds the current message plus a rolling topic (two prior
  user messages and the tail of the last reply, recorded by sync_turn)
  so short follow-ups retrieve on-topic memories; injects up to
  PREFETCH_LIMIT=30 memories per turn as a "Retinue recall (N fresh)"
  block
- per-session in-RAM seen-set filters ids already returned, shared with
  retinue_memory_search (new include_seen parameter, default false;
  limit default now 30); on_session_switch and on_pre_compress clear it
- warm the embedding model on a daemon thread at initialize() and guard
  get_model() with a lock so warmup and concurrent tool calls cannot
  double-load the 500 MB model
- recall_status() reports the last injection size for Hermes' recall
  indicator
- fix mirror data loss: deletions now key on the previous_content
  metadata and match exact content first, falling back to a substring
  match only when unambiguous; find_by_content split into find_exact
  and find_containing (instr-based, so % and _ stay literal)
- docs: AGENTS.org "Recall algorithm" section, Development prefetch
  section, corrected similarity-score explanation; version 1.1.1 -> 1.2.0
AGENTS.org
Documentation/Development/index.org
Documentation/index.org
plugin.yaml
src/retinue/memory.py
src/retinue/provider.py
test/test_standalone.py