Closed EXJUSTICE closed 3 months ago
The primary difference between KnowledgeGraphRAGRetriever
and KGTableRetriever
lies in their specific functionalities and configurations for retrieving information from a knowledge graph.
KGTableRetriever
KEYWORD
, EMBEDDING
, and HYBRID
.query_keyword_extract_template
: Template for extracting keywords from the query.refine_template
, text_qa_template
: Templates for refining and answering questions.max_keywords_per_query
, num_chunks_per_query
: Limits on keywords and text chunks.include_text
: Whether to include document text in the response.retriever_mode
: Specifies the mode of retrieval (keywords, embeddings, or both).similarity_top_k
: Number of top embeddings to use.graph_store_query_depth
: Depth of the graph store query.use_global_node_triplets
: Whether to use global knowledge from text chunks.max_knowledge_sequence
: Maximum number of knowledge sequences in the response.KnowledgeGraphRAGRetriever
service_context
, storage_context
: Contexts for service and storage.entity_extract_fn
, entity_extract_template
: Function and template for extracting entities.entity_extract_policy
: Policy for entity extraction (union or intersection).synonym_expand_fn
, synonym_expand_template
: Function and template for expanding synonyms.synonym_expand_policy
: Policy for synonym expansion (union or intersection).max_entities
, max_synonyms
: Limits on entities and synonyms.retriever_mode
: Mode of retrieval (keyword, embedding, or keyword_embedding).with_nl2graphquery
: Whether to combine NL2GraphQuery in context.graph_traversal_depth
: Depth of graph traversal.max_knowledge_sequence
: Maximum number of knowledge sequences in the response.verbose
: Whether to print debug information.In summary, while both retrievers are designed to work with knowledge graphs, KGTableRetriever
focuses on keyword and embedding-based retrieval, whereas KnowledgeGraphRAGRetriever
is tailored for SubGraph RAG with additional functionalities like entity extraction and synonym expansion. Additionally, KnowledgeGraphRAGRetriever
is specifically used in the context of Neo4j query engines, as indicated by its integration in the Neo4jQueryEnginePack
for performing complex graph-based queries [1][2].
To continue talking to Dosu, mention @dosu.
Question Validation
Question
I can see from documentation that the KnowledgeGraphIndex class utilizes the KGTableRetriever during retrieval as a query engine, but there also exists the KnowledgeGraphRAGRetriever class in the same file. Do they share overlapping responsibilities, how do they differ?