Leveraging graph-based relationships for improved context and retrieval in RAG systems
GraphService
class:
EntityResolver
class:
query_with_graph
method:
hop_depth
parameter controls how far to traverse the graph from the initial entities, allowing you to balance between focused and comprehensive retrieval.
hop_depth
parameter determines how far to traverse the graph from the initial entities found in the query. A higher value casts a wider net but may include less relevant information.
When include_paths=True
, the response includes the paths through the graph that led to the retrieved documents, providing explainability for why certain information was included.