feat: add knowledge graph visualization - #108
Merged
Merged
Conversation
Implement automatic link suggestions using semantic similarity to help
users discover related memories that could be linked together.
Backend Changes:
- Add suggestion service using vector search to find similar memories
- Filter out existing links and self-links automatically
- Convert cosine distance to relevance scores (0-1)
- Add GET /api/memories/{id}/suggestions endpoint with configurable
limit and min_relevance parameters
- Add helper function to efficiently get linked memory IDs
- Graceful error handling (returns empty array on failure)
Frontend Changes:
- Add "Suggested Connections" section in memory detail panel
- Display suggestions with relevance scores as percentages
- One-click acceptance with "+" button to create links
- Loading state with spinner during fetch
- Remove suggestions from list after acceptance
- Refresh suggestions when links are created/deleted (SSE integration)
- Visual distinction with dashed borders and Sparkles icon
- Auto-fetch suggestions when panel opens
Features:
- Uses existing embedding infrastructure (no new models needed)
- Default threshold of 0.35 cosine distance (60% relevance minimum)
- Returns top 5 suggestions by default (configurable 1-20)
- Created links are marked as "auto" type with relevance score
- Empty state handling (no suggestions if no embeddings or no matches)
Add interactive knowledge graph visualization with AI-powered insights: Frontend: - New GraphPage with force-directed graph using Reagraph - Filters for memory type, date range, and isolated nodes - Community detection with automatic coloring - AI link suggestions panel with one-click accept - "View in graph" button in memory detail panel - New tooltip, legend, and filter components Backend: - Graph data endpoint with filtering support - Analytics endpoints for centrality, communities, stats - Insights endpoints for link recommendations and health metrics - Batch link creation for auto-linking - TTL cache with invalidation for graph data - NetworkX-based graph analytics services
comppaz
force-pushed
the
feat/knowledge-graph
branch
from
February 5, 2026 11:56
ce5f565 to
5faa0a4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan
/graphroute and verify graph renders with existing memories🤖 Generated with Claude Code