GraphRAG - RAG com Grafos de Conhecimento
aghoshpro/GraphRAG
RAG baseado em grafos de conhecimento com melhor contextualização e custo-efetividade
Ver no GitHubSistema de Recuperação Aumentada por Geração (RAG) que constrói grafos de conhecimento a partir de texto bruto, organiza entidades em hierarquias comunitárias e gera resumos para consultas mais precisas. Combina grafos estruturados com LLMs para respostas mais contextualizadas e escaláveis que RAG vetorial tradicional.
Instalação
npx convez-ai aghoshpro/GraphRAG1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
Casos de uso
- Extração de temas principais em grandes datasets
- Sistemas de perguntas e respostas sobre documentos relacionados
- Análise de relações entre entidades em corpus textuais
- RAG empresarial com recuperação semanticamente estruturada
Veredito

Implementação robusta de GraphRAG com Neo4j e LangChain, demonstrando ganhos reais sobre RAG vetorial tradicional. Bem documentada com exemplos práticos, ideal para quem busca ir além de embeddings simples em sistemas de IA generativa.
README
A tradução para o português deste README ainda está na fila.
Knowledge Graph RAG
Knowledge Graph RAG is a special type of RAG system that combines the benefits of knowledge graphs with large language models (LLMs). In GraphRAG, the knowledge graph serves as an organised data structure of factual information, while the LLM functions as a reasoning engine, processing user questions, obtaining appropriate knowledge from the graph, and delivering logical responses.
Recent scientific research [1, 2] reveals that GraphRAG outperforms vector store-powered traditional RAG systems with more accurate responses in a cost effective and scalable way.
Consider the following scenario to demonstrate GraphRAG's effectiveness: both a traditional RAG and GraphRAG are charged with identifying the top five themes in a dataset. The baseline RAG struggled to retrieve unrelated text and represent the essential themes accurately. In contrast, GraphRAG provided a concise and meaningful response, identifying the main ideas and supporting them with source material references.
Traditional RAG vs GraphRAG
traditional RAG treats each document as an isolated unit, while graph RAG captures the relationships between entities mentioned in the documents. This structural understanding enables more sophisticated querying and better answers.
- Source: Collab
Environment Setup
1. Clone Repository
-
Create a working directory and navigate to it:
cd GraphRAG -
Open
cmdorterminalto clone repositorygit clone https://github.com/aghoshpro/GraphRAG.git
2. Setup Local Environment
-
Create a virtual environment
myvenvinside the./GraphRAGfolder and activate it:python -m venv myvenv# Windows .\myvenv\Scripts\activate # OR source myvenv/bin/activate (in Linux or Mac) -
Install dependencies:
pip install --upgrade -r requirements.txt
3. Start Neo4J Docker
docker compose up
🕹️ Run
streamlit run app.py
- Select
llama3.2as the model and start chatting.
🧪 OR Experiment with code if you want
jupyter notebook