neo4j-graphrag
Python package to allow easy integration to Neo4j's GraphRAG features
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 on this page — 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
neo4j-graphrag on PyPI
pip
pip install neo4j-graphraguv
uv add neo4j-graphragpoetry
poetry add neo4j-graphragInstalling 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 the current Python release (<3.15,>=3.10.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 10 — fsspec, json-repair, neo4j, numpy, pydantic, pypdf, pyyaml, scipy, tenacity, types-pyyaml |
| Maintenance | actively maintained — 51 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 440,023/month — #6,649 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: neo4j_graphrag-1.18.0-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
graphdatascienceA Python client for Neo4j Graph Data Science…
permissive · top 15,000 on PyPI
graphragGraphRAG extracts structured knowledge graphs…
permissive · top 15,000 on PyPI
langchain-neo4jIntegrates Neo4j graph databases with…
permissive · top 15,000 on PyPI
neomodelAn Object Graph Mapper (OGM) for Neo4j that…
permissive · top 15,000 on PyPI
graph-retrieverCombines vector similarity search with graph…
permissive · top 15,000 on PyPI
ragstack-ai-knowledge-storeStores and retrieves LangChain documents using…
unclear · top 15,000 on PyPI
graphlibProvides a Python API for creating,…
permissive · top 15,000 on PyPI
lightrag-hkuLightRAG is a retrieval-augmented generation…
permissive · top 15,000 on PyPI
graphiti-coreGraphiti builds and queries temporal context…
permissive · top 5,000 on PyPI
neo4j-driverPython driver for connecting to and querying…
permissive · top 15,000 on PyPI