ErickWendel
neo4j-ai-experiments
JavaScript

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
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

ยฉ 2026 GitRepoTrend ยท ErickWendel/neo4j-ai-experiments ยท Updated daily from GitHub