{
  "name": "Build a knowledge base chatbot with Jotform, RAG Supabase, Together AI & Gemini",
  "nodes": [
    {
      "id": "1c57da69-7af2-47c8-8bc2-92e49449bd81",
      "name": "Splitting into Chunks",
      "type": "n8n-nodes-base.code",
      "position": [
        2192,
        -496
      ]
    },
    {
      "id": "d5ed1aaf-6089-4731-980d-b5c356b22403",
      "name": "Embedding Uploaded document",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2416,
        -496
      ]
    },
    {
      "id": "0b1c609f-e335-4541-8dae-e3517ec4bb63",
      "name": "Save the embedding in DB",
      "type": "n8n-nodes-base.supabase",
      "position": [
        2624,
        -496
      ]
    },
    {
      "id": "3a39d174-434e-4c81-921c-8a354fad5ebe",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        2064,
        64
      ]
    },
    {
      "id": "4ce2ab5b-bb1e-46ce-9dd8-2cfdee5510a2",
      "name": "Search Embeddings",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1840,
        64
      ]
    },
    {
      "id": "76c8df3f-cf64-4848-b077-d04e9de88d12",
      "name": "Embend User Message",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1616,
        64
      ]
    },
    {
      "id": "d8dba80c-597e-470b-852b-6d53363238bc",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        2272,
        288
      ]
    },
    {
      "id": "f74c0006-15e0-4f48-8c02-b0b765154c5b",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2272,
        64
      ]
    },
    {
      "id": "81c63733-c5c8-4a4d-b634-e3d93d9bb1c6",
      "name": "Extract Text from PDF File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        2000,
        -496
      ]
    },
    {
      "id": "490c541e-fae8-4965-9840-9e13d562acdd",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        1392,
        64
      ]
    },
    {
      "id": "8add4f5e-d2f8-4ea8-a6e1-6d4912d60393",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1296,
        -768
      ],
      "parameters": {
        "width": 1584,
        "height": 512,
        "content": "### Part 1: Feeding the AI Knowledge (The \"Librarian\" part)\n\nThis part of the workflow runs whenever someone uploads a new PDF contract using your Jotform form. Its only job is to read, understand, an"
      }
    },
    {
      "id": "d764c67f-cca8-476e-8d63-78d2733f6b64",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1296,
        -208
      ],
      "parameters": {
        "width": 1600,
        "height": 656,
        "content": "---\n\n### Part 2: Asking the AI a Question (The \"Researcher\" part)\n\nThis part of the workflow runs whenever a user sends a message in a chat interface. Its job is to find the right information from the"
      }
    },
    {
      "id": "d1f68d16-6baa-4420-8606-dbc7ca5791c7",
      "name": "JotForm Trigger",
      "type": "n8n-nodes-base.jotFormTrigger",
      "position": [
        1376,
        -496
      ]
    },
    {
      "id": "8f035b6b-c3c0-449a-acb4-0c359c309e32",
      "name": "Grab New knowledgebase",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1584,
        -496
      ]
    },
    {
      "id": "b826edc5-d97f-498c-bea1-b3f3d1430635",
      "name": "Grab the uploaded knowledgebase file link",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1792,
        -496
      ]
    }
  ],
  "connections": {
    "AI Agent": {
      "main": [
        []
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "JotForm Trigger": {
      "main": [
        [
          {
            "node": "Grab New knowledgebase",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search Embeddings": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embend User Message": {
      "main": [
        [
          {
            "node": "Search Embeddings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Splitting into Chunks": {
      "main": [
        [
          {
            "node": "Embedding Uploaded document",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Grab New knowledgebase": {
      "main": [
        [
          {
            "node": "Grab the uploaded knowledgebase file link",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Extract Text from PDF File": {
      "main": [
        [
          {
            "node": "Splitting into Chunks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "Embend User Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embedding Uploaded document": {
      "main": [
        [
          {
            "node": "Save the embedding in DB",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Grab the uploaded knowledgebase file link": {
      "main": [
        [
          {
            "node": "Extract Text from PDF File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}