diff --git a/src/resources/extensions/sf/memory-relations.ts b/src/resources/extensions/sf/memory-relations.ts index dbc02b4c2..89fbbbe6d 100644 --- a/src/resources/extensions/sf/memory-relations.ts +++ b/src/resources/extensions/sf/memory-relations.ts @@ -1,9 +1,15 @@ // SF Memory Relations — knowledge-graph edges between memories // -// Phase 4 companion to memory-store.ts. Edges live in the `memory_relations` -// table and are created by (a) explicit LINK actions emitted by the memory -// extractor, or (b) future `/sf memory link` CLI commands. All writes go -// through the single-writer gate in `sf-db.ts`. +// Edges live in the `memory_relations` table and are produced by: +// (a) `applyMemoryActions` auto-linking co-extracted memories with +// `related_to` (confidence 0.5) — same-batch memories from the +// extractor share narrative context. +// (b) `/sf memory import` loading explicit edges from a JSON export. +// Read consumers: +// (1) `getRelevantMemoriesRanked` walks edges of cosine top-N memories +// and applies a one-pass intra-pool score boost (damping 0.4). +// (2) `sf_graph` MCP tool exposes BFS traversal for explicit queries. +// All writes go through the single-writer gate in `sf-db.ts`. import { _getAdapter, isDbAvailable } from "./sf-db.js";