The Limitation of Static Graph Traversal

Traditional GraphRAG implementations often rely on fixed traversal strategies—such as breadth-first search or static hop-limits—to retrieve context from knowledge graphs. These approaches fail to account for the semantic intent of a user's query, often leading to the retrieval of irrelevant nodes or the omission of critical multi-hop relationships. MOSAIC (Query-Aware Exploration Policy Adaptation) addresses this by treating the graph traversal process as a dynamic decision-making problem.

Adaptive Exploration via Policy Learning

Instead of a one-size-fits-all retrieval path, MOSAIC employs a query-aware policy that adapts the exploration strategy in real-time. By analyzing the query's semantic structure, the model determines the optimal depth and breadth of the graph traversal. This allows the system to:

  • Prioritize high-relevance paths: Focus computational resources on graph neighborhoods that are semantically aligned with the query.
  • Minimize noise: Reduce the inclusion of irrelevant graph entities that typically degrade LLM performance in RAG pipelines.
  • Optimize context windows: Ensure that the retrieved information is both concise and highly relevant, preventing the 'lost in the middle' phenomenon common with large, noisy context sets.

Performance and Implementation

The framework demonstrates that tailoring the exploration policy to the query significantly improves retrieval precision. By shifting from static heuristics to a learned, adaptive policy, MOSAIC enables more efficient navigation of complex knowledge graphs, ensuring that the LLM receives the most pertinent information for reasoning tasks. This approach is particularly effective for complex, multi-hop queries where the answer is distributed across disparate nodes in the graph.