{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "1bb5bca6-10c4-4d9e-9435-3400fe80d2aa",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        -960,
        -1648
      ],
      "parameters": {
        "loader": "pdfLoader",
        "options": {},
        "dataType": "binary",
        "textSplittingMode": "custom"
      },
      "typeVersion": 1.1
    },
    {
      "id": "5759f41a-5c02-4d3d-8bee-1da84290bd39",
      "name": "Azure OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatAzureOpenAi",
      "position": [
        304,
        -2048
      ],
      "parameters": {
        "model": "gpt-4.1-mini",
        "options": {
          "temperature": 0.1
        }
      },
      "credentials": {
        "azureOpenAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "587a276a-5405-418f-8c19-462cdd10fb36",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        304,
        -2256
      ],
      "parameters": {
        "options": {
          "systemMessage": "* You are a helpful assistant(A workflow in n8n) called Mookie.\n\n* Always retrieve your information from the vector store tool, called ''Postgres PGVector Store2''.\n\n* Do not answer irrelevant questions which their answer is not found in the vector store.\n\n* You must not hallucinate or generate false information. Use the vector store as your only source of information."
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "8538610d-7484-4096-affa-5855d3825d36",
      "name": "Send PDF File",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -656,
        -2176
      ],
      "parameters": {
        "url": "https://your_n8n_instance_url/webhook/ingest-pdf",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "file",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/pdf"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "e39c3c95-a9d0-4451-8ae3-92ff9b78eb50",
      "name": "Embeddings Mistral Cloud",
      "type": "@n8n/n8n-nodes-langchain.embeddingsMistralCloud",
      "position": [
        -928,
        -1344
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "mistralCloudApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ea109c37-e951-4947-9b4e-5f24dcac0dfa",
      "name": "Postgres PGVector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePGVector",
      "position": [
        -928,
        -1824
      ],
      "parameters": {
        "mode": "insert",
        "options": {}
      },
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "32bcfb09-99d7-4883-b0bb-7c51b294dfff",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -1040,
        -2256
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "dc536bb3-09b4-4e99-9170-6d5ce7536590",
      "name": "List All File Names",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -1232,
        -2256
      ],
      "parameters": {
        "filter": {},
        "options": {},
        "resource": "fileFolder",
        "returnAll": true,
        "queryString": "myfiles"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "f71096a3-a5af-4567-95ce-a63869849975",
      "name": "Download Corresponding File",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -848,
        -2176
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Loop Over Items').item.json.id }}"
        },
        "options": {
          "binaryPropertyName": "data"
        },
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "c5e62513-0da7-4fb3-a33b-50c0b876948d",
      "name": "Run Ingestion",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1424,
        -2256
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "d73b903d-b030-42b7-a1f0-44eb087ff017",
      "name": "PDF Ingest Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -1120,
        -1824
      ],
      "parameters": {
        "path": "ingest-pdf",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 1
    },
    {
      "id": "673e5655-924d-4b87-8b9d-a8d0d92fbea3",
      "name": "Token Splitter",
      "type": "@n8n/n8n-nodes-langchain.textSplitterTokenSplitter",
      "position": [
        -960,
        -1488
      ],
      "parameters": {
        "chunkSize": 800,
        "chunkOverlap": 80
      },
      "typeVersion": 1
    },
    {
      "id": "22ad6959-4b23-40ca-97d6-a1780e93b81e",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1504,
        -2336
      ],
      "parameters": {
        "color": 5,
        "width": 1184,
        "height": 384,
        "content": "## LOAD FILES & SEND THEM TO WEBHOOK"
      },
      "typeVersion": 1
    },
    {
      "id": "152563cd-493f-4862-b1df-9ce36d25c2c1",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1504,
        -1888
      ],
      "parameters": {
        "width": 1184,
        "height": 352,
        "content": "## RECEIVE FILES AND INGEST THEM"
      },
      "typeVersion": 1
    },
    {
      "id": "7025aca3-98b9-4578-87a4-964fa1404d09",
      "name": "Postgres PGVector Store2",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePGVector",
      "position": [
        368,
        -1760
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "topK": 5,
        "options": {},
        "toolDescription": "=Work with data in Postgres Database with PGvector extension insalled. Retreive documents corresponding to the user request/question and prepare your answer based solely on these documents."
      },
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "04f31fae-759f-4568-9c1c-d0bb70bcb9a2",
      "name": "Embeddings Mistral Cloud2",
      "type": "@n8n/n8n-nodes-langchain.embeddingsMistralCloud",
      "position": [
        368,
        -1600
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "mistralCloudApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c1e2f23a-661b-4f9f-841e-45e7a20fcb47",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -1376,
        -1072
      ],
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "d1b46c07-aed2-4a8d-8cf7-8c32a9f5d99f",
      "name": "Azure OpenAI Chat Model3",
      "type": "@n8n/n8n-nodes-langchain.lmChatAzureOpenAi",
      "position": [
        144,
        -880
      ],
      "parameters": {
        "model": "gpt-4.1-mini",
        "options": {
          "temperature": 0.1
        }
      },
      "credentials": {
        "azureOpenAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "24829661-5ed7-42fd-a919-dd92aa429f79",
      "name": "AI Agent2",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        144,
        -1088
      ],
      "parameters": {
        "text": "={{ $json.message.text }}",
        "options": {
          "systemMessage": "* You are a helpful assistant(A workflow in n8n) called Mookie.\n\n* Always retrieve your information from the vector store tool, called ''Postgres PGVector Store3''.\n\n* Do not answer irrelevant questions which their answer is not found in the vector store.\n\n* You must not hallucinate or generate false information. Use the vector store as your only source of information."
        },
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "eef6da5b-38d7-44b1-9fce-368aba504860",
      "name": "Postgres PGVector Store3",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePGVector",
      "position": [
        208,
        -576
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "topK": 5,
        "options": {},
        "toolDescription": "Work with data in Postgres Database with PGvector extension insalled. Retreive documents corresponding to the user request/question and prepare your answer based solely on these documents."
      },
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "61176586-9a2e-45b9-8592-bf86c989ebf7",
      "name": "Embeddings Mistral Cloud3",
      "type": "@n8n/n8n-nodes-langchain.embeddingsMistralCloud",
      "position": [
        208,
        -416
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "mistralCloudApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "28a0b6b9-8be9-491b-83e9-54ecceee4e87",
      "name": "Send a Text Message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        448,
        -1088
      ],
      "parameters": {
        "text": "={{ $json.output }}",
        "chatId": "={{ $('Telegram Trigger').item.json.message.from.id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "6eb22528-4c87-44cb-a152-7abeb45c43ff",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        240,
        -736
      ],
      "parameters": {
        "sessionKey": "={{ $('Telegram Trigger').item.json.message.from.id }}",
        "sessionIdType": "customKey"
      },
      "typeVersion": 1.3
    },
    {
      "id": "f381d0a0-7b41-489c-9499-467e77620c47",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "disabled": true,
      "position": [
        -16,
        -2336
      ],
      "parameters": {
        "color": 6,
        "width": 704,
        "height": 304,
        "content": "# CANVAS CHAT"
      },
      "typeVersion": 1
    },
    {
      "id": "a1086f33-fda6-458a-b458-14e15064ddaa",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "disabled": true,
      "position": [
        -1504,
        -1152
      ],
      "parameters": {
        "color": 6,
        "width": 2192,
        "height": 544,
        "content": "# TELEGRAM CHAT"
      },
      "typeVersion": 1
    },
    {
      "id": "b94c09c3-6451-4a5e-a85b-1aa497571d4e",
      "name": "Send Refusal Message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -864,
        -768
      ],
      "parameters": {
        "text": "=Sorry, I couldn't understand. Could you rephrase your request?",
        "chatId": "={{ $('Telegram Trigger').item.json.message.from.id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "909b0739-2bb6-4ab3-ad66-a5006b1cbf62",
      "name": "Simple Memory2",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        400,
        -1904
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "885d7ab7-769c-482f-9ccb-b5351bddd428",
      "name": "Chat Trigger",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        80,
        -2256
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.3
    },
    {
      "id": "14619b70-8499-49dc-9a0d-0c61e62b3ea5",
      "name": "If Text Message Received",
      "type": "n8n-nodes-base.if",
      "position": [
        -1216,
        -1072
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "ae096eaf-c284-4cbe-b68c-e72f4c503f93",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $('Telegram Trigger').item.json.message.text }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "ad652cab-041e-445d-9f60-8feacba30c18",
      "name": "If PDF File Received",
      "type": "n8n-nodes-base.if",
      "position": [
        -1040,
        -848
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "20a2d7ce-d67d-4efe-ba28-151edfeea6a5",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $('Telegram Trigger').item.json.message.document.mime_type }}",
              "rightValue": "=application/pdf"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "ff0b610a-5a35-4602-9df7-f40fe58d7c3a",
      "name": "Send Downloaded PDF File",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -320,
        -1008
      ],
      "parameters": {
        "url": "https://your_n8n_instance_url/webhook/ingest-pdf",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "file",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/pdf"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "5c5d0290-6975-4bab-bd36-34c51b43c3b6",
      "name": "Download PDF File",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -512,
        -1008
      ],
      "parameters": {
        "fileId": "={{ $('Telegram Trigger').item.json.message.document.file_id }}",
        "resource": "file",
        "additionalFields": {
          "mimeType": "application/pdf"
        }
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "f8ed9971-bea3-422b-a724-3bf66f7fc1ce",
      "name": "Approve Ingestion",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -864,
        -928
      ],
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.from.id }}",
        "message": "I will ingest the PDF file you provided. \n\nResuming ingestion upon approval.",
        "options": {
          "appendAttribution": false
        },
        "operation": "sendAndWait"
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "adda50a8-624a-4dde-ba84-478ae3e5fbfd",
      "name": "If User Approved",
      "type": "n8n-nodes-base.if",
      "position": [
        -688,
        -928
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "20a2d7ce-d67d-4efe-ba28-151edfeea6a5",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.data.approved }}",
              "rightValue": "=application/pdf"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "3448fda2-4133-475d-97c4-683ab18e7e8d",
      "name": "User Dissapproved",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -512,
        -848
      ],
      "parameters": {
        "text": "=Terminated Ingestion.",
        "chatId": "={{ $('Telegram Trigger').item.json.message.from.id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "a040371b-5896-4d2c-b80a-0614e3d6093c",
      "name": "Send Finished Message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -112,
        -1008
      ],
      "parameters": {
        "text": "=Ingestion Completed Successfully.",
        "chatId": "={{ $('Telegram Trigger').item.json.message.from.id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "b172fc47-6784-4c5d-841c-d3f0b52b059c",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2112,
        -2336
      ],
      "parameters": {
        "color": 4,
        "width": 576,
        "height": 1040,
        "content": "# Credentials\nThis workflow requires 5 different credential configurations to connect with external services. Set up each credential in n8n's credential manager before activating the workflow.\n1. Azure OpenAI API\nUsed for: GPT-4 language model powering the AI agents\nRequired fields:\n\nResource name (your Azure OpenAI resource)\nAPI key from Azure portal\nAPI version (use latest available)\nDeployment name for GPT-4 model\n\nSetup guide: https://docs.n8n.io/integrations/builtin/credentials/azureopenai/\n2. Mistral Cloud API\nUsed for: Text embeddings to convert documents into searchable vectors\nRequired fields:\n\nAPI key from Mistral AI platform\nModel selection (use default embedding model)\n\nSetup guide: https://docs.n8n.io/integrations/builtin/credentials/mistralcloud/\n3. PostgreSQL Database\nUsed for: Vector storage with PGVector extension for document retrieval\nRequired fields:\n\nHost, port, database name\nUsername and password\nSSL settings (recommended: require)\nPrerequisites: Install PGVector extension in your PostgreSQL database\n\nSetup guide: https://docs.n8n.io/integrations/builtin/credentials/postgres/\n4. Google Drive OAuth2 API\nUsed for: Automatic PDF ingestion from designated Google Drive folder\nRequired fields:\n\nClient ID and Client Secret from Google Cloud Console\nOAuth2 authorization flow completion\nPrerequisites: Enable Google Drive API in Google Cloud Console\n\nSetup guide: https://docs.n8n.io/integrations/builtin/credentials/google/\n5. Telegram Bot API\nUsed for: Chat interface and file uploads via Telegram\nRequired fields:\n\nBot token from @BotFather\nBot username\nPrerequisites: Create bot via @BotFather on Telegram\n\nSetup guide: https://docs.n8n.io/integrations/builtin/credentials/telegram/\nImportant: Test each credential after setup to ensure proper connectivity before running the workflow."
      },
      "typeVersion": 1
    },
    {
      "id": "da165d33-406b-4bce-b521-040e97c4c4e7",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        736,
        -2336
      ],
      "parameters": {
        "color": 4,
        "width": 688,
        "height": 1376,
        "content": "# Start Using This Workflow\n\n## Quick Setup (5 minutes)\n\n### 1. Update Your URLs\n- Open **Send PDF File** and **Send Downloaded PDF File** nodes\n- Replace `https://your_n8n_instance_url/webhook/ingest-pdf` with your actual n8n webhook URL\n- Copy the URL from your **PDF Ingest Webhook** node\n\n### 2. Configure Google Drive\n- In **List All File Names** node, change \"myfiles\" to your folder name\n- Create a folder in Google Drive and add some PDFs for testing\n\n### 3. Database Setup\n- Ensure your PostgreSQL has PGVector extension installed\n- The workflow creates tables automatically\n\n## Testing Your Setup\n\n### Step 1: Test Document Ingestion\n1. **Manual test:** Click **Run Ingestion** to process Google Drive PDFs\n2. **Telegram test:** Send a PDF to your bot, approve when asked\n3. Both should show \"Ingestion Completed Successfully\"\n\n### Step 2: Test Chat Features\n1. **Ask questions** about your uploaded documents\n2. Try both Telegram chat and the canvas chat interface\n3. The bot should answer based on your documents and refuse irrelevant questions\n\n## Key Settings to Adjust\n\n- **Chunk Size (800):** Make smaller for precise answers, larger for more context\n- **TopK (5):** Increase if bot says \"no relevant documents found\"\n- **Temperature (0.1):** Keep low for factual responses\n- **System Message:** Customize how your assistant behaves\n\n## Common Issues & Fixes\n\n**Bot not responding?** Check your Telegram bot token and webhook URLs\n\n**Poor document retrieval?** Increase TopK value from 5 to 10\n\n**Ingestion failing?** Verify Google Drive folder permissions and PDF file formats\n\n**Out of context errors?** Your documents might be too large - try smaller PDFs first\n\n## Pro Tips\n\n- Start with 2-3 small, well-formatted PDFs\n- Ask specific questions rather than broad topics\n- Use the Google Drive auto-ingestion for bulk processing\n- Use Telegram for real-time document uploads and chat"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "AI Agent2": {
      "main": [
        [
          {
            "node": "Send a Text Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Chat Trigger": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Ingestion": {
      "main": [
        [
          {
            "node": "List All File Names",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send PDF File": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent2",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory2": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Token Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Download Corresponding File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If User Approved": {
      "main": [
        [
          {
            "node": "Download PDF File",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "User Dissapproved",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "If Text Message Received",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Approve Ingestion": {
      "main": [
        [
          {
            "node": "If User Approved",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download PDF File": {
      "main": [
        [
          {
            "node": "Send Downloaded PDF File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "PDF Ingest Webhook": {
      "main": [
        [
          {
            "node": "Postgres PGVector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Postgres PGVector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "List All File Names": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If PDF File Received": {
      "main": [
        [
          {
            "node": "Approve Ingestion",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Refusal Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Postgres PGVector Store": {
      "main": [
        []
      ]
    },
    "Azure OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Azure OpenAI Chat Model3": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent2",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings Mistral Cloud": {
      "ai_embedding": [
        [
          {
            "node": "Postgres PGVector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "If Text Message Received": {
      "main": [
        [
          {
            "node": "AI Agent2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If PDF File Received",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Postgres PGVector Store2": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Postgres PGVector Store3": {
      "ai_tool": [
        [
          {
            "node": "AI Agent2",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Send Downloaded PDF File": {
      "main": [
        [
          {
            "node": "Send Finished Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings Mistral Cloud2": {
      "ai_embedding": [
        [
          {
            "node": "Postgres PGVector Store2",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings Mistral Cloud3": {
      "ai_embedding": [
        [
          {
            "node": "Postgres PGVector Store3",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Download Corresponding File": {
      "main": [
        [
          {
            "node": "Send PDF File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}