How plishh/relt-graphrag works
GraphRAG transforms unstructured private text into structured graph-based context for question answering. The principal workflow loads documents, builds and enriches an index, then uses query APIs to retrieve context and generate answers; incremental indexing and prompt tuning are additional capabilities. The sampled pipeline runner shows storage, cache, and workflow orchestration, while README and the tree establish broader product stages. Several indexing-stage links are dashed because their runtime wiring was not sampled.
Main entry points: run_pipeline.py Pipeline runner · graphrag_llm LLM runtime · main.py CLI commands · extract_graph Graph extraction
Components 23
User entry points
- CLI commands
packages/graphrag/graphrag/cli/main.py - Public APIs
packages/graphrag/graphrag/api/index.py - Prompt tuning
packages/graphrag/graphrag/prompt_tune
Index construction
- Document readers
packages/graphrag-input/graphrag_input - Text chunking
packages/graphrag-chunking/graphrag_chunking - Graph extraction
packages/graphrag/graphrag/index/operations/extract_graph - Claim extraction
packages/graphrag/graphrag/index/operations/extract_covariates - Community detection
packages/graphrag/graphrag/index/operations/cluster_graph.py - Community reports
packages/graphrag/graphrag/index/operations/summarize_communities - Text embeddings
packages/graphrag/graphrag/index/operations/embed_text - Incremental indexing
packages/graphrag/graphrag/index/update/incremental_index.py - Pipeline runner
packages/graphrag/graphrag/index/run/run_pipeline.py
Question answering
- Query API
packages/graphrag/graphrag/api/query.py - Search strategies
packages/graphrag/graphrag/query - Vector stores
packages/graphrag-vectors/graphrag_vectors
Runtime services
- Storage backends
packages/graphrag-storage/graphrag_storage - Table providers
packages/graphrag-storage/graphrag_storage/tables/table_provider_factory.py - Cache backends
packages/graphrag-cache/graphrag_cache/cache.py - LLM runtime
packages/graphrag-llm/graphrag_llm - Template engine
packages/graphrag-llm/graphrag_llm/templating/template_engine_factory.py
Other components
- User
- LLM provider
- Search result
Connections 24
- User → CLI commands: runs commands
packages/graphrag/graphrag/cli/main.py - CLI commands → Public APIs: dispatches to
packages/graphrag/graphrag/cli/main.py - User → Public APIs: submits query
- User → Prompt tuning: tunes prompts
README.md - Public APIs → Pipeline runner: starts indexing
- Pipeline runner → Storage backends: creates and reads
packages/graphrag/graphrag/index/run/run_pipeline.py - Pipeline runner → Table providers: creates providers
packages/graphrag/graphrag/index/run/run_pipeline.py - Pipeline runner → Cache backends: creates cache
packages/graphrag/graphrag/index/run/run_pipeline.py - Pipeline runner → Document readers: runs workflows
packages/graphrag/graphrag/index/run/run_pipeline.py - Document readers → Text chunking: provides documents
- Text chunking → Graph extraction: provides text units
- Graph extraction → Claim extraction: extracts claims
- Graph extraction → Community detection: builds graph
- Community detection → Community reports: summarizes groups
- Pipeline runner → Text embeddings: runs workflow
- Pipeline runner → Incremental indexing: supports updates
packages/graphrag/graphrag/index/run/run_pipeline.py - CLI commands → Query API: dispatches queries
- Query API → Search strategies: selects search
packages/graphrag/graphrag/api/query.py - Query API → Search result: returns result
packages/graphrag/graphrag/api/query.py - Search strategies → Vector stores: uses vector search
- Search strategies → LLM runtime: generates response
- LLM runtime → LLM provider: calls provider
- LLM runtime → Cache backends: caches calls
packages/graphrag-llm/graphrag_llm/middleware/with_middleware_pipeline.py - LLM runtime → Template engine: uses templates
packages/graphrag-llm/graphrag_llm/templating/template_engine_factory.py