A Retrieval-Augmented Generation (RAG) pipeline that connects Databricks SQL tables and Neo4j graph database for advanced context retrieval and LLM-powered question answering.
- Extracts schema from Databricks SQL tables
- Builds a knowledge graph in Neo4j (tables, columns, relationships)
- Enables context-rich retrieval for LLMs
- Python 3.8+
- Databricks SQL Warehouse access
- Neo4j Aura or self-hosted instance
-
Clone the repository:
git clone https://github.com/NehaSJ99/graphRAG.git
-
Create and activate a virtual environment (recommended):
python -m venv graphrag-env .\graphrag-env\Scripts\activate # On Windows
-
Install dependencies:
pip install -r requirements.txt
-
Configure environment variables:
- Copy
.env.exampleto.envand fill in your Databricks and Neo4j credentials, or edit.envdirectly.
- Copy
Run:
python conn_databricks.pyThis will print all tables and their schema from your Databricks SQL warehouse.
Run:
python create_graph.pyThis will create nodes for tables and columns, and relationships in your Neo4j database.
You can use conn_graphdb.py or your own scripts to run Cypher queries against the graph.