Skip to content

Add spreading activation, temporal recall, and retrieval quality improvements#2

Merged
not-reed merged 1 commit intomainfrom
feat/memory-retrieval-improvements
Mar 25, 2026
Merged

Add spreading activation, temporal recall, and retrieval quality improvements#2
not-reed merged 1 commit intomainfrom
feat/memory-retrieval-improvements

Conversation

@not-reed
Copy link
Copy Markdown
Owner

Summary

  • Spreading activation for graph traversal — scored BFS with edge-weight-aware decay, replacing flat depth-only traversal. Scores never exceed parent (weights reduce decay, don't amplify). New spreadActivation, searchNodesWithScores, getRelatedMemoriesWithScores functions in cairn.
  • Temporal filteringsince/before ISO date params on recallMemories and memory_recall tool, letting the LLM handle natural language date parsing.
  • FTS5 stop word filtering — ~100 common English words stripped from FTS5 OR queries to reduce common-word noise in recall results.
  • Retrieval quality across all apps: Construct graph memories now carry activation scores; Cortex signals stored with embeddings + graph extraction; Loom now uses graph expansion (was entirely missing).
  • Observability — debug logging for injected skill instructions (with scores), relevant memories (with match type + score). Skill selection threshold raised 0.35 → 0.45.
  • Generation priority — observation budget eviction now factors in generation counter (survived more compression rounds = evicted last).

Test plan

  • 353 tests passing (14 new tests for spreading activation, temporal recall, graph score propagation, stop words)
  • Typecheck clean across all packages
  • Lint + format clean
  • Manual testing via live Telegram bot — verified skill selection, memory recall, and logging output
  • Monitor cairn VM after deploy for regression

🤖 Generated with Claude Code

…ovements

Cairn-level improvements benefiting all consumers (Construct, Cortex, Loom, Deck):
- Spreading activation graph traversal with edge-weight-aware decay scoring
- Temporal filtering (since/before) on recallMemories
- FTS5 stop word filtering to reduce common-word noise
- Generation counter used in observation budget eviction priority
- Skill selection threshold raised from 0.35 to 0.45

App-level fixes:
- Construct: graph-expanded memories now carry activation scores, debug logging
  for injected skill instructions and relevant memories with match type + score
- Cortex: signal memories now stored with embeddings + graph extraction,
  analyzer uses spreadActivation instead of flat traverseGraph
- Loom: added graph expansion to recall path (was entirely missing)

Cleanup: remove dead syncSkillInstructionsToGraph, add .superset to gitignore

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying sprawl with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4bba4d9
Status: ✅  Deploy successful!
Preview URL: https://ef02138b.sprawl.pages.dev
Branch Preview URL: https://feat-memory-retrieval-improv.sprawl.pages.dev

View logs

@not-reed not-reed merged commit 86f858d into main Mar 25, 2026
2 checks passed
@not-reed not-reed deleted the feat/memory-retrieval-improvements branch March 25, 2026 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant