What is graph-rag-agent?
graph-rag-agent is an open-source Python project that combines GraphRAG with private-domain DeepSearch to build an explainable question-answering system over your own documents. It sits in the RAG Frameworks & Platforms category of the Retrieval & Knowledge (RAG) tools and is open-source, written in Python and licensed MIT. To get started: start Neo4j.
Overview
graph-rag-agent is an open-source Python project that combines GraphRAG with private-domain DeepSearch to build an explainable question-answering system over your own documents. It reimplements GraphRAG's core ideas from scratch and borrows from Microsoft GraphRAG, Neo4j's llm-graph-builder, LightRAG and Zilliz's deep-searcher: an LLM extracts entities and relationships from your files, the result is stored as a knowledge graph in Neo4j, and a set of agents searches that graph to answer questions.
The project ships as a full stack rather than a library alone. A graph-building pipeline ingests TXT, PDF, Markdown, DOCX, DOC, CSV, JSON and YAML files, runs community detection (Leiden or SLLPA) with summaries, and supports incremental updates with entity disambiguation and alignment. A FastAPI backend serves several agents, and a Streamlit frontend shows streamed answers, the reasoning trace, the matched sub-graph and the source text in a debug mode.

It is aimed at developers who want to study or deploy graph-based RAG end to end, including evaluation: a built-in evaluation framework covers answer quality, retrieval performance, graph quality and deep-research results with more than 20 metrics. The README is written in Chinese and its sample knowledge base is a set of university student-management rules, which you replace with your own files and entity/relationship schema.
What it does
- Knowledge-graph construction in Neo4j with LLM-driven entity and relationship extraction from TXT, PDF, MD, DOCX, DOC, CSV, JSON and YAML files
- Incremental graph updates (one-off or as a background daemon) with entity disambiguation, entity alignment and built-in consistency checks
- Community detection with the Leiden or SLLPA algorithm plus generated community summaries for global search
- Several agents: NaiveRagAgent (vector retrieval), GraphAgent, HybridAgent, DeepResearchAgent and FusionGraphRAGAgent, the last built on a Plan-Execute-Report multi-agent architecture that plans tasks, runs retrieval, research and reflection workers, and writes long-form reports

- Local, global and hybrid graph search, Chain of Exploration over the graph, evidence-chain tracking and a visible thinking process
- FastAPI backend with streamed responses and a Streamlit frontend with a debug mode, an interactive Neo4j-style graph view and entity-path reasoning, plus an evaluation system with 20+ metrics
Getting started
These steps follow the project's quick-start guide (assets/start.md). You need Docker for Neo4j, Python 3.10, and an OpenAI-compatible API endpoint; the guide suggests routing requests through a One-API or New-API gateway.
Start Neo4j
The repository includes a Docker Compose file for Neo4j. The default credentials are neo4j / 12345678.
cd graph-rag-agent/
docker compose up -dCreate the Python environment
Install the dependencies into a Python 3.10 environment, then install the package itself in editable mode.
conda create -n graphrag python==3.10
conda activate graphrag
cd graph-rag-agent/
pip install -r requirements.txt
pip install -e .Configure .env
Copy .env.example to .env in the project root and fill in at least the model and Neo4j settings. The base URL points at your OpenAI-compatible gateway. Entity types, relationship types and the graph theme are set separately in graphrag_agent/config/settings.py.
OPENAI_API_KEY = 'sk-xxx'
OPENAI_BASE_URL = 'http://localhost:13000/v1'
OPENAI_EMBEDDINGS_MODEL = 'text-embedding-3-large'
OPENAI_LLM_MODEL = 'gpt-4o'
NEO4J_URI = 'neo4j://localhost:7687'
NEO4J_USERNAME = 'neo4j'
NEO4J_PASSWORD = '12345678'Build the knowledge graph
Put your source documents in the files/ folder, then run the full build. The incremental script applies later additions and removals, once or as a daemon.
cd graph-rag-agent/
python graphrag_agent/integrations/build/main.py
# incremental update, once
python graphrag_agent/integrations/build/incremental_update.py --once
# or as a background daemon
python graphrag_agent/integrations/build/incremental_update.py --daemonTest the agents from the terminal
The test scripts query the agents with and without streaming; comment out agents you do not want to run to keep it fast.
cd graph-rag-agent/test
python search_without_stream.py
python search_with_stream.pyRun the backend and frontend
Start the FastAPI server, then the Streamlit app, and pick an agent in the sidebar.
cd graph-rag-agent/
python server/main.py
# in another terminal
cd graph-rag-agent/
streamlit run frontend/app.py
Commands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Build a question-answering assistant over an internal rulebook or document set where answers depend on relationships between entities, not just similar text chunks
- Compare naive vector RAG, graph search, hybrid search and DeepSearch-style multi-step agents side by side on the same knowledge base
- Inspect how a graph-RAG answer was produced, with the execution trace, matched sub-graph and source passages visible in debug mode

- Evaluate a GraphRAG pipeline with ready-made metrics for answer quality, retrieval, graph quality and deep research
How graph-rag-agent compares
graph-rag-agent alongside other open-source rag frameworks & platforms tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| Dify | ★ 162k | An open-source platform with a visual workflow builder for creating LLM and RAG applications without writing much code. |
| graphify | ★ 155k | Turns a folder of code, docs, PDFs and images into a local knowledge graph with tree-sitter AST parsing and Leiden communities — queryable by agents over MCP, no vector store. |
| RAGFlow | ★ 95k | A RAG engine built around deep document understanding that turns complex files into a grounded, citation-backed question-answering layer. |
| Context7 | ★ 65.7k | Context7 pulls current, version-specific documentation and code examples for any library and feeds them into your LLM, available as a CLI skill or an MCP server. |
| Pathway | ★ 61.9k | A Python framework with a Rust streaming engine that keeps ETL, real-time analytics and RAG pipelines continuously up to date as source data changes. |
| LightRAG | ★ 41k | A graph-based RAG system that builds an entity-and-relationship knowledge graph for fast retrieval and easy incremental updates. |
| PageIndex | ★ 40.8k | PageIndex turns long PDFs into a table-of-contents tree and uses LLM reasoning to retrieve relevant sections, with no vector database and no chunking. |
| graph-rag-agent | ★ 2.4k | A Neo4j knowledge-graph Q&A system that fuses GraphRAG, LightRAG-style search and DeepSearch reasoning agents |
