$npx -y skills add neo4j-contrib/neo4j-skills --skill neo4j-graphrag-skillBuild GraphRAG retrieval pipelines on Neo4j using the neo4j-graphrag Python
| 1 | # Neo4j GraphRAG Skill |
| 2 | |
| 3 | ## When to Use |
| 4 | |
| 5 | - Building GraphRAG retrieval pipelines with `neo4j-graphrag` Python package |
| 6 | - Choosing between VectorRetriever, HybridRetriever, VectorCypherRetriever, HybridCypherRetriever |
| 7 | - Writing `retrieval_query` Cypher fragments for graph-augmented context |
| 8 | - Wiring retriever + LLM into a `GraphRAG` pipeline |
| 9 | - Using LLM-routed multi-retriever with `ToolsRetriever` |
| 10 | - Debugging low retrieval quality |
| 11 | - Integrating Neo4j with LangChain, LlamaIndex, or Haystack |
| 12 | |
| 13 | ## When NOT to Use |
| 14 | |
| 15 | - **KG construction from documents** → `neo4j-document-import-skill` |
| 16 | - **Plain vector/semantic search without graph traversal** → `neo4j-vector-index-skill` |
| 17 | - **Hybrid search that combines vector with fulltext or other ranked sources** → `neo4j-vector-index-skill` |
| 18 | - **GDS algorithms (PageRank, Louvain, node embeddings)** → `neo4j-gds-skill` |
| 19 | - **Agent long-term memory** → `neo4j-agent-memory-skill` |
| 20 | - **Writing raw Cypher queries** → `neo4j-cypher-skill` |
| 21 | |
| 22 | --- |
| 23 | |
| 24 | ## Retriever Selection |
| 25 | |
| 26 | ``` |
| 27 | Has fulltext index? |
| 28 | YES → Hybrid variants (HybridRetriever / HybridCypherRetriever) |
| 29 | NO → Vector variants (VectorRetriever / VectorCypherRetriever) |
| 30 | |
| 31 | Need graph traversal after vector lookup? |
| 32 | YES → Cypher variants (VectorCypherRetriever / HybridCypherRetriever) |
| 33 | NO → plain variants |
| 34 | |
| 35 | Natural-language-to-Cypher? → Text2CypherRetriever (no embedder needed) |
| 36 | LLM should route between retrievers? → ToolsRetriever |
| 37 | Vectors stored in external DB? → WeaviateNeo4jRetriever / PineconeNeo4jRetriever / QdrantNeo4jRetriever |
| 38 | ``` |
| 39 | |
| 40 | | Retriever | Vector | Fulltext | Graph | Best For | |
| 41 | |---|:---:|:---:|:---:|---| |
| 42 | | `VectorRetriever` | ✓ | — | — | Baseline semantic search | |
| 43 | | `HybridRetriever` | ✓ | ✓ | — | Better recall, no graph expansion | |
| 44 | | `VectorCypherRetriever` | ✓ | — | ✓ | GraphRAG without fulltext | |
| 45 | | `HybridCypherRetriever` | ✓ | ✓ | ✓ | **Production GraphRAG — default** | |
| 46 | | `Text2CypherRetriever` | — | — | ✓ | NL→Cypher, no embedder | |
| 47 | | `ToolsRetriever` | varies | varies | varies | LLM-routed multi-retriever | |
| 48 | | `WeaviateNeo4jRetriever` | ✓ | — | ✓ | Vectors in Weaviate | |
| 49 | | `PineconeNeo4jRetriever` | ✓ | — | ✓ | Vectors in Pinecone | |
| 50 | | `QdrantNeo4jRetriever` | ✓ | — | ✓ | Vectors in Qdrant | |
| 51 | |
| 52 | --- |
| 53 | |
| 54 | ## Install |
| 55 | |
| 56 | ```bash |
| 57 | pip install neo4j-graphrag[openai] # OpenAI LLM + embeddings |
| 58 | pip install neo4j-graphrag[anthropic] # Anthropic Claude |
| 59 | pip install neo4j-graphrag[google] # Vertex AI / Gemini |
| 60 | pip install neo4j-graphrag[bedrock] # Amazon Bedrock (boto3) |
| 61 | pip install neo4j-graphrag[cohere] # Cohere |
| 62 | pip install neo4j-graphrag[mistralai] # MistralAI |
| 63 | pip install neo4j-graphrag[ollama] # Ollama (local) |
| 64 | pip install neo4j-graphrag[weaviate] # Weaviate external retriever |
| 65 | pip install neo4j-graphrag[pinecone] # Pinecone external retriever |
| 66 | pip install neo4j-graphrag[qdrant] # Qdrant external retriever |
| 67 | ``` |
| 68 | |
| 69 | Requires: Python >= 3.10, `neo4j >= 5.17.0` (driver 6.x supported). |
| 70 | |
| 71 | --- |
| 72 | |
| 73 | ## Step 2 — Choose Retriever |
| 74 | |
| 75 | ``` |
| 76 | Has fulltext index? YES → Hybrid variants (better recall) |
| 77 | NO → Vector variants (baseline) |
| 78 | |
| 79 | Needs graph context after vector lookup? YES → Cypher variants |
| 80 | NO → plain variants |
| 81 | |
| 82 | For natural-language-to-Cypher? → Text2CypherRetriever (no embedder needed) |
| 83 | For multi-tool LLM routing? → ToolsRetriever |
| 84 | Using external vector DB? → WeaviateNeo4jRetriever / PineconeNeo4jRetriever / QdrantNeo4jRetriever |
| 85 | ``` |
| 86 | |
| 87 | | Retriever | Vector | Fulltext | Graph | When to use | |
| 88 | |---|:---:|:---:|:---:|---| |
| 89 | | `VectorRetriever` | ✓ | — | — | Baseline; quick start | |
| 90 | | `HybridRetriever` | ✓ | ✓ | — | Better recall; no graph context | |
| 91 | | `VectorCypherRetriever` | ✓ | — | ✓ | GraphRAG without fulltext | |
| 92 | | `HybridCypherRetriever` | ✓ | ✓ | ✓ | **Production GraphRAG — default choice** | |
| 93 | | `Text2CypherRetriever` | — | — | ✓ | LLM generates Cypher; no embedder | |
| 94 | | `ToolsRetriever` | varies | varies | varies | Multi-retriever LLM routing | |
| 95 | |
| 96 | For custom Cypher hybrid |