← BlogRAG

HybridRAG: Knowledge Graphs and Vector Retrieval

Isaac Kargar2 min read

  • RAG
  • Knowledge Graphs
  • Vector Search
  • Information Retrieval

HybridRAG: Integrating Knowledge Graphs and Vector Retrieval Augmented Generation for Efficient Information Extraction, by Bhaskarjit Sarmah and co-authors, combines two retrieval paths for question answering over financial documents. The paper evaluates a custom dataset of 400 questions drawn from 50 Nifty 50 Q1 FY2024 earnings-call transcripts. It does not establish the same results for other domains.

Vector retrieval

VectorRAG splits documents into chunks, embeds those chunks, and retrieves the chunks whose vectors are most similar to a query. The language model receives the retrieved text along with the question. This can work well when the answer is distributed across prose, while chunking can lose relationships that span a document’s structure.

Vector retrieval stores document chunks as embeddings and retrieves similar chunks for a question
VectorRAG retrieves text chunks by vector similarity before generation. Read the HybridRAG paper for the implementation used in the evaluation.

Graph retrieval

A knowledge graph represents entities and relationships as nodes and edges. GraphRAG extracts a graph from the documents, finds entities and connected relationships relevant to a query, and supplies that structured context to the language model. In this paper’s implementation, a depth-first search with depth one retrieves a subgraph from the graph.

Graph retrieval finds entities and relationships in a knowledge graph for a question
GraphRAG retrieves a query-relevant subgraph rather than only similar text chunks. See the paper’s GraphRAG configuration.

Graph retrieval can expose explicit relationships, while vector retrieval can provide surrounding prose. Each path can also retrieve irrelevant or incomplete context. The quality of the graph extraction and the retrieval configuration therefore affect the final answer.

HybridRAG

HybridRAG concatenates the contexts returned by VectorRAG and GraphRAG, then sends the combined context to the answer generator.

HybridRAG combines vector and graph contexts before answer generation
HybridRAG joins vector and graph retrieval results before generation, trading broader context for possible extra noise. Read the HybridRAG paper.

Reported evaluation

The authors use GPT-3.5-Turbo at temperature 0 with text-embedding-ada-002 and evaluate financial earnings-call Q&A. They report four RAGAS metrics: faithfulness, answer relevance, context precision, and context recall.

MetricVectorRAGGraphRAGHybridRAG
Faithfulness0.940.960.96
Answer relevance0.910.890.96
Context precision0.840.960.79
Context recall1.000.851.00

HybridRAG matches GraphRAG on faithfulness, improves answer relevance and context recall, and lowers context precision. Relative to VectorRAG, it improves faithfulness and answer relevance, matches context recall, and lowers context precision. These results describe the financial-document setup. Applications beyond finance remain possible research directions.

Work with Nazmi

Build your AI system with Nazmi.

Tell us what you are building, what exists today, and where your team needs help.

Start a conversation or book a 20-minute call →