{
  "name": "Breakdown documents into study notes using templating MistralAI and Qdrant",
  "nodes": [
    {
      "id": "a3af309b-d24c-42fe-8bcd-f330927c7a3c",
      "name": "Local File Trigger",
      "type": "n8n-nodes-base.localFileTrigger",
      "position": [
        140,
        260
      ]
    },
    {
      "id": "048f9d67-6519-4dea-97df-aaddfefbfea2",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        1300,
        720
      ]
    },
    {
      "id": "9e9047c9-4428-4afb-8c74-d6eb1075a65a",
      "name": "Recursive Character Text Splitter",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        1300,
        860
      ]
    },
    {
      "id": "e42e3f82-6cd9-40c4-9da2-8f87ee5b3956",
      "name": "Embeddings Mistral Cloud",
      "type": "@n8n/n8n-nodes-langchain.embeddingsMistralCloud",
      "position": [
        1180,
        720
      ]
    },
    {
      "id": "578c63db-4f6e-4341-ab0d-111debd519be",
      "name": "Mistral Cloud Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatMistralCloud",
      "position": [
        2660,
        840
      ]
    },
    {
      "id": "c34adb3e-1fb9-4248-ae83-2bac34c8b0a4",
      "name": "Mistral Cloud Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatMistralCloud",
      "position": [
        1200,
        400
      ]
    },
    {
      "id": "98e6dcc0-1e3a-4119-b657-0949f34ba525",
      "name": "Prep Incoming Doc",
      "type": "n8n-nodes-base.set",
      "position": [
        900,
        420
      ]
    },
    {
      "id": "ab88cf9a-d310-4bef-9280-8b23729e7cc9",
      "name": "Settings",
      "type": "n8n-nodes-base.set",
      "position": [
        320,
        260
      ]
    },
    {
      "id": "35c6b678-e6e9-4adf-a904-909fa2401d5e",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        1600,
        420
      ]
    },
    {
      "id": "0fa13be8-8500-486c-a1c6-cc1df00a4947",
      "name": "Get Doc Types",
      "type": "n8n-nodes-base.set",
      "position": [
        2000,
        420
      ]
    },
    {
      "id": "e3469368-f214-4549-844e-7febfbbf0202",
      "name": "Split Out Doc Types",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        2160,
        420
      ]
    },
    {
      "id": "df401e9e-2f70-4079-969b-6b61142fca37",
      "name": "For Each Doc Type...",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        2340,
        420
      ]
    },
    {
      "id": "c334b546-8e11-424d-bdd5-006e7086f24b",
      "name": "Item List Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserItemList",
      "position": [
        2840,
        840
      ]
    },
    {
      "id": "4267c2b5-f1cd-4df7-84ee-be01a643a1c1",
      "name": "Vector Store Retriever",
      "type": "@n8n/n8n-nodes-langchain.retrieverVectorStore",
      "position": [
        3200,
        840
      ]
    },
    {
      "id": "abf833ec-8a6d-4e13-a526-0ea6b80d578f",
      "name": "Embeddings Mistral Cloud1",
      "type": "@n8n/n8n-nodes-langchain.embeddingsMistralCloud",
      "position": [
        3200,
        1060
      ]
    },
    {
      "id": "a0e50185-6662-4b11-9922-59e8b06e4967",
      "name": "Qdrant Vector Store1",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "position": [
        3200,
        940
      ]
    },
    {
      "id": "20c5766a-d3ce-4c01-a76b-facf1a00abc2",
      "name": "Mistral Cloud Chat Model2",
      "type": "@n8n/n8n-nodes-langchain.lmChatMistralCloud",
      "position": [
        3100,
        840
      ]
    },
    {
      "id": "f049b7af-07f3-47e5-9476-68d73a387978",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        2960,
        680
      ]
    },
    {
      "id": "39042ae0-e17f-46cd-84be-728868950d84",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        3400,
        680
      ]
    },
    {
      "id": "e3b900c8-515d-4ac7-88fa-c364134ba9f9",
      "name": "Mistral Cloud Chat Model3",
      "type": "@n8n/n8n-nodes-langchain.lmChatMistralCloud",
      "position": [
        3540,
        840
      ]
    },
    {
      "id": "efb26a5d-6a61-44b2-ad99-6d1f8b48998d",
      "name": "Discover",
      "type": "@n8n/n8n-nodes-langchain.chainRetrievalQa",
      "position": [
        3100,
        680
      ]
    },
    {
      "id": "302b7523-898e-47af-8941-aa5f8a58fd9c",
      "name": "2secs",
      "type": "n8n-nodes-base.wait",
      "position": [
        3880,
        1060
      ]
    },
    {
      "id": "007857b0-c12c-4c57-b07f-db30526cd747",
      "name": "Get Generated Documents",
      "type": "n8n-nodes-base.set",
      "position": [
        2680,
        240
      ]
    },
    {
      "id": "36fac35f-df10-41ab-96a7-3a5e67f9d8df",
      "name": "Generate",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        3540,
        680
      ]
    },
    {
      "id": "b9a79cb0-bcc1-4d73-af93-5f8d7e2258a9",
      "name": "Prep For AI",
      "type": "n8n-nodes-base.set",
      "position": [
        1760,
        420
      ]
    },
    {
      "id": "e40c7e99-9813-4f06-92bb-dfb2839f1037",
      "name": "To Binary",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        2860,
        240
      ]
    },
    {
      "id": "b55df916-7a51-4114-91b8-18a3c6ba2c56",
      "name": "Export to Folder",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        3020,
        240
      ]
    },
    {
      "id": "8490664e-0ca5-4839-ad03-d3f9706c99a3",
      "name": "Get FileType",
      "type": "n8n-nodes-base.switch",
      "position": [
        480,
        420
      ]
    },
    {
      "id": "386f7aac-f3b9-4565-907f-687d48b00c52",
      "name": "Import File",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        320,
        420
      ]
    },
    {
      "id": "6ade93d5-61c3-450a-b78c-e210c18c0e70",
      "name": "Extract from PDF",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        680,
        260
      ]
    },
    {
      "id": "f413e139-3f9c-438f-8e82-824c38f09c6b",
      "name": "Extract from DOCX",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        680,
        420
      ]
    },
    {
      "id": "455fadea-f5c7-4bea-983f-b06da4e57510",
      "name": "Extract from TEXT",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        680,
        580
      ]
    },
    {
      "id": "b2586011-4985-4075-b51c-90301b1a8cf9",
      "name": "Summarization Chain",
      "type": "@n8n/n8n-nodes-langchain.chainSummarization",
      "position": [
        1200,
        260
      ]
    },
    {
      "id": "1502e72c-e97e-4148-8138-01818ab5b104",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        60,
        85.80882007954312
      ],
      "parameters": {
        "width": 995.1475972814769,
        "height": 694.0931000693263,
        "content": "## Step 1. Watch Folder and Import New Documents\n[Read more about Local File Trigger](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.localfiletrigger)\n\nWith n8n's local file trigge"
      }
    },
    {
      "id": "7b3afc2c-3fb8-4589-9475-78f5617009cc",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1080,
        82.96464765818223
      ],
      "parameters": {
        "width": 824.3300768713589,
        "height": 949.8141899605673,
        "content": "## Step 2. Summarise and Vectorise Document Contents\n[Learn more about using the Qdrant VectorStore](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreqd"
      }
    },
    {
      "id": "74aabb02-ca5d-41ad-b84f-92d66428b774",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1940,
        156.7963650826494
      ],
      "parameters": {
        "width": 591.09953935829,
        "height": 485.0226378812345,
        "content": "## Step 3. Loop through Templates\n\nWe'll ask the LLM to help us generate 3 types of notes from the imported source document. These notes are intended to breakdown the content for faster study. Our tem"
      }
    },
    {
      "id": "b96f899d-4a44-491c-b164-a42feba129eb",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2560,
        480
      ],
      "parameters": {
        "width": 1500.7886103732135,
        "height": 806.6560661824452,
        "content": "## Step 4. Use AI Agents to Query and Generate Template Documents\n[Read more about using the Question & Answer Retrieval Chain](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-no"
      }
    },
    {
      "id": "77fda269-6877-422f-b6e6-4346bde862db",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2560,
        67.64523011966037
      ],
      "parameters": {
        "width": 771.8710855215123,
        "height": 384.22073222791266,
        "content": "## Step 5. Export Generated Templates To Folder\n[Learn more about writing to the local filesystem](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.filesreadwrite)\n\nFinally, the AI g"
      }
    },
    {
      "id": "08839972-f0f4-4144-bf27-810664cbf828",
      "name": "Qdrant Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "position": [
        1200,
        560
      ]
    },
    {
      "id": "7e216411-83ee-4b82-9e00-285d4f2d3224",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -360,
        80
      ],
      "parameters": {
        "width": 390.63004227317265,
        "height": 401.0080676370763,
        "content": "## Try It Out! \n\n### This workflow automates generating notes from a source document.\n* It watches a target folder to pick up new files.\n* When a new file is detected, it saves the contents of the fil"
      }
    },
    {
      "id": "f2c363d3-a2bf-4468-ad54-f26649ce6ab8",
      "name": "Interview",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        2660,
        680
      ]
    },
    {
      "id": "ce3da55d-8c22-40bb-8781-63c2e6bcb824",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1960,
        380
      ],
      "parameters": {
        "width": 172.26820279743384,
        "height": 295.46359440513226,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### 💡Add your own templates here!\n"
      }
    }
  ],
  "connections": {
    "2secs": {
      "main": [
        [
          {
            "node": "For Each Doc Type...",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Prep For AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Discover": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate": {
      "main": [
        [
          {
            "node": "2secs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Settings": {
      "main": [
        [
          {
            "node": "Import File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Generate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Interview": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Discover",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "To Binary": {
      "main": [
        [
          {
            "node": "Export to Folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Import File": {
      "main": [
        [
          {
            "node": "Get FileType",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prep For AI": {
      "main": [
        [
          {
            "node": "Get Doc Types",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get FileType": {
      "main": [
        [
          {
            "node": "Extract from PDF",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Extract from DOCX",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Extract from TEXT",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Doc Types": {
      "main": [
        [
          {
            "node": "Split Out Doc Types",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from PDF": {
      "main": [
        [
          {
            "node": "Prep Incoming Doc",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from DOCX": {
      "main": [
        [
          {
            "node": "Prep Incoming Doc",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from TEXT": {
      "main": [
        [
          {
            "node": "Prep Incoming Doc",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prep Incoming Doc": {
      "main": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "main",
            "index": 0
          },
          {
            "node": "Summarization Chain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Local File Trigger": {
      "main": [
        [
          {
            "node": "Settings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Qdrant Vector Store": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Split Out Doc Types": {
      "main": [
        [
          {
            "node": "For Each Doc Type...",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Summarization Chain": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "For Each Doc Type...": {
      "main": [
        [
          {
            "node": "Get Generated Documents",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Interview",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Qdrant Vector Store1": {
      "ai_vectorStore": [
        [
          {
            "node": "Vector Store Retriever",
            "type": "ai_vectorStore",
            "index": 0
          }
        ]
      ]
    },
    "Vector Store Retriever": {
      "ai_retriever": [
        [
          {
            "node": "Discover",
            "type": "ai_retriever",
            "index": 0
          }
        ]
      ]
    },
    "Get Generated Documents": {
      "main": [
        [
          {
            "node": "To Binary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Item List Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Interview",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings Mistral Cloud": {
      "ai_embedding": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Mistral Cloud Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Interview",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings Mistral Cloud1": {
      "ai_embedding": [
        [
          {
            "node": "Qdrant Vector Store1",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Mistral Cloud Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Summarization Chain",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Mistral Cloud Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "Discover",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Mistral Cloud Chat Model3": {
      "ai_languageModel": [
        [
          {
            "node": "Generate",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Recursive Character Text Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    }
  }
}