--- id: neo4j-graphrag version: "1.18.0" license: Apache License, Version 2.0 license_treatment: permissive maintenance: active --- # neo4j-graphrag — Python package to allow easy integration to Neo4j's GraphRAG features License: permissive · Maintenance: active · Downloads: 440.0K/mo ## What it is and what it does Neo4j GraphRAG is a first-party Python library from Neo4j that bridges language models and graph databases to build retrieval-augmented generation systems. It provides two main workflows: constructing knowledge graphs from text or PDFs using LLM-driven entity and relationship extraction, and retrieving relevant graph data to augment LLM prompts for question-answering and reasoning tasks. The package wraps Neo4j's graph database with high-level abstractions—SimpleKGPipeline for streamlined knowledge graph building, Pipeline for advanced customization, and multiple retriever strategies (vector search, text-to-Cypher, hybrid traversal). It integrates with LLM providers (OpenAI, Anthropic, Cohere, Bedrock, etc.) and optional embeddings backends (sentence-transformers, Weaviate, Pinecone, Qdrant). Core dependencies include pydantic for schema validation, tenacity for retry logic, and utilities like pypdf and json-repair for data handling. Use it for: - Build a knowledge graph from unstructured documents, then use it to answer domain-specific questions with LLM-grounded retrieval. - Implement hybrid search combining vector similarity with graph traversal to find contextually relevant entities and their relationships. - Extract structured facts (entities, relationships, patterns) from PDFs or text using LLM-guided pipelines without manual annotation. - Create a text-to-Cypher retriever that translates natural language queries into graph database queries for precise, schema-aware retrieval. - Augment LLM responses with real-time graph data to reduce hallucination and ground answers in a curated knowledge base. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Builds graph retrieval-augmented generation (GraphRAG) applications by integrating Neo4j graph databases with LLM-powered knowledge extraction and retrieval pipelines. Yes, if you have a Neo4j instance and need to build RAG applications grounded in structured knowledge graphs. The package is actively maintained, has no known vulnerabilities, and offers a permissive license. Install with caution if you rely on spaCy-based NLP features on Python 3.14 (currently unsupported upstream); otherwise, low friction and well-suited for production use. ## Install pip install neo4j-graphrag uv add neo4j-graphrag poetry add neo4j-graphrag ## Installing neo4j-graphrag Before you install: Low friction: pure Python wheel with no compiled dependencies. Active maintenance with recent releases; last commit 2026-08-13. Requires Neo4j instance and at least one LLM provider extra (openai, anthropic, etc.) to function for RAG tasks. License in practice: Apache License 2.0 (permissive): you can use, modify, and distribute this package freely in commercial and open-source projects, provided you include a copy of the license and state material changes. Quickstart: pip install 'neo4j-graphrag[openai]' from neo4j import GraphDatabase from neo4j_graphrag.embeddings import OpenAIEmbeddings from neo4j_graphrag.experimental.pipeline.kg_builder import SimpleKGPipeline from neo4j_graphrag.llm import OpenAILLM driver = GraphDatabase.driver('neo4j://localhost:7687', auth=('neo4j', 'password')) embedder = OpenAIEmbeddings(model='text-embedding-3-large') llm = OpenAILLM(model_name='gpt-4') kg_builder = SimpleKGPipeline(llm=llm, driver=driver, embedder=embedder, schema={...}) await kg_builder.run_async(text='your text here') Requires a running Neo4j instance (local or remote). APOC core library must be installed in Neo4j for knowledge graph construction. At least one LLM provider extra must be installed (e.g., openai, anthropic). Python 3.10–3.13 recommended; Python 3.14 support limited due to upstream spaCy issue. Verify before relying: - Whether the package's experimental KG builder features are production-ready or intended for development/testing only - Performance characteristics when working with large knowledge graphs or high-volume retrieval queries - Whether APOC library installation in Neo4j is required for all features or only specific ones ## Package facts - License: Apache License, Version 2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 440.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags graph retrieval augmented generation, neo4j rag integration, knowledge graph construction python, llm graph database, semantic graph retrieval, neo4j graphrag, knowledge extraction pipeline, knowledge-graphs, rag, neo4j [View on SkillFed](https://skillfed.io/packages/neo4j-graphrag) · [View on PyPI](https://pypi.org/project/neo4j-graphrag/)