This repo contains Neo4j custom nodes. It includes the node linter and other dependencies.
To make this custom node available to the community, you must create it as an npm package, and submit it to the npm registry.
It also contains a Docker Compose file to initialize a comprehensive self-hosted local AI and low-code development environment. It leverages:
- Ollama: a Cross-platform LLM platform to install and run the latest local LLMs
- SQLite: to store internal n8n data, such as Workflow definitions, credentials, user accounts, settings, etc..
If you want to use a local n8n instance, you can install this node (see here for more info) and import the workflows placed in self-hosted-starter/n8n/demo-data/workflows/, by executing:
n8n import:workflow --separate --input=<workflow-path>
You can use this node to interact with the Neo4j vector properties.
You can insert documents into Neo4j vector properties, get documents from a vector properties, retrieve documents to provide them to a retriever connected to a chain, or connect directly to an agent as a tool.
See here for more details
You can use the Neo4j Chat Memory node to use Neo4j as a memory server for storing chat history.
See here for more details
You can use these credentials to authenticate the above nodes. See here for more details
You need the following installed on your development machine:
- git
- Node.js and pnpm. Minimum version Node 20. You can find instructions on how to install both using nvm (Node Version Manager) for Linux, Mac, and WSL here. For Windows users, refer to Microsoft's guide to Install NodeJS on Windows.
- Use the docker compose file OR install n8n globally with:
npm install n8n -g. - Recommended: follow n8n's guide to set up your development environment.
These are the basic steps for working with the starter. For detailed guidance on creating and publishing nodes, refer to the documentation.
- Clone the repo:
git clone https://github.com/vga91/n8n-neo4j-nodes.git - Run
npm ito install dependencies. - Run
rm -r dist & npm run build & npm linkto build the project. - (Optional) Test your node using the docker-compose file or locally. Refer to Run your node locally for guidance.
- Possibly, if you start ollama locally, e.g. with
ollama serve, run thedocker-compose upcommand. Check the Ollama homepage for installation instructions. 5a. Otherwise, execute thestarter.shscript, possibly modifying it or follows the below sections. - After that the Docker Compose images are up, go to Quick start and usage section.
docker compose --profile gpu-nvidia up
Note
If you have not used your Nvidia GPU with Docker before, please follow the Ollama Docker instructions.
docker compose --profile gpu-amd up
If you’re using a Mac with an M1 or newer processor, you can't expose your GPU to the Docker instance, unfortunately. There are two options in this case:
- Run the starter kit fully on CPU, like in the section "For everyone else" below
- Run Ollama on your Mac for faster inference, and connect to that from the n8n instance
If you want to run Ollama on your mac, check the Ollama homepage for installation instructions, and run the starter kit as follows:
docker compose up
If you're running OLLAMA locally on your Mac (not in Docker), you need to modify the OLLAMA_HOST environment variable in the n8n service configuration. Update the x-n8n section in your Docker Compose file as follows:
x-n8n: &service-n8n
# ... other configurations ...
environment:
# ... other environment variables ...
- OLLAMA_HOST=host.docker.internal:11434Additionally, after you see "Editor is now accessible via: http://localhost:5678/":
- Head to http://localhost:5678/home/credentials
- Click on "Local Ollama service"
- Change the base URL to "http://host.docker.internal:11434/"
git clone https://github.com/n8n-io/self-hosted-ai-starter-kit.git
cd self-hosted-ai-starter-kit
docker compose --profile cpu up
The core of the Self-hosted AI Starter Kit is a Docker Compose file, pre-configured with network and storage settings, minimizing the need for additional installations. After completing the installation steps above, simply follow the steps below to get started.
-
Open http://localhost:5678/ in your browser to set up n8n. You’ll only have to do this once. Log in with user name: "giuseppe.villani@larus-ba.it" and password "Qwerty12345".
-
Open the 1st included workflow: http://localhost:5678/workflow/adYVK8YgDDszqcEh
a. If needed, click the 3 dots button on the "Neo4j Vector Store Save" button, select "Open" and change the "Credential to connect with" using
Bolt URL,User Name,Databaseandpasswordrespectivelybolt://neo4j:7687,neo4j,neo4jandpassword1234b. If this is the first time you’re running the workflow and you run Ollama dockerized, you may need to wait until Ollama finishes downloading it. You can inspect the docker console logs to check on the progress. If needed, click the "Embeddings Ollama" 3 dots button and change the credentials (if running it locally, with
http://host.docker.internal:11434/) and the "Model" useda. Click the Test workflow button at the bottom of the canvas, to start running the workflow.
b. Click the Chat button at the bottom of the canvas and type a message, e.g. 'What are the company's sick leave policies?'
-
Open the 2nd included workflow: http://localhost:5678/workflow/FPkRbwf9zJLYZUuc
a. Click the Test workflow button
b. If needed, click the "Embeddings Ollama" 3 dots button and change the credentials (if running it locally, with
http://host.docker.internal:11434/) and the "Model" usedc. Click the Chat button at the bottom of the canvas and type a message, e.g. 'italiano'
To open n8n at any time, visit http://localhost:5678/ in your browser.
With your n8n instance, you’ll have access to over 400 integrations and a suite of basic and advanced AI nodes such as AI Agent, Text classifier, and Information Extractor nodes. To keep everything local, just remember to use the Ollama node for your language model and Qdrant as your vector store.
docker compose --profile gpu-nvidia pull
docker compose create && docker compose --profile gpu-nvidia updocker compose pull
docker compose create && docker compose up
docker compose --profile cpu pull
docker compose create && docker compose --profile cpu upn8n is full of useful content for getting started quickly with its AI concepts and nodes. If you run into an issue, go to support.
- AI agents for developers: from theory to practice with n8n
- Tutorial: Build an AI workflow in n8n
- Langchain Concepts in n8n
- Demonstration of key differences between agents and chains
- What are vector databases?
For more AI workflow ideas, visit the official n8n AI template gallery. From each workflow, select the Use workflow button to automatically import the workflow into your local n8n instance.
- AI Agent Chat
- AI chat with any data source (using the n8n workflow too)
- Chat with OpenAI Assistant (by adding a memory)
- Use an open-source LLM (via Hugging Face)
- Chat with PDF docs using AI (quoting sources)
- AI agent that can scrape webpages
Refer to our documentation on creating nodes for detailed information on building your own nodes.
