feat: graph-enhanced retrieval — native GraphStore + pipeline integration#394
Open
2233admin wants to merge 3 commits intoNevaMind-AI:mainfrom
Open
feat: graph-enhanced retrieval — native GraphStore + pipeline integration#3942233admin wants to merge 3 commits intoNevaMind-AI:mainfrom
2233admin wants to merge 3 commits intoNevaMind-AI:mainfrom
Conversation
- GraphNode/GraphEdge/GraphCommunity domain models + SQLModel ORM - GraphStore repository with CRUD + dual-path graph recall + PPR/LPA - Alembic migration for gm_* tables with scope column support - Wired into PostgresStore alongside existing repos - 77 existing tests still passing
- RetrieveGraphConfig: enabled, weight (β), max_nodes - recall_graph WorkflowStep in RAG workflow - Score fusion in _rag_build_context: vector*α + graph*β - graph_nodes[] in retrieve response - 77 tests pass, E2E verified with live PG data
Tests cover: PPR algorithm (8), global PageRank (3), LPA community detection (4), merge results (4), score fusion (3), config (4), domain models (3), ORM registration (1). All pure-Python, no DB needed.
cf48f48 to
1e1a992
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
Add graph-enhanced retrieval as a native module in memU, replacing external ad-hoc graph recall.
Changes
Phase 1: GraphStore module
GraphNode,GraphEdge,GraphCommunitydomain models + SQLModel ORMPostgresGraphStorerepository (800+ lines): CRUD, dual-path graph recall, PPR, LPA, global PageRankgm_*tables with scope column supportPostgresStorealongside existing reposPhase 2: Pipeline integration
RetrieveGraphConfig:enabled,weight(0.0-1.0),max_nodesrecall_graphWorkflowStep in RAG retrieve workflowgraph_nodes[]in retrieve responsePhase 3: Tests + docs + review
Review findings addressed
Discussion points
ddl_mode="validate"still runs Alembic upgrade (pre-existing)user_id; dynamic scope models may need migration updatesTest plan