█

AI/TLDR

मुझे पिलाएं कॉफ़ी
मुझे एक कॉफ़ी पिलाएँ

graph-rag-agent

Neo4j पर चलने वाला knowledge-graph Q&A सिस्टम, जो GraphRAG, LightRAG-style search और DeepSearch reasoning agents को एक साथ जोड़ता है

RAG Frameworks & Platformsओपन सोर्स
भाषा
Python
लाइसेंस
MIT
संक्षेप में

graph-rag-agent क्या है?

graph-rag-agent Neo4j पर चलने वाला knowledge-graph Q&A सिस्टम, जो GraphRAG, LightRAG-style search और DeepSearch reasoning agents को एक साथ जोड़ता है. यह Retrieval & Knowledge (RAG) टूल्स की RAG Frameworks & Platforms श्रेणी में आता है; ओपन सोर्स है, Python में लिखा गया है और MIT लाइसेंस के तहत है।

सारांश

graph-rag-agent एक ओपन सोर्स Python प्रोजेक्ट है, जो GraphRAG को private-domain DeepSearch के साथ मिलाकर आपके अपने documents पर एक explainable question-answering सिस्टम बनाता है। यह GraphRAG के मूल विचारों को शुरू से दोबारा implement करता है और Microsoft GraphRAG, Neo4j के llm-graph-builder, LightRAG तथा Zilliz के deep-searcher से प्रेरणा लेता है: एक LLM आपकी फ़ाइलों से entities और relationships निकालता है, नतीजे को Neo4j में knowledge graph के रूप में सेव किया जाता है, और agents का एक सेट उस graph में खोजकर सवालों के जवाब देता है।

यह प्रोजेक्ट सिर्फ़ library के रूप में नहीं, बल्कि पूरे stack के रूप में आता है। एक graph-building pipeline TXT, PDF, Markdown, DOCX, DOC, CSV, JSON और YAML फ़ाइलें लेती है, community detection (Leiden या SLLPA) चलाती है और summaries बनाती है, तथा entity disambiguation और alignment के साथ incremental updates को सपोर्ट करती है। एक FastAPI backend कई agents की सेवा करता है, और एक Streamlit frontend streamed answers, reasoning trace, matched sub-graph और debug mode में source text दिखाता है।

The graph-rag-agent Streamlit app in debug mode, with a hybrid_agent answer on the left and the knowledge sub-graph used for that answer on the right.
Debug mode shows the answer beside the part of the knowledge graph it was drawn from.graph-rag-agent README ↗

यह उन developers के लिए है जो end to end graph-based RAG को समझना या deploy करना चाहते हैं, जिसमें evaluation भी शामिल है: बिल्ट-इन evaluation framework answer quality, retrieval performance, graph quality और deep-research नतीजों को 20 से ज़्यादा metrics से मापता है। README चीनी भाषा में लिखा है और इसका सैंपल knowledge base विश्वविद्यालय के छात्र-प्रबंधन नियमों का सेट है, जिसे आप अपनी फ़ाइलों और entity/relationship schema से बदल देते हैं।

यह क्या करता है

  • Neo4j में knowledge graph का निर्माण, TXT, PDF, MD, DOCX, DOC, CSV, JSON और YAML फ़ाइलों से LLM-आधारित entity और relationship extraction के साथ
  • Incremental graph updates (एक बार या background daemon के रूप में) के साथ entity disambiguation, entity alignment और बिल्ट-इन consistency checks
  • Leiden या SLLPA algorithm से community detection, साथ ही global search के लिए बनाए गए community summaries
  • कई agents: NaiveRagAgent (vector retrieval), GraphAgent, HybridAgent, DeepResearchAgent और FusionGraphRAGAgent, जिनमें से आख़िरी एक Plan-Execute-Report multi-agent architecture पर बना है, जो tasks की योजना बनाता है, retrieval, research और reflection workers चलाता है, और लंबी reports लिखता है
The knowledge-graph reasoning tab finding a relationship path between two entities and drawing it as a small graph.
Graph reasoning: find the one- or two-hop path between two entities.graph-rag-agent README ↗
  • Local, global और hybrid graph search, graph पर Chain of Exploration, evidence-chain tracking और दिखने वाली thinking process
  • FastAPI backend, streamed responses के साथ, और debug mode वाला Streamlit frontend, जिसमें interactive Neo4j-style graph view और entity-path reasoning है, साथ ही 20+ metrics वाला evaluation system

शुरू करें

ये steps प्रोजेक्ट की quick-start guide (assets/start.md) पर आधारित हैं। Neo4j के लिए Docker, Python 3.10 और एक OpenAI-compatible API endpoint चाहिए; guide सुझाती है कि requests को One-API या New-API gateway से रूट करें।

