The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"name": "Advanced AI Inventory Agent: Supabase Vector RAG & Gemini",
"nodes": [
{
"parameters": {
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"typeVersion": 1.4,
"position": [
0,
208
],
"id": "c3c12d7e-d89e-49a7-b2d1-ab1bc8f4e218",
"name": "When chat message received"
},
{
"parameters": {
"options": {
"systemMessage": "You are an expert Hardware Sales Specialist. Your goal is to help users find the right equipment from our inventory.\n\nINSTRUCTIONS:\n1. ALWAYS use the 'inventory_search' tool when a user asks about products, prices, or availability.\n2. If a user asks for a category (e.g., \"What monitors do you have?\"), use the tool to find items in that category.\n3. Handle technical specifics accurately. If a user mentions a specific model like 'ASUS NUC 15 Pro+' or 'Keychron Q6 Max', ensure you provide the exact details found in the tool.\n4. Use conversation memory to handle follow-up questions. If the user asks \"How much is it?\" or \"Is it in stock?\", refer to the last item you both discussed.\n5. Provide the Price first in your response. Only mention the exact stock/quantity if the user explicitly asks about availability.\n6. If an item is not found, check for similar items in the same category or suggest the user checks the spelling.\n\nTONE:\nProfessional, helpful, and technically knowledgeable."
}
},
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 3.1,
"position": [
224,
208
],
"id": "e932a115-9926-49d8-8148-4ed5cc2a86c7",
"name": "AI Agent"
},
{
"parameters": {},
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"typeVersion": 1.3,
"position": [
288,
432
],
"id": "52be1132-2d61-4b0f-8b5f-893dba6b049c",
"name": "Simple Memory"
},
{
"parameters": {
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"typeVersion": 1,
"position": [
160,
432
],
"id": "b341e229-7292-4cb3-90fa-633aa4945a0f",
"name": "Google Gemini",
"credentials": {
"googlePalmApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"content": "## Advanced AI Inventory Agent: Supabase Vector RAG & Gemini\n\nThis workflow upgrades your AI agent from [simple sheet reading](https://n8nplaybook.com/post/2026/02/simple-n8n-inventory-ai-agent/) to high-performance Vector RAG. It allows your assistant to search through thousands of items with lightning speed and high accuracy.\n\n### Purpose:\n\nTo provide a scalable, professional-grade retrieval system for hardware inventory. It uses \"semantic search\" to find products even when the user makes typos or uses different terminology.\n\n### Setup Instructions:\n\n1. **Supabase:** Run the provided SQL to create the documents table and the match_documents function.\n2. **Credentials:** Connect your Supabase (Service Role Key) and Google Gemini API credentials.\n3. **Sync Workflow:** Run the \"Path A\" workflow to index your Google Sheets data into the vector database.\n4. **Chat Workflow:** Use the \"Path B\" workflow as your production chat interface.\n5. **Prompt:** Customize the System Prompt to define your brand's specific tone and sales rules.\n\n\n**Ideal for:** Large product catalogs (100+ items), technical hardware inventories, and high-traffic customer support bots.\n\nTo learn more about how to build and optimize this workflow, read the full blog post [here](https://n8nplaybook.com/post/2026/02/scaling-n8n-inventory-ai-agent-supabase-vector-rag/).",
"height": 720,
"width": 624
},
"type": "n8n-nodes-base.stickyNote",
"position": [
-704,
-192
],
"typeVersion": 1,
"id": "df1a1310-25bc-43a4-b080-612d9af17d8d",
"name": "Sticky Note"
},
{
"parameters": {},
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [
0,
-192
],
"id": "198c02f9-9ad9-42f1-9f22-aa74fbdf9df7",
"name": "When clicking \u2018Execute workflow\u2019"
},
{
"parameters": {
"authentication": "serviceAccount",
"documentId": {
"__rl": true,
"value": "1wvnyqtsrlwZwpZG9GpBhmc1S0n_bH4jcXE5paMdXaxc",
"mode": "list",
"cachedResultName": "Hardware Pricelist",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1wvnyqtsrlwZwpZG9GpBhmc1S0n_bH4jcXE5paMdXaxc/edit?usp=drivesdk"
},
"sheetName": {
"__rl": true,
"value": "gid=0",
"mode": "list",
"cachedResultName": "Sheet1",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1wvnyqtsrlwZwpZG9GpBhmc1S0n_bH4jcXE5paMdXaxc/edit#gid=0"
},
"options": {}
},
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.7,
"position": [
224,
-192
],
"id": "67a47a39-af47-4a5f-8d78-fb470cd784ea",
"name": "Get row(s) in sheet",
"credentials": {
"googleApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"mode": "insert",
"tableName": {
"__rl": true,
"value": "documents",
"mode": "list",
"cachedResultName": "documents"
},
"options": {
"queryName": "match_documents"
}
},
"type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
"typeVersion": 1.3,
"position": [
448,
-192
],
"id": "5377a222-5a0c-42a4-8537-6f01099d69f1",
"name": "Supabase Vector Store",
"credentials": {
"supabaseApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"jsonMode": "expressionData",
"jsonData": "=Category: {{ $json.Category }}, Product: {{ $json.Name }}, Price: {{ $json.Price }}",
"options": {
"metadata": {
"metadataValues": [
{
"name": "sku",
"value": "={{ $json.SKU }}"
},
{
"name": "quantity",
"value": "={{ $json.Quantity }}"
},
{
"name": "category",
"value": "={{ $json.Category }}"
}
]
}
}
},
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
"typeVersion": 1.1,
"position": [
592,
32
],
"id": "f25b751c-579f-4490-9538-b36aefc1540a",
"name": "Default Data Loader"
},
{
"parameters": {
"modelName": "models/gemini-embedding-001"
},
"type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
"typeVersion": 1,
"position": [
416,
32
],
"id": "693593fb-8d4e-4599-afc9-f6cc5082e525",
"name": "Embeddings Google Gemini",
"credentials": {
"googlePalmApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"mode": "retrieve-as-tool",
"toolDescription": "Use this tool to find information about computer hardware inventory, including categories, prices, and technical specifications.",
"tableName": {
"__rl": true,
"value": "documents",
"mode": "list",
"cachedResultName": "documents"
},
"options": {
"queryName": "match_documents"
}
},
"type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
"typeVersion": 1.3,
"position": [
416,
432
],
"id": "e1c1f6a6-a002-4e68-a9c7-924e2d56cf93",
"name": "Supabase Vector Store1",
"credentials": {
"supabaseApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"modelName": "models/gemini-embedding-001"
},
"type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
"typeVersion": 1,
"position": [
496,
640
],
"id": "33013f32-160c-42d4-bbea-b58ffa44b94c",
"name": "Embeddings Google Gemini1",
"credentials": {
"googlePalmApi": {
"name": "<your credential>"
}
}
}
],
"connections": {
"When chat message received": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"Simple Memory": {
"ai_memory": [
[
{
"node": "AI Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"Google Gemini": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"When clicking \u2018Execute workflow\u2019": {
"main": [
[
{
"node": "Get row(s) in sheet",
"type": "main",
"index": 0
}
]
]
},
"Get row(s) in sheet": {
"main": [
[
{
"node": "Supabase Vector Store",
"type": "main",
"index": 0
}
]
]
},
"Default Data Loader": {
"ai_document": [
[
{
"node": "Supabase Vector Store",
"type": "ai_document",
"index": 0
}
]
]
},
"Embeddings Google Gemini": {
"ai_embedding": [
[
{
"node": "Supabase Vector Store",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Supabase Vector Store1": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Embeddings Google Gemini1": {
"ai_embedding": [
[
{
"node": "Supabase Vector Store1",
"type": "ai_embedding",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1",
"availableInMCP": false
},
"versionId": "bbacf9bd-28eb-4869-a693-ac8a3a4eff47",
"meta": {
"templateCredsSetupCompleted": true
},
"id": "5sqvpKzyghHm3pvh",
"tags": []
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
googleApigooglePalmApisupabaseApi
About this workflow
Advanced AI Inventory Agent: Supabase Vector RAG & Gemini. Uses chatTrigger, agent, memoryBufferWindow, lmChatGoogleGemini. Chat trigger; 12 nodes.
Source: https://github.com/vklepikovskiy/n8nplaybook-public/blob/main/workflows/advanced_ai_inventory_agent.json — original creator credit. Request a take-down →