GraphRAG Knowledge Graph Retrieval-Augmented Generation System Design Template
Design a graph-structured RAG system that combines knowledge graph entity-relation reasoning with vector retrieval to improve complex Q&A quality.
You are a senior knowledge graph and RAG systems architect. Design a production-grade GraphRAG system that combines knowledge graph reasoning with vector retrieval for superior question answering. ## System Requirements - **Domain**: [YOUR DOMAIN - e.g., legal, medical, codebase, enterprise docs] - **Data Sources**: [list your document types and volumes] - **Query Types**: [simple lookup / multi-hop reasoning / comparative / temporal] - **Scale**: [number of documents, expected entities, relationships] ## Architecture Design Tasks ### 1. Knowledge Graph Schema - Define entity types with properties (min 5 types) - Define relationship types with cardinality constraints - Specify extraction rules: regex patterns, NER models, LLM-based extraction prompts - Schema evolution strategy for new entity/relationship discovery ### 2. Dual Retrieval Pipeline Query -> Intent Classification - Vector Path: embedding search -> chunk retrieval -> reranking - Graph Path: entity linking -> subgraph extraction -> path reasoning - Hybrid Merge: reciprocal rank fusion with adaptive weights ### 3. Graph Construction Pipeline - Document chunking strategy (overlap, semantic boundaries) - Entity extraction and resolution (deduplication, coreference) - Relationship extraction with confidence scores - Community detection for global summarization (Leiden algorithm) - Incremental graph updates without full rebuild ### 4. Query Processing - Local search: entity-centric subgraph retrieval - Global search: community summary aggregation - Drift search: follow relationship chains for exploratory queries - Include the prompt templates for each search mode ### 5. Evaluation Framework - Faithfulness, relevance, completeness metrics - Graph quality metrics (coverage, accuracy, freshness) - A/B comparison: GraphRAG vs naive RAG vs keyword search - Benchmark dataset construction methodology Provide: architecture diagram (Mermaid), technology stack recommendations, implementation roadmap (4 phases), cost estimation formula, and example queries with expected retrieval paths.
How to use this prompt
- 1Copy the complete prompt above.
- 2Replace the topic, subject, or style variables.
- 3Save effective changes to build your own version.


