feat: Graph Search Fusion with RRF re-ranking#30
feat: Graph Search Fusion with RRF re-ranking#30RaviTharuma wants to merge 1 commit intoAVIDS2:mainfrom
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Thanks for opening this — the graph + RRF direction is interesting, and I do think graph-aware retrieval is something Memorix should likely explore. That said, I don’t want to merge this PR as-is right now for two concrete reasons:
So my current maintainer take is: good direction, but not ready to merge in the current form. If you want to keep pushing it, the first step would be rebasing it to a graph-only diff on top of current |
Add knowledge graph traversal as a 3rd retrieval source alongside BM25 and vector search. When graph data exists, entity names from search results seed a BFS traversal (1-2 hops), and all sources are merged via Reciprocal Rank Fusion (k=60). Changes: - src/search/rrf.ts: New RRF implementation with multi-source fusion - src/memory/graph.ts: graphSearch() BFS + getEntitiesForNames() - src/store/orama-store.ts: Graph fusion gate in searchObservations() - src/server.ts: Wire setGraphManager() into store initialization Tests: 18/18 integration tests, 23/23 RRF unit tests pass. Gate conditions: graph fusion activates only when graphManager is set and has entities. Falls back gracefully to BM25+vector otherwise. Closes: memorix-awr
09e13e9 to
ac76c57
Compare
|
Rebased to graph-only diff on current Branch now contains 1 commit:
Files changed (graph-only):
No commits from other PRs remain. Clean diff against Understood re: 1.0.6 layered retrieval architecture — happy to adapt the fusion approach once the retrieval architecture is locked. This rebase gives you a clean branch to evaluate whenever you're ready. |
|
Interesting direction. I like the idea of graph-assisted retrieval, but I can't take this one as-is yet. Immediate blocker: the PR is still red on Separately from the red CI, this is also touching a part of the search stack that we are about to restructure in 1.0.6 around provenance and layered retrieval. Once the type errors are fixed I'd like to take another look at how graph fusion should fit relative to L1 routing vs L2/L3 enrichment, rather than locking in a flat fusion path too early. |
Summary
Adds knowledge graph traversal as a 3rd retrieval source alongside BM25 and vector search. When graph data exists, entity names from search results seed a BFS traversal (1-2 hops), and all sources are merged via Reciprocal Rank Fusion (k=60).
Changes
src/search/rrf.tssrc/memory/graph.tsgraphSearch()BFS traversal +getEntitiesForNames()helpersrc/store/orama-store.tssearchObservations()— activates only when graph has entitiessrc/server.tssetGraphManager()into store initialization (2 call sites)How it works
entityNamefield)graphManageris set and contains entities, BFS traverses 1-2 hops from matched entities1/(k + rank)scoring)Gate conditions (zero breaking changes)
Graph fusion only activates when:
graphManageris set on the store (viasetGraphManager())Otherwise falls back to existing BM25+vector behavior — fully backward compatible.
Tests
tests/search/, 5 pre-existingvi.resetModulesfailures unrelated)Design decisions