How meghashyam0711/rag works
GraphRAG Reader is an MCP document-retrieval server. An MCP client submits documents for layout-aware parsing, chunking, entity extraction and resolution, then the engine indexes chunks and graph relations. For questions, the server runs hybrid retrieval inside a self-corrective workflow that grades evidence, retries or abstains, and verifies cited answers; it also exposes graph tracing, table extraction and index status. The README documents these capabilities and major integrations; several subsystem details are unsampled, so their internal links are omitted.
Main entry points: engine.py GraphRAG Engine · hybrid.py Hybrid Retrieval · nodes.py RAG Nodes · qdrant_store.py Vector Index
Components 20
MCP Interface
- MCP Entrypoint
mcp_server.py - MCP Tools
src/graphrag/server.py - GraphRAG Engine
src/graphrag/engine.py
Document Ingestion
- Layout Parser
src/graphrag/ingestion/layout_parser.py - Contextual Chunker
src/graphrag/ingestion/chunker.py - Graph Extractor
src/graphrag/ingestion/graph_extractor.py - Entity Resolver
src/graphrag/ingestion/entity_resolver.py
Indexes and Retrieval
- Text Embeddings
src/graphrag/indexing/embeddings.py - Vector Index
src/graphrag/indexing/qdrant_store.py - Knowledge Graph
src/graphrag/indexing/graph_store.py - Hybrid Retrieval
src/graphrag/retrieval/hybrid.py - Evidence Reranker
src/graphrag/retrieval/reranker.py
Verified Answers
- RAG Workflow
src/graphrag/agent/workflow.py - Workflow State
src/graphrag/agent/state.py - RAG Nodes
src/graphrag/agent/nodes.py - Math Sandbox
src/graphrag/agent/sandbox.py - Optional LLM
src/graphrag/llm.py
Shared Runtime
- Domain Models
src/graphrag/models.py - Runtime Settings
src/graphrag/config.py
Other components
- MCP Client
Connections 24
- MCP Client → MCP Entrypoint: invokes tools
README.md - MCP Entrypoint → MCP Tools: starts server
mcp_server.py - MCP Tools → GraphRAG Engine: dispatches requests
README.md - GraphRAG Engine → Layout Parser: parses documents
src/graphrag/engine.py - GraphRAG Engine → Contextual Chunker: chunks blocks
src/graphrag/engine.py - GraphRAG Engine → Graph Extractor: extracts relations
README.md - GraphRAG Engine → Entity Resolver: canonicalizes entities
src/graphrag/engine.py - GraphRAG Engine → Vector Index: upserts chunks
src/graphrag/engine.py - GraphRAG Engine → Knowledge Graph: upserts graph
src/graphrag/engine.py - GraphRAG Engine → RAG Workflow: runs questions
src/graphrag/engine.py - GraphRAG Engine → Hybrid Retrieval: retrieves evidence
README.md - GraphRAG Engine → Knowledge Graph: traces relations
README.md - GraphRAG Engine → Vector Index: extracts tables
README.md - GraphRAG Engine → Runtime Settings: uses settings
src/graphrag/engine.py - Hybrid Retrieval → Vector Index: searches vectors
README.md - Hybrid Retrieval → Knowledge Graph: traverses graph
README.md - Hybrid Retrieval → Entity Resolver: links mentions
src/graphrag/retrieval/hybrid.py - Hybrid Retrieval → Evidence Reranker: reranks evidence
src/graphrag/retrieval/hybrid.py - Vector Index → Text Embeddings: encodes text
src/graphrag/indexing/qdrant_store.py - RAG Workflow → RAG Nodes: dispatches steps
src/graphrag/agent/workflow.py - RAG Workflow → Workflow State: carries state
src/graphrag/agent/workflow.py - RAG Nodes → Hybrid Retrieval: retrieves evidence
src/graphrag/agent/nodes.py - RAG Nodes → Math Sandbox: checks calculations
src/graphrag/agent/nodes.py - RAG Nodes → Optional LLM: uses optional model
src/graphrag/agent/nodes.py