How sushruth3002/graph-rag works
Graph RAG ingests documents, builds a knowledge graph and vector index, then answers user questions through query understanding, retrieval, context assembly, and LLM generation. The README documents the major pipeline stages and retrieval modes; the sampled source confirms the query/retrieval relationship and embedding backends. Some pipeline wiring is documented rather than visible in the excerpts, so edges for those stages reflect README-described data flow.
Main entry points: main.py Pipeline Runner · graph_embeddings.py Graph Embeddings · retrieval_engine.py Retrieval Engine · answer_generator.py Answer Generation
Components 21
Document Processing
- Data Ingestion
src/data_ingestion.py - Chunking
src/chunking.py - Entity Extraction
src/entity_extraction.py - Relationship Extraction
src/relationship_extraction.py
Knowledge Indexing
- Graph Builder
src/graph_builder.py - Graph Embeddings
src/graph_embeddings.py
Question Answering
- Pipeline Runner
main.py - Query Processor
src/query_processor.py - Retrieval Engine
src/retrieval_engine.py - Context Assembly
src/context_assembler.py - Answer Generation
src/answer_generator.py
Storage
- Vector Store
src/vector_store.py - Redis Vectors
src/redis_vectorstore.py - Neo4j Store
src/neo4j_store.py - Hybrid Graph Store
src/hybrid_graph_store.py
Model Services
- Embedding Client
src/embeddings_client.py
Other components
- Questioner
- Source Documents
- LLM Service
- Embedding Backend
- Cited Answer
Connections 27
- Source Documents → Pipeline Runner: provides files
- Pipeline Runner → Data Ingestion: loads documents
- Data Ingestion → Chunking: document text
- Chunking → Entity Extraction: text chunks
- Entity Extraction → Relationship Extraction: extracted entities
- Relationship Extraction → Graph Builder: extracted relationships
- Graph Builder → Neo4j Store: persists graph
- Pipeline Runner → Graph Embeddings: indexes graph
- Graph Embeddings → Neo4j Store: reads graph
- Graph Embeddings → Embedding Client: creates vectors
- Embedding Client → Embedding Backend: requests embeddings
- Graph Embeddings → Vector Store: indexes vectors
- Graph Embeddings → Redis Vectors: indexes vectors
- Questioner → Pipeline Runner: asks question
- Pipeline Runner → Query Processor: submits query
- Pipeline Runner → Retrieval Engine: requests results
- Retrieval Engine → Query Processor: parses query
- Retrieval Engine → Hybrid Graph Store: searches vectors
- Retrieval Engine → Neo4j Store: traverses graph
- Hybrid Graph Store → Vector Store: searches vectors
- Hybrid Graph Store → Redis Vectors: searches vectors
- Retrieval Engine → Context Assembly: retrieval results
- Pipeline Runner → Context Assembly: assembles context
- Pipeline Runner → Answer Generation: requests answer
- Answer Generation → LLM Service: generates response
- Answer Generation → Cited Answer: returns cited answer
- Pipeline Runner → Questioner: presents answer