{
  "name": "Create a RAG system with Paul Essays, Milvus, and OpenAI for cited answers",
  "nodes": [
    {
      "id": "52044ccd-4e0d-4353-b612-cf8db1b55331",
      "name": "When clicking \"Execute Workflow\"",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -500,
        -100
      ]
    },
    {
      "id": "b6993775-d21b-4ae8-a59c-43aef2b7002b",
      "name": "Fetch Essay List",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -220,
        -100
      ]
    },
    {
      "id": "cbaeb236-5c93-4b34-a06b-ff0e5de8525f",
      "name": "Extract essay names",
      "type": "n8n-nodes-base.html",
      "position": [
        -20,
        -100
      ]
    },
    {
      "id": "d92b6692-4a02-4519-b113-8a9172c71de9",
      "name": "Split out into items",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        180,
        -100
      ]
    },
    {
      "id": "d16ba71b-10fc-454f-8bfc-a6826280a4e7",
      "name": "Fetch essay texts",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        580,
        -100
      ]
    },
    {
      "id": "c4fa74ea-6af5-410c-bf5c-9d8d3decf31b",
      "name": "Limit to first 3",
      "type": "n8n-nodes-base.limit",
      "position": [
        380,
        -100
      ]
    },
    {
      "id": "3da8495b-62df-475d-b99d-e0f3c64266e3",
      "name": "Extract Text Only",
      "type": "n8n-nodes-base.html",
      "position": [
        900,
        -100
      ]
    },
    {
      "id": "4a9b5d5d-fc94-40b7-af0c-13d992bc1eb9",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -300,
        -220
      ],
      "parameters": {
        "width": 1071.752021563343,
        "height": 285.66037735849045,
        "content": "## Scrape latest Paul Graham essays"
      }
    },
    {
      "id": "b8a7a288-186f-4444-b0de-33ed90009c0a",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        820,
        -220
      ],
      "parameters": {
        "width": 625,
        "height": 607,
        "content": "## Load into Milvus vector store"
      }
    },
    {
      "id": "c9e7b166-cc65-47e2-a437-9c00017b492a",
      "name": "Recursive Character Text Splitter1",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        1240,
        240
      ]
    },
    {
      "id": "e1a75f27-7c8c-4d0d-9b0f-33fe9ec96fc6",
      "name": "Generate response",
      "type": "n8n-nodes-base.set",
      "position": [
        1240,
        560
      ]
    },
    {
      "id": "8b3497ad-5bc8-44b3-bdf4-3a028fe265ce",
      "name": "Compose citations",
      "type": "n8n-nodes-base.set",
      "position": [
        1040,
        560
      ]
    },
    {
      "id": "0452cf15-145c-49dd-8803-4c8b8a7adbea",
      "name": "Answer the query based on chunks",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "position": [
        680,
        560
      ]
    },
    {
      "id": "d385ac35-6f94-4101-99de-5ce1991f40c4",
      "name": "Prepare chunks",
      "type": "n8n-nodes-base.code",
      "position": [
        480,
        560
      ]
    },
    {
      "id": "379837f2-4f96-43ff-8e87-722cbe6d652f",
      "name": "Set max chunks to send to model",
      "type": "n8n-nodes-base.set",
      "position": [
        -300,
        560
      ]
    },
    {
      "id": "9bc391bb-df47-41df-b170-9df47a6b5e87",
      "name": "Embeddings OpenAI2",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        -100,
        780
      ]
    },
    {
      "id": "efb030f4-445b-4ba0-b5c9-95e4e5893664",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -540,
        560
      ]
    },
    {
      "id": "c74943be-0008-4d4c-9dea-598a648a97a2",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -380,
        440
      ],
      "parameters": {
        "width": 1594,
        "height": 529,
        "content": ""
      }
    },
    {
      "id": "2e27f3d8-e8a2-4647-80dd-f2643b224cb5",
      "name": "Milvus Vector Store in retrieval",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreMilvus",
      "position": [
        0,
        560
      ]
    },
    {
      "id": "a3cf7e0e-f681-4880-9ccf-5c42d5457c0f",
      "name": "Milvus Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreMilvus",
      "position": [
        1120,
        -100
      ]
    },
    {
      "id": "4c4cc5a5-e880-466f-a298-4af53a2acbec",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -700,
        -260
      ],
      "parameters": {
        "width": 280,
        "height": 180,
        "content": "## Step 1\n1. Set up a Milvus server based on [this guide](https://milvus.io/docs/install_standalone-docker-compose.md). And then create a collection named `my_collection`.\n2. Click this workflow to lo"
      }
    },
    {
      "id": "18f42da4-42ea-4eb0-9c43-ef8bd31ab7ff",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -680,
        460
      ],
      "parameters": {
        "width": null,
        "height": 120,
        "content": "## Step 2\nChat and get citations in response"
      }
    },
    {
      "id": "0af427ed-d901-4192-9fdc-986a63fd585b",
      "name": "Embeddings OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        1020,
        140
      ]
    },
    {
      "id": "3603852a-bf12-4289-9733-dcd29d12a4f6",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        1160,
        120
      ]
    },
    {
      "id": "b49eb3ae-82cb-4d87-8f22-0789b3a14d83",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        680,
        780
      ]
    }
  ],
  "connections": {
    "Prepare chunks": {
      "main": [
        [
          {
            "node": "Answer the query based on chunks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Essay List": {
      "main": [
        [
          {
            "node": "Extract essay names",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit to first 3": {
      "main": [
        [
          {
            "node": "Fetch essay texts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Compose citations": {
      "main": [
        [
          {
            "node": "Generate response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Milvus Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Extract Text Only": {
      "main": [
        [
          {
            "node": "Milvus Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch essay texts": {
      "main": [
        [
          {
            "node": "Extract Text Only",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Answer the query based on chunks",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI2": {
      "ai_embedding": [
        [
          {
            "node": "Milvus Vector Store in retrieval",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Milvus Vector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Extract essay names": {
      "main": [
        [
          {
            "node": "Split out into items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split out into items": {
      "main": [
        [
          {
            "node": "Limit to first 3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set max chunks to send to model": {
      "main": [
        [
          {
            "node": "Milvus Vector Store in retrieval",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Answer the query based on chunks": {
      "main": [
        [
          {
            "node": "Compose citations",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Milvus Vector Store in retrieval": {
      "main": [
        [
          {
            "node": "Prepare chunks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \"Execute Workflow\"": {
      "main": [
        [
          {
            "node": "Fetch Essay List",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Recursive Character Text Splitter1": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    }
  }
}