{
  "name": "Supabase + Postgres Tutorial",
  "nodes": [
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.1,
      "position": [
        780,
        -60
      ],
      "id": "5282b4d9-669f-43b9-ac4f-312438300f5f",
      "name": "When chat message received",
      "webhookId": "679e356b-fcc3-4abc-ab59-8ca4ce2cc616"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        840,
        180
      ],
      "id": "05dcf427-078d-4b0f-bfad-f55694a1f6dc",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "id": "ULctv1aW08WV7LUC",
          "name": "OpenAi account 4"
        }
      }
    },
    {
      "parameters": {
        "mode": "retrieve-as-tool",
        "toolName": "voiceFramework",
        "toolDescription": "Use this to get information about the AI Voice Agent Framework",
        "tableName": {
          "__rl": true,
          "value": "documents",
          "mode": "list",
          "cachedResultName": "documents"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "typeVersion": 1,
      "position": [
        1140,
        180
      ],
      "id": "903ce2ad-4e75-4923-81b2-12405af568dd",
      "name": "Supabase Vector Store",
      "credentials": {
        "supabaseApi": {
          "id": "jUld8zuAwewDdTsi",
          "name": "Supabase account 2"
        }
      }
    },
    {
      "parameters": {
        "options": {
          "systemMessage": "You are a helpful assistant"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.7,
      "position": [
        1000,
        -60
      ],
      "id": "f3a3e4af-5350-45c3-a541-5a54d3719835",
      "name": "RAG Agent"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "typeVersion": 1.2,
      "position": [
        1200,
        340
      ],
      "id": "afdbbc6b-509f-4a27-a5cd-c79782109dfc",
      "name": "Embeddings",
      "credentials": {
        "openAiApi": {
          "id": "ULctv1aW08WV7LUC",
          "name": "OpenAi account 4"
        }
      }
    },
    {
      "parameters": {
        "content": "# RAG Agent with Long-term Memory\n",
        "height": 660,
        "width": 1140,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        -180
      ],
      "typeVersion": 1,
      "id": "5915fc4b-593c-448c-a452-f1f736a42c67",
      "name": "Sticky Note1"
    },
    {
      "parameters": {},
      "type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
      "typeVersion": 1.3,
      "position": [
        1000,
        180
      ],
      "id": "8c03b6f4-d146-477b-ac5b-9057d22b2089",
      "name": "Postgres Chat Memory",
      "credentials": {
        "postgres": {
          "id": "GyTcQ1PJFx3rvJ0Y",
          "name": "Tutorial"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "typeVersion": 1.2,
      "position": [
        2380,
        160
      ],
      "id": "fa04040a-5709-4fa0-a5d3-80a54d83c15c",
      "name": "Embeddings OpenAI",
      "credentials": {
        "openAiApi": {
          "id": "ULctv1aW08WV7LUC",
          "name": "OpenAi account 4"
        }
      }
    },
    {
      "parameters": {
        "dataType": "binary",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "typeVersion": 1,
      "position": [
        2580,
        160
      ],
      "id": "b114a7af-5a17-42df-8b2a-b63921ee82ed",
      "name": "Default Data Loader"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "typeVersion": 1,
      "position": [
        2680,
        380
      ],
      "id": "92e4307e-25a9-485a-a29b-4453936575bc",
      "name": "Recursive Character Text Splitter"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        1980,
        -60
      ],
      "id": "7ec04508-1dca-4efa-ba02-874576461296",
      "name": "When clicking ‘Test workflow’"
    },
    {
      "parameters": {
        "operation": "download",
        "fileId": {
          "__rl": true,
          "value": "1ofE5b-0qWaMHQngkdYGYL1ieH0nCc_nRM-lQSnjy0qk",
          "mode": "list",
          "cachedResultName": "AI Voice Agent Prompt Fraemwork",
          "cachedResultUrl": "https://docs.google.com/document/d/1ofE5b-0qWaMHQngkdYGYL1ieH0nCc_nRM-lQSnjy0qk/edit?usp=drivesdk"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        2220,
        -60
      ],
      "id": "8bfe6cc3-c76f-44e1-ba53-16a16b076e57",
      "name": "Download File",
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "WwJf6x4DkHV3hPuf",
          "name": "Google Drive account"
        }
      }
    },
    {
      "parameters": {
        "content": "# Loading Data / Documents from Google Drive",
        "height": 760,
        "width": 1140,
        "color": 5
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1840,
        -180
      ],
      "typeVersion": 1,
      "id": "48bcaa52-e66c-4d97-a0b7-b5b863f26d58",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "mode": "insert",
        "tableName": {
          "__rl": true,
          "value": "documents",
          "mode": "list",
          "cachedResultName": "documents"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "typeVersion": 1,
      "position": [
        2440,
        -60
      ],
      "id": "578b19d4-bf27-4b87-837c-89f41ab38b13",
      "name": "Add to Supabase Table",
      "credentials": {
        "supabaseApi": {
          "id": "jUld8zuAwewDdTsi",
          "name": "Supabase account 2"
        }
      }
    }
  ],
  "pinData": {},
  "connections": {
    "When chat message received": {
      "main": [
        [
          {
            "node": "RAG Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "RAG Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Supabase Vector Store": {
      "ai_tool": [
        [
          {
            "node": "RAG Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings": {
      "ai_embedding": [
        [
          {
            "node": "Supabase Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Postgres Chat Memory": {
      "ai_memory": [
        [
          {
            "node": "RAG Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Add to Supabase Table",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Add to Supabase Table",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Recursive Character Text Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "Download File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download File": {
      "main": [
        [
          {
            "node": "Add to Supabase Table",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "b09ae7b8-bb42-4f15-9d6f-0013c08b00ea",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "ae59e6b831344dba624c99cbe778a4bc47150f8e64de86a8011d15bac8e58c21"
  },
  "id": "QTTq1aB6jvuAcN04",
  "tags": []
}