From bfcb95af452afdfe43adc7e5f1d7647205b221d1 Mon Sep 17 00:00:00 2001 From: Cole Medin Date: Mon, 26 May 2025 13:04:41 -0500 Subject: [PATCH] Added Neo4j (Knowledge Graph Engine) to the Local AI Package --- .env.example | 12 +++++++++++- .gitignore | 8 ++++++++ Caddyfile | 5 +++++ README.md | 10 +++++++++- docker-compose.yml | 15 +++++++++++++++ 5 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.env.example b/.env.example index 9d6f6d7..9f06359 100644 --- a/.env.example +++ b/.env.example @@ -31,6 +31,15 @@ DASHBOARD_USERNAME=supabase DASHBOARD_PASSWORD=this_password_is_insecure_and_should_be_updated POOLER_TENANT_ID=your-tenant-id +############ +# [required] +# Neo4j username and password +# Replace "neo4j" with your chosen username and "password" with your chosen password. +# Keep the "/" as a separator between the two. +############ + +NEO4J_AUTH=neo4j/password + ############ # [required] # Langfuse credentials @@ -65,6 +74,7 @@ ENCRYPTION_KEY=generate-with-openssl # generate via `openssl rand -hex 32` # LANGFUSE_HOSTNAME=langfuse.yourdomain.com # OLLAMA_HOSTNAME=ollama.yourdomain.com # SEARXNG_HOSTNAME=searxng.yourdomain.com +# NEO4J_HOSTNAME=neo4j.yourdomain.com # LETSENCRYPT_EMAIL=internal @@ -147,7 +157,7 @@ MAILER_URLPATHS_EMAIL_CHANGE="/auth/v1/verify" ## Email auth ENABLE_EMAIL_SIGNUP=true -ENABLE_EMAIL_AUTOCONFIRM=false +ENABLE_EMAIL_AUTOCONFIRM=true SMTP_ADMIN_EMAIL=admin@example.com SMTP_HOST=supabase-mail SMTP_PORT=2500 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..84afa14 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +.env +volumes/ +shared/ +neo4j/ +shared-backup/ +.env.test +searxng/settings.yml +searxng/uwsgi* \ No newline at end of file diff --git a/Caddyfile b/Caddyfile index 462757e..eccec61 100644 --- a/Caddyfile +++ b/Caddyfile @@ -35,6 +35,11 @@ reverse_proxy localhost:8000 } +# Neo4j +{$NEO4J_HOSTNAME} { + reverse_proxy localhost:7474 +} + # SearXNG {$SEARXNG_HOSTNAME} { encode zstd gzip diff --git a/README.md b/README.md index bbf43d0..8f5f9a3 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ quickly bootstraps a fully featured Local AI and Low Code development environment including Ollama for your local LLMs, Open WebUI for an interface to chat with your N8N agents, and Supabase for your database, vector store, and authentication. -This is Cole's version with a couple of improvements and the addition of Supabase, Open WebUI, Flowise, Langfuse, SearXNG, and Caddy! +This is Cole's version with a couple of improvements and the addition of Supabase, Open WebUI, Flowise, Neo4j, Langfuse, SearXNG, and Caddy! Also, the local RAG AI Agent workflows from the video will be automatically in your n8n instance if you use this setup instead of the base one provided by n8n! @@ -45,6 +45,8 @@ builder that pairs very well with n8n store with an comprehensive API. Even though you can use Supabase for RAG, this was kept unlike Postgres since it's faster than Supabase so sometimes is the better option. +✅ [**Neo4j**](https://neo4j.com/) - Knowledge graph engine that powers tools like GraphRAG, LightRAG, and Graphiti + ✅ [**SearXNG**](https://searxng.org/) - Open source, free internet metasearch engine which aggregates results from up to 229 search services. Users are neither tracked nor profiled, hence the fit with the local AI package. @@ -90,6 +92,11 @@ Before running the services, you need to set up your environment variables for S DASHBOARD_PASSWORD= POOLER_TENANT_ID= + ############ + # Neo4j Secrets + ############ + NEO4J_AUTH= + ############ # Langfuse credentials ############ @@ -116,6 +123,7 @@ Before running the services, you need to set up your environment variables for S SUPABASE_HOSTNAME=:supabase.yourdomain.com OLLAMA_HOSTNAME=:ollama.yourdomain.com SEARXNG_HOSTNAME=searxng.yourdomain.com + NEO4J_HOSTNAME=neo4j.yourdomain.com LETSENCRYPT_EMAIL=your-email-address ``` diff --git a/docker-compose.yml b/docker-compose.yml index 0eebf3e..ee05621 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -115,6 +115,20 @@ services: volumes: - qdrant_storage:/qdrant/storage + neo4j: + image: neo4j:latest + volumes: + - ./neo4j/logs:/logs + - ./neo4j/config:/config + - ./neo4j/data:/data + - ./neo4j/plugins:/plugins + environment: + - NEO4J_AUTH=${NEO4J_AUTH:-"neo4j/your_password"} + ports: + - 7474:7474 + - 7687:7687 + restart: always + caddy: container_name: caddy image: docker.io/library/caddy:2-alpine @@ -132,6 +146,7 @@ services: - SUPABASE_HOSTNAME=${SUPABASE_HOSTNAME:-":8005"} - SEARXNG_HOSTNAME=${SEARXNG_HOSTNAME:-":8006"} - LANGFUSE_HOSTNAME=${LANGFUSE_HOSTNAME:-":8007"} + - NEO4J_HOSTNAME=${NEO4J_HOSTNAME:-":8008"} - LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL:-internal} cap_drop: - ALL