A Retrieval-Augmented Generation (RAG) application using Knowledge Graphs (KùzuDB), Vector Search (FAISS), and Local LLMs (Ollama/DeepSeek).
- Hybrid Retrieval: Combines vector similarity search with knowledge graph traversal.
- Local Processing: Uses local LLMs via Ollama for privacy and cost efficiency.
- Graph Visualization: Interactive graph view using Cytoscape.js.
- Document Support: PDF, DOCX, TXT, MD.
Download and install Ollama from ollama.com.
This project uses deepseek-r1:8b by default. Run the following command in your terminal:
ollama pull deepseek-r1:8bStart the Ollama server:
ollama serve(Note: On some systems, the desktop app runs the server automatically)
Ensure you have Python 3.9+ installed.
-
Clone or navigate to the project directory:
cd graphrag-flask -
Create a virtual environment (optional but recommended):
python -m venv venv # Windows venv\Scripts\activate # Mac/Linux source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
The application uses a config.py file which loads environment variables. You can create a .env file to override defaults:
OLLAMA_HOST=http://localhost:11434
OLLAMA_MODEL=deepseek-r1:8b
KUZU_DB_PATH=./kuzu_db
CHUNK_SIZE=500-
Start the Flask server:
python app.py
-
Open your browser and navigate to:
http://localhost:5000
- Upload: Use the sidebar to upload a document.
- Process: Click "Process" to extract entities and build the graph.
- Chat: Ask questions about your documents in the chat window.