Graph RAG — build knowledge graphs for multi-hop reasoning
Extract entities and relationships from documents into a knowledge graph, then traverse connections to answer questions that span multiple sources.
RAG4.4

Prompt template
Extract entities and relationships from the following text. Return as JSON with entities (name, type, description) and relationships (source, target, relation, confidence).
Text: {document_chunk}
Extracted knowledge:How to use
- 1Chunk documents and run an LLM extraction pass to identify entities and typed relationships
- 2Load extracted triples into a graph database (Neo4j) with entity resolution and deduplication
- 3At query time, identify key entities in the user question and match them to graph nodes
- 4Traverse 1-3 hop neighborhoods around matched entities to collect connected subgraphs
- 5Optionally combine graph traversal results with vector retrieval for hybrid graph+vector RAG
- 6Format the subgraph as context and pass to the LLM with citation to source nodes
Pro tips
- Use entity linking (e.g. spaCy + Wikidata) to merge duplicate entities across documents
- Graph RAG shines for questions like 'who are the competitors of X's suppliers?' that need multi-hop joins
- Store source document references as properties on edges for traceable citations
- Community detection (Leiden) on the graph can auto-generate hierarchical summaries
Works best with
neo4jlangchainllamaindexnetworkx
RAGKnowledge GraphGraph DatabaseMulti-hopNeo4j
Ratings & Reviews
Loading reviews…
Related Skills

RAG
Hybrid RAG — combine keyword and semantic search for maximum recall
Fuse BM25 sparse retrieval with dense vector embeddings so exact-term matches and conceptual meaning both surface in results.
RAGHybrid SearchBM25
4.6
RAG
Multi-Modal RAG — retrieve and ground across text, images, and tables
Index documents with embedded images, charts, and tables using vision-language models so answers cite visual evidence, not just text.
RAGMulti-ModalVision
4.5
Prompting
RAG Prompting — retrieval-augmented generation for grounded answers
Combine retrieved context with targeted prompts so the AI answers from your documents instead of hallucinating.
RAGRetrievalGrounding
4.5