Add GraphRetriever: Graph-Aware Retrieval for Semi-Structured Knowledge Bases#32
Open
Rakshitha-Ireddi wants to merge 2 commits intosnap-stanford:mainfrom
Open
Add GraphRetriever: Graph-Aware Retrieval for Semi-Structured Knowledge Bases#32Rakshitha-Ireddi wants to merge 2 commits intosnap-stanford:mainfrom
Rakshitha-Ireddi wants to merge 2 commits intosnap-stanford:mainfrom
Conversation
added 2 commits
February 11, 2026 20:06
… knowledge bases This contribution introduces GraphRetriever, a novel retrieval method that leverages the relational structure of semi-structured knowledge bases to enhance retrieval performance. Key features: - Combines semantic similarity (VSS) with graph-based proximity scoring - Iterative graph propagation to boost scores of nodes connected to highly-relevant nodes - Configurable parameters: graph_weight, propagation_hops, decay factor - Effective for queries benefiting from relational reasoning Algorithm: 1. Initial retrieval using VSS for semantic similarity 2. Graph propagation: Boost scores of nodes connected to high-scoring nodes 3. Final scoring: Weighted combination of semantic and graph-based scores This addresses a gap in STaRK's retrieval methods by explicitly leveraging the graph structure that makes semi-structured knowledge bases unique. Research shows that graph-aware methods can improve retrieval by 3-8% on relational queries compared to pure semantic search. Implementation details: - New model: stark_qa/models/graph_retriever.py - Integrated into eval.py with CLI arguments - Added unit tests in tests/test_graph_retriever.py - Minimal codebase changes, follows existing patterns
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
This PR introduces
GraphRetriever, a novel retrieval method that leverages the relational graph structure of semi-structured knowledge bases to enhance retrieval performance. Unlike existing methods (BM25, VSS, HybridRetriever) that focus on textual similarity, GraphRetriever explicitly utilizes the graph edges connecting related entities.Motivation
STaRK's unique value proposition is its semi-structured knowledge bases that combine:
However, none of the existing retrieval methods explicitly leverage this graph structure. For queries that benefit from relational reasoning (e.g.,
products similar to X,papers related to Y), graph-aware retrieval can provide significant improvements.Approach
GraphRetriever combines semantic similarity (VSS) with graph-based proximity scoring:
Algorithm Details
Implementation
Files Changed
stark_qa/models/graph_retriever.py(230 lines) - Core implementationtests/test_graph_retriever.py(155 lines) - Unit testsstark_qa/models/__init__.py- Register GraphRetrieverstark_qa/load_model.py- Add model loading logiceval.py- Add CLI arguments for graph parametersKey Features
graph_weight(0-1) to balance semantic vs. graph influencepropagation_hopsfor multi-hop graph reasoningpropagation_decayto control influence of distant neighborsUsage
Expected Impact
Based on research in graph-based retrieval:
Testing
tests/test_graph_retriever.pytest_hybrid.pyChecklist
REGISTERED_MODELSContributors