langchain-neo4j
An integration package connecting Neo4j and LangChain
What it is and what it does
langchain-neo4j bridges Neo4j graph databases and LangChain's LLM framework, providing high-level abstractions for common patterns. It includes Neo4jGraph for direct Cypher queries, Neo4jChatMessageHistory for persisting conversations, Neo4jVector for semantic search over documents, and GraphCypherQAChain for translating natural language questions into Cypher queries. It also offers Neo4jSaver and AsyncNeo4jSaver as checkpoint backends for LangGraph workflows, and LLMGraphTransformer to extract knowledge graphs from unstructured text.
The package is designed for developers building AI applications that need to store, query, or reason over structured knowledge in a graph. Its main dependencies are langchain-core, langgraph, neo4j, and neo4j-graphrag—all part of the LangChain ecosystem. Installation is straightforward, but you must have a Neo4j instance running and accessible over the network.
Use it for:
- Build a chatbot that recalls conversation history from Neo4j across sessions.
- Translate natural language questions into Cypher queries and retrieve graph data via an LLM.
- Store and search document embeddings in Neo4j for semantic similarity retrieval.
- Extract entities and relationships from unstructured text and populate a Neo4j knowledge graph.
- Persist LangGraph agent state and checkpoints in Neo4j for fault tolerance and replay.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Integrates Neo4j graph databases with LangChain, providing wrappers for querying graphs, storing chat history, managing vector stores, and building knowledge graphs from text using LLMs.
Yes, if you are building LangChain applications that need to integrate Neo4j. The package is actively maintained, has low install friction, carries no known vulnerabilities, and provides well-documented abstractions for common graph-LLM patterns. Install only if you have a Neo4j instance available and a use case that benefits from graph storage or reasoning.
Install
langchain-neo4j on PyPI
pip
pip install langchain-neo4juv
uv add langchain-neo4jpoetry
poetry add langchain-neo4jInstalling langchain-neo4j
Before you install
Low friction install with a pure Python wheel. Active maintenance with recent releases; last commit 2026-08-10. Depends on langchain-core, langgraph, neo4j, and neo4j-graphrag, which are established LangChain ecosystem packages.
License in practice
MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions.
Quickstart
pip install langchain-neo4j
from langchain_neo4j import Neo4jGraph
graph = Neo4jGraph(url="bolt://localhost:7687", username="neo4j", password="password")
result = graph.query("MATCH (n) RETURN n LIMIT 1;")
Requires a running Neo4j instance accessible at the specified URL; Python 3.10 or later.
Verify before relying
- Whether Neo4jVector requires external embedding models (e.g., OpenAI) or supports local embeddings.
- Performance characteristics when storing large chat histories or vector indexes in Neo4j.
- Compatibility with Neo4j versions older than the driver's minimum requirement.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<3.15,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — langchain-classic, langchain-core, langgraph, neo4j-graphrag, neo4j |
| Maintenance | actively maintained — 65 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 252,731/month — #8,535 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: langchain_neo4j-0.10.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
neo4j-graphragBuilds graph retrieval-augmented generation…
permissive · top 15,000 on PyPI
graphlibProvides a Python API for creating,…
permissive · top 15,000 on PyPI
ragstack-ai-knowledge-storeStores and retrieves LangChain documents using…
unclear · top 15,000 on PyPI
neomodelAn Object Graph Mapper (OGM) for Neo4j that…
permissive · top 15,000 on PyPI
langchain-postgresProvides LangChain abstractions for vector…
permissive · top 5,000 on PyPI
braintrust-langchainProvides a LangChain callback handler to log…
permissive · top 5,000 on PyPI
langchain-azure-aiIntegrates Microsoft Foundry (Azure AI)…
permissive · top 5,000 on PyPI
langgraph-checkpointProvides the base interface and serialization…
permissive · top 1,000 on PyPI
langchain-graph-retrieverRetrieves documents from a graph structure…
permissive · top 15,000 on PyPI
py2neo-historyProvides access to archived versions of the…
permissive · top 15,000 on PyPI