build_graph() derives similarity (via MemoryVectorStore per-node kNN,
never O(n^2) pairwise), same-session, and manual-link edges over a
caller-supplied, already owner-scoped memory list. No persistence, no
FastAPI dependency — table-driven unit tests cover threshold/top-k
behavior, dedup, self-loop/dangling-id exclusion, and truncation.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>