File size: 2,045 Bytes
f7ab812
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# **GraphRAG**

GraphRAG is a Python-based framework designed to build, manage, and query **Graph Retrieval-Augmented Generation (GraphRAG)** systems. It combines advanced graph processing tools like **Neo4j** and **NetworkX** with natural language capabilities powered by **LLMs (Large Language Models)** to create, visualize, and query knowledge graphs.

---

## **Features**
- **Knowledge Graph Construction**: Extract entities and relationships from text and construct a knowledge graph.
- **Graph Management**:
  - Store and query graphs in **Neo4j**.
  - Perform analysis and operations on **NetworkX** graphs.
- **Graph Summarization**: Analyze and summarize communities within the graph.
- **Natural Language Interaction**: Generate answers to queries using the knowledge graph and language models.
- **Interactive Visualization**: Explore and interact with knowledge graphs using **Gradio**.
- **Modular Design**: A highly organized and reusable codebase for scalable development.

---

## **File Structure**

β”œβ”€β”€ graphRAG # Main project directory

    β”œβ”€β”€ init.py #Marks the directory as a Python package 

    β”œβ”€β”€ main.py # Entry point to run the GraphRAG pipeline 

    β”œβ”€β”€ community_summaries.pkl # Serialized summaries of graph communities 

    β”œβ”€β”€ entities_extraction.py # Extract entities and relationships from text 

    β”œβ”€β”€ generating_answers.py # Generate answers to queries using the graph 

    β”œβ”€β”€ get_communities.py # Identify and analyze graph communities 

    β”œβ”€β”€ gradio_viz.py # Gradio-based interactive graph visualization 

    β”œβ”€β”€ graph_builder.py # Build the knowledge graph 

    β”œβ”€β”€ graph_nx.py # Manage and analyze NetworkX-based graphs 

    β”œβ”€β”€ KG_classes.py # Defines classes for knowledge graph objects 

    β”œβ”€β”€ subgraphs.py # Extract and manage subgraphs 

    β”œβ”€β”€ utils.py # Shared utility functions 

    β”œβ”€β”€ graph.gpickle # Serialized NetworkX graph file 

    β”œβ”€β”€ README.md # Project documentation (this file)