Purpose
GraphRAG-Ollama-UI aims to be a GraphRAG/knowledge graph application toolkit for local large language models. It is an adapted version of Microsoft GraphRAG, adapted for local models, and provides a complete interactive user interface ecosystem for operations such as indexing, prompt tuning, querying, and visualization.
Main capabilities
- API-centric architecture: Provides a FastAPI-based server (api.py) as the core of GraphRAG operations.
- Standalone indexing and prompt tuning interface: A standalone Gradio-based interface (index_app.py) for managing indexing and prompt tuning workflows.
- Local model support: LLMs and embeddings can use local models, compatible with Ollama and OpenAI-compatible APIs.
- Cost effectiveness: By using your own local models, it eliminates dependence on expensive cloud models.
- Interactive interface: A user-friendly interface for managing data, running queries, and visualizing results (main application).
- Real-time graph visualization: Visualize the knowledge graph in 2D or 3D using Plotly (main application).
- File management: Upload, view, edit, and delete input files directly in the interface.
- Settings management: Easily update and manage GraphRAG settings through the interface.
- Output browsing: Browse and view indexing outputs and artifacts.
- Logging: Provides real-time logs for easy debugging and monitoring.
- Flexible querying: Supports global, local, and direct chat queries, with customizable parameters (main application).
- Customizable visualization: Adjust graph layout, node size, color, etc. (main application).
Usage
To install and start, the general process is as follows:
- Create and activate a conda environment:
conda create -n graphrag-local -y,conda activate graphrag-local. - Install dependencies: first install the GraphRAG directory in this repository (which includes changes not present in the Microsoft repository):
pip install -e ./graphrag, then install the remaining dependencies:pip install -r requirements.txt. - Start the API server:
python api.py --host 0.0.0.0 --port 8012 --reload. - If using Ollama for embeddings, start the embedding proxy:
python embedding_proxy.py --port 11435 --host http://localhost:11434(see EMBEDDING_PROXY_README.md for details). - Start the indexing and prompt tuning interface:
gradio index_app.py. - Start the main interactive interface (legacy application):
gradio app.pyorpython app.py. - Access the interfaces: the indexing and prompt tuning interface is http://localhost:7861;主界面(旧版)为 http://localhost:7860。
Getting started steps also include: creating an index directory, adding sample data (optional), initializing the index folder, moving the preconfigured settings.yaml to the index directory, and customizing via the environment variables ROOT_DIR and INPUT_DIR.
Application ecosystem
GraphRAG-Ollama-UI ecosystem consists of three main components:
- Core API (api.py): A FastAPI server that manages indexing and prompt tuning workflows, handles query types such as local, global, and direct chat, integrates local LLMs and embedding models, and provides endpoints for file management and system configuration. If using Ollama embeddings, the embedding proxy must also be running.
- Indexing and prompt tuning interface (index_app.py): A Gradio interface for configuring and running indexing tasks, setting up and executing prompt tuning, managing input files and browsing output data, and adjusting LLM and embedding settings. Access address http://localhost:7861。
- Main interactive interface (legacy application, app.py): Provides 2D/3D visualization of the knowledge graph, runs queries and views results, manages GraphRAG settings, browses indexed data, and other features. Access address http://localhost:7860。该应用正在被逐步淘汰,但仍保留有用功能。
Applicable Scenarios
Suitable for users who want to build and query knowledge graphs using large language models in a local environment, especially scenarios focused on privacy, cost control, or offline deployment. Suitable for tasks such as index construction, prompt tuning, knowledge graph visualization, and query chat.
Limitations and Notes
- The project is in an architectural transition period; the main application is still usable, but standalone index/prompt tuning and query/chat applications are under development; changes and instability may occur during the transition.
- Currently it has mainly only been tested on a Mac Studio M2.
- The update pace is relatively slow, but the author promises to address bugs and issues when time permits.
- On Windows, if encoding/UTF errors are encountered, you can change it to the correct format in the YAML settings menu.
- If
gradio app.pycannot run, you can trypip install --upgrade gradioand then reopen the terminal. - Planned features include: a dedicated query/chat interface, Dockerfile, a GraphRAG API server for use as an external application, a hybrid agent for indexing/querying knowledge graphs (experimental), support for more file formats (CSV, PDF, etc.), web search/scraping capabilities, advanced graph analysis tools, integration with knowledge management tools, team collaboration features, etc. These features have not yet been confirmed as implemented in the materials.
References
The original GraphRAG implementation can be found in the GraphRAG paper and official documentation. This project was inspired by win4r's GraphRAG4OpenWebUI repository and uses it as the starting point for the API implementation.