Neo4jVectorStore features and configurations, see the API reference.
Overview
Integration details
| Class | Package | PY support | Downloads | Version |
|---|---|---|---|---|
Neo4jVectorStore | @langchain/neo4j | ✅ |
Setup
Install@langchain/neo4j, the MongoDB-compatible neo4j-driver, @langchain/core, and an embeddings provider (this guide uses OpenAI embeddings):
Setup a Neo4j self hosted instance with docker-compose
Neo4j provides a prebuilt Docker image that can be used to quickly setup a self-hosted Neo4j database instance.
Create a file below named docker-compose.yml:
docker-compose.yml
docker compose up to start the container.
You can find more information on how to setup Neo4j on their website.
Usage
Use retrievalQuery parameter to customize responses
Instantiate Neo4jVectorStore from existing graph
Metadata filtering
Security
Make sure that the database connection uses credentials that are narrowly-scoped to only include necessary permissions. Failure to do so may result in data corruption or loss, since the calling code may attempt commands that would result in deletion, mutation of data if appropriately prompted or reading sensitive data if such data is present in the database. The best way to guard against such negative outcomes is to (as appropriate) limit the permissions granted to the credentials used with this tool. For example, creating read only users for the database is a good way to ensure that the calling code cannot mutate or delete data.API reference
For detailed documentation of allNeo4jVectorStore features and configurations, see the API reference.
Related
- Vector store conceptual guide
- Vector store how-to guides
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

