It’s finally here – knowledge graphs in n8n with the Graphiti MCP server! So many of you have been asking for me to include knowledge graphs in the RAG template I’ve been building on my channel so I finally got around to making it happen. It wasn’t trivial to find the easiest way to do this with n8n so I hope you appreciate it!
Knowledge graphs help you agent search through the relationships you have in your data – something traditional RAG with vector databases fails at quite often. And the best part is we aren’t scrapping our previous strategies – knowledge graphs are added on top to make our agent even more of a beast.
See the bottom of the description for the steps to copy and paste that I cover in the video.
~~~~~~~~~~~~~~~~~~~~~~~~~
– If you’re looking to join a community for early AI adopters all mastering AI agents and transforming their careers and businesses together, check out Dynamous: https://dynamous.ai
~~~~~~~~~~~~~~~~~~~~~~~~~
– Here is the n8n knowledge graph template on GitHub!
https://github.com/coleam00/ottomator-agents/tree/main/n8n_knowledge_graph_rag
– n8n RAG Agent template playlist:
https://www.youtube.com/playlist?list=PLyrg3m7Ei-Mo1t_H9KHoeqXkg0pnfkX-S
– Graphiti MCP Setup Guide:
https://help.getzep.com/graphiti/getting-started/mcp-server
– n8n MCP community node:
https://www.npmjs.com/package/n8n-nodes-mcp
– n8n installation on DigitalOcean guide:
https://docs.n8n.io/hosting/installation/server-setups/digital-ocean/
~~~~~~~~~~~~~~~~~~~~~~~~~
Graphiti MCP Configuration Steps for You to Copy and Paste:
### Step 1: Add host mapping to n8n docker-compose.yml
“`yaml
services:
n8n:
# … existing config …
extra_hosts:
– “host.docker.internal:host-gateway”
“`
### Step 2: Restart n8n
“`bash
sudo docker compose down
sudo docker compose up -d
“`
### Step 3: Find your n8n container name
“`bash
sudo docker ps | grep n8n
“`
### Step 4: Get n8n container’s network info
“`bash
# Go into n8n container
sudo docker exec -it [your-n8n-container-name] /bin/sh
# Check the network gateway IP
ip route | grep default
“`
### Step 5: Configure firewall for that network range
“`bash
# Exit the container first, then on host:
sudo ufw allow from [network-range] to any port 8000
# Example: if gateway was 172.18.0.1, use:
sudo ufw allow from 172.18.0.0/16 to any port 8000
“`
### Step 6: Use in n8n
URL: `http://host.docker.internal:8000/sse`
~~~~~~~~~~~~~~~~~~~~~~~~~
00:00 – Introducing n8n + Knowledge Graphs with Graphiti
00:24 – What do Knowledge Graphs Give Us?
03:25 – Demo of Our Agentic RAG System with KGs
04:42 – What I’ve Added to the Template for KGs
05:46 – Graphiti MCP Server Setup Guide
13:12 – Setting Up the Graphiti MCP in n8n
17:22 – RAG Pipeline + KG Demo
~~~~~~~~~~~~~~~~~~~~~~~~~
Join me as I push the limits of what is possible with AI. I’ll be uploading videos every week – Wednesdays at 7:00 PM CDT!
source
