Graph Retriever
What's a Graph Retriever?
Graph Retriever is a specialized retrieval component designed to extract information from knowledge graphs and graph databases. Unlike traditional vector retrievers that rely solely on semantic similarity, Graph Retrievers leverage the structured relationships between entities in a graph to provide more contextually relevant and relationally aware results.
Available Implementations:
LightRAG Graph RAG Retriever
LlamaIndex Graph RAG Retriever
Installation
# you can use a Conda environment
pip install --extra-index-url https://oauth2accesstoken:$(gcloud auth print-access-token)@glsdk.gdplabs.id/gen-ai-internal/simple/ "gllm-retrieval" --extras "kg"# you can use a Conda environment
pip install --extra-index-url https://oauth2accesstoken:$(gcloud auth print-access-token)@glsdk.gdplabs.id/gen-ai-internal/simple/ "gllm-retrieval"# you can use a Conda environment
FOR /F "tokens=*" %T IN ('gcloud auth print-access-token') DO pip install --extra-index-url "https://oauth2accesstoken:%T@glsdk.gdplabs.id/gen-ai-internal/simple/" "gllm-retrieval" --extras "kg"Before using the Graph Retriever, you should be familiar with:
Graph Data Store: Knowledge of graph data stores and their interfaces
LM Invoker: For implementations that use LLMs for query processing
EM Invoker: For implementations that use embedding models for query processing
What it does
The Graph Retriever is a component that retrieves relevant information from a knowledge graph based on a natural language query. It provides a standardized interface for graph-based retrieval operations in Gen AI applications.
Inputs
Query: A text string representing the search query
Data Store: A graph data store instance (e.g., Neo4j, LightRAG)
Retrieval Parameters: Additional parameters for fine-tuning the search (optional)
Outputs
The Graph Retriever can return different types of outputs based on the implementation:
List of Chunks: Document chunks relevant to the query
Graph Elements: Nodes (entities) and edges (relationships) from the knowledge graph
Synthesized Response: For implementations that include response generation
Graph Retriever Types
LightRAG Graph RAG Retriever
The LightRAG Graph RAG Retriever is designed to work with LightRAG data stores, providing a comprehensive retrieval solution that combines document retrieval with knowledge graph exploration.
Advanced Usage #1: Retrieving Graph Elements
LightRAG Retriever can return not just document chunks but also the knowledge graph elements (nodes and edges) related to the query:
Advanced Usage #2: Use LightRAG's Response Synthesizer
LightRAG also comes with its own response synthesizer and prompts:
LlamaIndex Graph RAG Retriever
The LlamaIndex Graph RAG Retriever leverages LlamaIndex's property graph capabilities to provide advanced graph-based retrieval with multiple retrieval strategies.
Last updated