Skip to content

GraphRAG #103

Description

@ritzx21

GraphRAG Implementation using Llama-Index

Description

  • Graph RAG is a knowledge-enabled approach to retrieve information from knowledge graph on given task.
  • It uses a Knowledge Graph and utilizes LLMs to extract Entities, Relationships and Keys from all external documents.
  • 3 main stages of an RAG ->
    1. Indexing (chunking of document and storing in vector form)
    1. Retrieval (query vector to retrieve data based on input )
    1. Generation (using LLM to use the retrieved and input content to formulate contextually relevant response)
  • Here Graph RAG includes a knowledge graph before the RAG. So the indexing happens of the data points in the Knowledge Graph.

Benefits

  • Traditional RAG treats documents as independent chunks, whereas GraphRAG captures explicit relationships between concepts, generating better and contextually relevant response.
  • Regular RAG might miss important connections between different parts of documents, graphRAG maintains these connections through it's graph structure.
  • Graph RAG can help answer questions that require understanding relationships between entities.
  • Better at handling multi-hop queries. (questions that require connecting multiple pieces of information)

Implementation Ideas

  • GraphRAG implementation with Llama_index
  • GraphRAG thorugh - NetworkX , faiss library (less complex) -> NetworkX to make nodes , faiss for indexing , then processing LLM by adding embedding layer.

Additional Context

https://docs.llamaindex.ai/en/stable/examples/query_engine/knowledge_graph_rag_query_engine/

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions