{
  "name": "Process voice, images & documents with GPT-4o, MongoDB & Gmail tools",
  "nodes": [
    {
      "id": "007accc7-cc28-4904-a66e-e78e73b13b3b",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -220,
        -880
      ]
    },
    {
      "id": "8d5e865b-7a6b-4c1d-a850-68b9a25de56f",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        -20,
        -880
      ]
    },
    {
      "id": "1dc71295-3f8b-4d7a-9469-707db0828a16",
      "name": "Transcribe a recording",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        680,
        -400
      ]
    },
    {
      "id": "31ab270f-3820-4113-b534-70fda48fc108",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1220,
        600
      ]
    },
    {
      "id": "25361e7d-6be5-4025-a1d7-b546bb248090",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1040,
        880
      ]
    },
    {
      "id": "aa026292-2ddb-41cb-b650-46b336a6607d",
      "name": "Respond",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1600,
        600
      ]
    },
    {
      "id": "b5e4eeec-b901-4121-9f97-6dc8bbdb92db",
      "name": "MongoDB Chat Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryMongoDbChat",
      "position": [
        1240,
        880
      ]
    },
    {
      "id": "638201f8-1e90-46e6-af59-a4ddc8bf5bf9",
      "name": "ConvertAPI HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        460,
        -880
      ]
    },
    {
      "id": "10176355-04e5-49b5-a128-7aecb538e72a",
      "name": "Get audio file",
      "type": "n8n-nodes-base.telegram",
      "position": [
        240,
        -400
      ]
    },
    {
      "id": "53e02e99-b01a-4115-8663-d4241bfbc8e5",
      "name": "Get photo file",
      "type": "n8n-nodes-base.telegram",
      "position": [
        240,
        -880
      ]
    },
    {
      "id": "f3341c7e-c303-49c7-be9c-37b6b03b76f7",
      "name": "Analyze image",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        680,
        -880
      ]
    },
    {
      "id": "7aea5368-650e-440a-b986-31010ab82fdc",
      "name": "Get text from Image",
      "type": "n8n-nodes-base.set",
      "position": [
        900,
        -880
      ]
    },
    {
      "id": "676ca8f7-bb55-4c66-ae26-1fab3bb36c77",
      "name": "Get text from Audio",
      "type": "n8n-nodes-base.set",
      "position": [
        880,
        -400
      ]
    },
    {
      "id": "f3ec9d7f-1e0e-42cb-bf8b-1bead0558289",
      "name": "Get a file",
      "type": "n8n-nodes-base.telegram",
      "position": [
        240,
        20
      ]
    },
    {
      "id": "25fc5879-8fa1-47a8-9888-d4129227beca",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        440,
        20
      ]
    },
    {
      "id": "d48612ec-28e1-4685-a5f6-efb7cb53ba3b",
      "name": "Extract from File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        680,
        20
      ]
    },
    {
      "id": "36ec8656-502e-45dd-8309-4486bab3c0c8",
      "name": "Get text from PDF",
      "type": "n8n-nodes-base.set",
      "position": [
        880,
        20
      ]
    },
    {
      "id": "a06fe0fe-0c55-40fa-9711-0f8c39d44780",
      "name": "Unsupported Input",
      "type": "n8n-nodes-base.set",
      "position": [
        680,
        220
      ]
    },
    {
      "id": "a32d4c7d-dd06-49e5-b302-09bb9926341c",
      "name": "Get text from Message",
      "type": "n8n-nodes-base.set",
      "position": [
        220,
        600
      ]
    },
    {
      "id": "d1d4e397-d495-4584-b8c4-bf9c87174f48",
      "name": "Send a message in Gmail",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        1460,
        880
      ]
    },
    {
      "id": "e4c44de2-e751-4baf-afcd-d329c4891d43",
      "name": "Search for a messages in Gmail",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        1660,
        880
      ]
    },
    {
      "id": "30e70a97-136e-4dd7-bad2-48c4f0f63773",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -220,
        -1160
      ],
      "parameters": {
        "width": 2820,
        "height": 240,
        "content": "## 📝 General Overview\n\nThis n8n workflow creates a multi-modal AI Memory Assistant that captures and intelligently recalls information from voice, images, documents, and text messages sent via Telegra"
      }
    },
    {
      "id": "b67876a6-803d-46ba-ae08-f27b718efe2b",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1200,
        -880
      ],
      "parameters": {
        "width": 1400,
        "height": 340,
        "content": "## 📸 Processing Photos\n\nThis section of the workflow handles image inputs from Telegram:\n\n    The Telegram Trigger identifies incoming messages with a photo.\n\n    The Get photo file node downloads the"
      }
    },
    {
      "id": "1369051f-00c7-4564-bed9-c07b35f92fc8",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1200,
        20
      ],
      "parameters": {
        "width": 1400,
        "height": 420,
        "content": "## 📄 Processing Documents & Accounting for Unsupported Files\n\nThis section handles document uploads and provides a fallback for unsupported file types:\n\n    The Telegram Trigger detects incoming docum"
      }
    },
    {
      "id": "4884964b-3a71-4459-9a0b-b4e2de51c90c",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1200,
        -400
      ],
      "parameters": {
        "width": 1400,
        "height": 300,
        "content": "## 🎙️ Processing Audio\n\nThis part of the workflow manages voice note inputs from Telegram:\n\n    The Telegram Trigger catches incoming messages that are voice notes.\n\n    The Get audio file node downlo"
      }
    },
    {
      "id": "791a2aa1-e747-4ac4-be8c-13375349a235",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1880,
        600
      ],
      "parameters": {
        "width": 720,
        "height": 700,
        "content": "## 🧠 AI Agent Processing, MongoDB Vector Store, and Gmail Access\n\nThis is the core intelligence hub of your memory assistant:\n\n    The AI Agent (a Langchain Agent node) receives the processed text inp"
      }
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Unsupported Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Get photo file",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get audio file",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get a file",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get text from Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Respond",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get a file": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze image": {
      "main": [
        [
          {
            "node": "Get text from Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get audio file": {
      "main": [
        [
          {
            "node": "Transcribe a recording",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get photo file": {
      "main": [
        [
          {
            "node": "ConvertAPI HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "Get text from PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get text from PDF": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Unsupported Input": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get text from Audio": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get text from Image": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MongoDB Chat Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Get text from Message": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcribe a recording": {
      "main": [
        [
          {
            "node": "Get text from Audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ConvertAPI HTTP Request": {
      "main": [
        [
          {
            "node": "Analyze image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a message in Gmail": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Search for a messages in Gmail": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}