Examples of my tutorial on how to use Neo4j for empowering AI RAG systems
Last updated Jul 2, 2026
78
Stars
38
Forks
0
Issues
0
Stars/day
Attention Score
55
Topics
Language breakdown
JavaScript 73.8%
Cypher 19.5%
Shell 6.7%
โธ Files
click to expand
README
Neo4j AI-Powered Query System
Overview
This project integrates Neo4j with AI models to generate Cypher queries from natural language prompts. It utilizes local AI models for natural language processing and a vector database approach for efficient querying.
This is the source code shown on my video tutorial, consider watching it first!
Folder Structure
.
โโโ README.md # Project documentation
โโโ data # Database-related files
โย ย โโโ courses.json # Course data
โย ย โโโ seed.js # Database seeding script
โโโ docker-compose.yml # Configuration for running Neo4j
โโโ other-examples # Additional use cases
โย ย โโโ neo4j-vector.js # Example using vector search in Neo4j
โย ย โโโ rag # Retrieval-Augmented Generation example
โย ย โโโ data # Sample data for RAG
โย ย โย ย โโโ javascript.txt # Text data for queries
โย ย โโโ index.js # Implementation for RAG
โย ย โโโ package-lock.json # Dependency lock file
โย ย โโโ package.json # Dependencies
โโโ package-lock.json # Dependency lock file
โโโ package.json # Project dependencies
โโโ prompts # AI-related prompts
โย ย โโโ context.md # Context prompt template
โย ย โโโ nlpToCypher.md # NLP to Cypher prompt template
โย ย โโโ responseTemplateFromJson.md # Response formatting template
โโโ references.txt # Related documentation/references
โโโ request.sh # Script for testing caching mechanism
โโโ script.txt # Miscellaneous script
โโโ src # Source code
โโโ ai.js # AI model interaction logic
โโโ index.js # Main application entry point
Setup Instructions
Prerequisites
Ensure you have the following installed:Installation Steps
- Start Ollama
ollama serve
- Download AI models
ollama pull gemma:7b
ollama pull deepseek-coder:6.7b
- Start Neo4j
docker-compose up -d
- Install dependencies
npm ci
- Seed the database
npm run seed
- Run the application
npm run dev
- Test caching mechanism (Run twice to observe caching behavior)
sh request.sh
Features
- AI-powered natural language to Cypher query conversion
- Neo4j integration with vector search capabilities
- RAG (Retrieval-Augmented Generation) example included
- Database seeding for reproducible testing
- Dockerized Neo4j instance
Usage
Once the application is running, you can send natural language queries to the AI, which will convert them into optimized Cypher queries for Neo4j. The system caches responses for better performance on repeated queries.Contributing
Feel free to open issues and submit PRs for enhancements!License
MIT License๐ More in this category