Neo4j शुरू करें

रिपॉज़िटरी में Neo4j के लिए Docker Compose फ़ाइल शामिल है। डिफ़ॉल्ट credentials हैं neo4j / 12345678।

bashbash
cd graph-rag-agent/
docker compose up -d

Python environment बनाएँ

Dependencies को Python 3.10 environment में इंस्टॉल करें, फिर package को editable mode में इंस्टॉल करें।

bashbash
conda create -n graphrag python==3.10
conda activate graphrag
cd graph-rag-agent/
pip install -r requirements.txt
pip install -e .

.env कॉन्फ़िगर करें

.env.example को प्रोजेक्ट root में .env नाम से कॉपी करें और कम से कम model और Neo4j settings भरें। Base URL आपके OpenAI-compatible gateway की तरफ़ इशारा करता है। Entity types, relationship types और graph theme अलग से 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'

Knowledge graph बनाएँ

अपने source documents files/ फ़ोल्डर में रखें, फिर full build चलाएँ। Incremental script बाद में जुड़ी और हटाई गई फ़ाइलों को लागू करती है, एक बार या daemon के रूप में।

bashbash
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 --daemon

Terminal से agents टेस्ट करें

टेस्ट scripts agents से streaming के साथ और उसके बिना queries करती हैं; जिन agents को नहीं चलाना चाहते उन्हें comment out करें ताकि यह तेज़ रहे।

bashbash
cd graph-rag-agent/test
python search_without_stream.py
python search_with_stream.py

Backend और frontend चलाएँ

FastAPI server शुरू करें, फिर Streamlit app, और sidebar में कोई agent चुनें।

bashbash
cd graph-rag-agent/
python server/main.py

# in another terminal
cd graph-rag-agent/
streamlit run frontend/app.py
The graph-rag-agent chat interface outside debug mode, with an agent picker in the sidebar and a structured streamed answer.
The chat view with the agent picker and example questions in the sidebar.graph-rag-agent README ↗

कमांड और कोड प्रोजेक्ट के अपने दस्तावेज़ों से लिए गए हैं — हमेशा जांचें आधिकारिक repo ताज़ा जानकारी के लिए।

कब इस्तेमाल करें

  • किसी internal rulebook या documents के सेट पर सवाल-जवाब assistant बनाएँ, जहाँ जवाब सिर्फ़ मिलते-जुलते text chunks पर नहीं, बल्कि entities के बीच के relationships पर निर्भर करते हैं
  • एक ही knowledge base पर naive vector RAG, graph search, hybrid search और DeepSearch-style multi-step agents की तुलना साथ-साथ करें
  • देखें कि graph-RAG जवाब कैसे बना, debug mode में execution trace, matched sub-graph और source passages दिखाई देते हैं
The debug panel's source-content tab showing the original document passage behind an answer.
The source-content tab traces an answer back to the original document text.graph-rag-agent README ↗
  • GraphRAG pipeline का मूल्यांकन तैयार metrics से करें: answer quality, retrieval, graph quality और 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.

टूलस्टारयह क्या करता है
Dify★ 162kLLM और RAG ऐप विज़ुअल कैनवास पर बनाने के लिए ओपन सोर्स प्लेटफ़ॉर्म
graphify★ 156kकोड, डॉक्स, PDF और इमेज वाले फ़ोल्डर को एक ऐसे नॉलेज ग्राफ़ में बदलें जिसमें query की जा सके
RAGFlow★ 95.1kगहरी डॉक्यूमेंट समझ और स्रोत से जुड़े, ट्रेस किए जा सकने वाले उद्धरणों वाला ओपन सोर्स RAG engine
Context7★ 65.8kनवीनतम, वर्ज़न-विशिष्ट लाइब्रेरी डॉक्स सीधे आपके कोडिंग एजेंट के प्रॉम्प्ट में
Pathway★ 61.9kडेटा बदलने के साथ-साथ अपडेट रहने वाली Python ETL और RAG पाइपलाइन
LightRAG★ 41kग्राफ़-आधारित RAG, जो आपके दस्तावेज़ों को क्वेरी योग्य नॉलेज ग्राफ़ में बदल देता है
PageIndex★ 40.9kVectorless, reasoning-based RAG जो लंबे डॉक्युमेंट से tree index बनाता है
graph-rag-agent★ 2.4kNeo4j पर चलने वाला knowledge-graph Q&A सिस्टम, जो GraphRAG, LightRAG-style search और DeepSearch reasoning agents को एक साथ जोड़ता है