{
  "meta": {
    "instanceId": "9d20a5e008f7f347cae7522a30fbb1cbf5ac1075dbf6262eec91a04370d1fcd4",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "df1968cc-94c7-45dc-8ead-46ae82361602",
      "name": "Window Buffer Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        340,
        920
      ],
      "parameters": {
        "sessionKey": "={{ $json.content }}{{ $json.output }}{{ $json.text }}",
        "sessionIdType": "customKey",
        "contextWindowLength": 500
      },
      "typeVersion": 1.3
    },
    {
      "id": "196a63dc-e8db-44b1-a1ee-3543dc5aa059",
      "name": "Discord",
      "type": "n8n-nodes-base.discord",
      "position": [
        400,
        680
      ],
      "webhookId": "11bdfa44-14f4-499a-a5c1-27197cd54b64",
      "parameters": {
        "content": "={{ $json.output }}",
        "guildId": {
          "__rl": true,
          "mode": "list",
          "value": "1339725067663315046",
          "cachedResultUrl": "https://discord.com/channels/1339725067663315046",
          "cachedResultName": "Antonis's 2083server"
        },
        "options": {
          "tts": true
        },
        "resource": "message",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "1339725068305170615",
          "cachedResultUrl": "https://discord.com/channels/1339725067663315046/1339725068305170615",
          "cachedResultName": "general"
        },
        "authentication": "oAuth2"
      },
      "credentials": {
        "discordOAuth2Api": {
          "id": "credential-id",
          "name": "discordOAuth2Api Credential"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "6962869e-71dc-48b0-84bf-ee1781bc3aa1",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        540,
        680
      ],
      "webhookId": "bd76c196-1fd1-4931-ac5a-e397dee040c1",
      "parameters": {
        "amount": 3
      },
      "typeVersion": 1.1
    },
    {
      "id": "612034bf-cfbd-475d-80bc-d959aad462b2",
      "name": "Wait2",
      "type": "n8n-nodes-base.wait",
      "position": [
        -1020,
        460
      ],
      "webhookId": "a592403a-5af4-485c-a33d-63d9af6454f2",
      "parameters": {
        "amount": 7
      },
      "typeVersion": 1.1
    },
    {
      "id": "a3a09737-cfd0-4e6e-a77b-b633727f1fb9",
      "name": "n8n Trigger",
      "type": "n8n-nodes-base.n8nTrigger",
      "position": [
        -1520,
        660
      ],
      "parameters": {
        "events": [
          "activate",
          "update",
          "init"
        ]
      },
      "typeVersion": 1
    },
    {
      "id": "368c63d6-22f5-4f1a-b97f-61a04fb12bab",
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "position": [
        1700,
        480
      ],
      "parameters": {
        "jsCode": "const items = $input.all();\n\n// Loop through each item\nfor (const item of items) {\n  try {\n    // Check if the item has the expected Gemini response structure\n    if (item && item.json && item.json.candidates && \n        item.json.candidates[0] && \n        item.json.candidates[0].content && \n        item.json.candidates[0].content.parts) {\n      \n      // Find the part that contains the image data\n      const parts = item.json.candidates[0].content.parts;\n      let imageData = null;\n      \n      for (const part of parts) {\n        if (part.inlineData && part.inlineData.data) {\n          imageData = part.inlineData.data;\n          break;\n        }\n      }\n      \n      if (!imageData) {\n        throw new Error('No image data found in the Gemini response');\n      }\n      \n      // If the image data includes a data URI prefix, remove it\n      if (imageData.startsWith('data:')) {\n        imageData = imageData.split(',')[1];\n      }\n      \n      // Convert base64 string to a Buffer\n      const bufferData = Buffer.from(imageData, 'base64');\n      \n      // Ensure 'binary' property exists\n      if (!item.binary) {\n        item.binary = {};\n      }\n      \n      // Attach the binary image data\n      item.binary.data = {\n        data: bufferData,\n        mimeType: 'image/png',\n        fileName: 'generated_image.png'\n      };\n    } else {\n      throw new Error('Input does not match expected Gemini API response structure');\n    }\n  } catch (error) {\n    console.error('Error processing item:', error.message);\n    console.log('Item structure:', JSON.stringify(item, null, 2));\n    throw error;\n  }\n}\n\n// Return the modified items array\nreturn items;"
      },
      "typeVersion": 2
    },
    {
      "id": "5c98dcf6-ea5e-4940-8e64-ac55243ab167",
      "name": "Discord2",
      "type": "n8n-nodes-base.discord",
      "position": [
        1860,
        480
      ],
      "webhookId": "321abf36-3fd4-4669-910d-9753155dfd46",
      "parameters": {
        "files": {
          "values": [
            {
              "inputFieldName": "=data"
            }
          ]
        },
        "content": "=",
        "guildId": {
          "__rl": true,
          "mode": "list",
          "value": "1339725067663315046",
          "cachedResultUrl": "https://discord.com/channels/1339725067663315046",
          "cachedResultName": "Antonis's 2083server"
        },
        "options": {},
        "resource": "message",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "1339725068305170615",
          "cachedResultUrl": "https://discord.com/channels/1339725067663315046/1339725068305170615",
          "cachedResultName": "general"
        },
        "authentication": "oAuth2"
      },
      "credentials": {
        "discordOAuth2Api": {
          "id": "credential-id",
          "name": "discordOAuth2Api Credential"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "130612c1-d73f-440c-bd76-54d1616d0e36",
      "name": "Wait3",
      "type": "n8n-nodes-base.wait",
      "position": [
        2020,
        680
      ],
      "webhookId": "40100215-3e4c-4fcc-80fc-b7dfd9423041",
      "parameters": {
        "amount": 10
      },
      "typeVersion": 1.1
    },
    {
      "id": "965bc8df-1c8e-4fad-b809-e145b13ef6bd",
      "name": "Search",
      "type": "@n8n/n8n-nodes-langchain.toolSerpApi",
      "position": [
        560,
        920
      ],
      "parameters": {
        "options": {
          "gl": "gr",
          "hl": "en",
          "google_domain": "google.com"
        }
      },
      "credentials": {
        "serpApi": {
          "id": "credential-id",
          "name": "serpApi Credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b39d4fc2-54b3-4c3e-aced-43215dcb5f0e",
      "name": "Wikipedia",
      "type": "@n8n/n8n-nodes-langchain.toolWikipedia",
      "position": [
        460,
        920
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "52018e6a-5bef-4f30-a4e6-fd6d73e6492e",
      "name": "Window Buffer Memory1",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1440,
        660
      ],
      "parameters": {
        "sessionKey": "={{ $json.text }}{{ $('Users message').item.json.content }}",
        "sessionIdType": "customKey",
        "contextWindowLength": 50
      },
      "typeVersion": 1.3
    },
    {
      "id": "f7b34ba8-8bae-4ebd-ab65-323cdf49d0e6",
      "name": "Discord3",
      "type": "n8n-nodes-base.discord",
      "position": [
        1760,
        140
      ],
      "webhookId": "321abf36-3fd4-4669-910d-9753155dfd46",
      "parameters": {
        "content": "={{ $json.choices[0].message.content }}{{ $json.candidates[0].content.parts[0].text }}",
        "guildId": {
          "__rl": true,
          "mode": "list",
          "value": "1339725067663315046",
          "cachedResultUrl": "https://discord.com/channels/1339725067663315046",
          "cachedResultName": "Antonis's 2083server"
        },
        "options": {},
        "resource": "message",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "1339725068305170615",
          "cachedResultUrl": "https://discord.com/channels/1339725067663315046/1339725068305170615",
          "cachedResultName": "general"
        },
        "authentication": "oAuth2"
      },
      "credentials": {
        "discordOAuth2Api": {
          "id": "credential-id",
          "name": "discordOAuth2Api Credential"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "10e23876-25e1-41cb-a340-a8db842293b9",
      "name": "Convert Binary to Base64",
      "type": "n8n-nodes-base.code",
      "position": [
        1380,
        140
      ],
      "parameters": {
        "jsCode": "const items = $input.all();\n\nfor (const item of items) {\n  if (item.binary && item.binary.data) {\n    const binaryData = item.binary.data;\n    const buffer = binaryData.data;\n    const base64Data = buffer.toString('base64');\n    const mimeType = binaryData.mimeType || 'image/jpeg';\n\n    item.json = {\n      ...item.json,\n      base64Image: base64Data,\n      mimeType: mimeType\n    };\n  } else {\n    throw new Error('No binary data found in item');\n  }\n}\n\nreturn items;"
      },
      "typeVersion": 2
    },
    {
      "id": "37072023-7ab7-4633-8c28-c86265c3d610",
      "name": "Fetch Audio from URL",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -360,
        -40
      ],
      "parameters": {
        "url": "={{ $json.attachments[0].url }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "cb305f66-d3d0-46f1-8eec-2eb55a85ed7a",
      "name": "Search3",
      "type": "@n8n/n8n-nodes-langchain.toolSerpApi",
      "position": [
        1660,
        660
      ],
      "parameters": {
        "options": {
          "gl": "gr",
          "hl": "en",
          "google_domain": "google.com"
        }
      },
      "credentials": {
        "serpApi": {
          "id": "credential-id",
          "name": "serpApi Credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "08be902d-5175-438e-bd11-7bbc1fbc2f5b",
      "name": "Wikipedia3",
      "type": "@n8n/n8n-nodes-langchain.toolWikipedia",
      "position": [
        1560,
        660
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "f96ee8b1-cac9-47cf-a151-13c470e09a11",
      "name": "Reciever",
      "type": "n8n-nodes-base.discord",
      "position": [
        -1180,
        660
      ],
      "webhookId": "0209310a-1eac-4422-94b7-d9d251df6a34",
      "parameters": {
        "limit": 1,
        "guildId": {
          "__rl": true,
          "mode": "list",
          "value": "1339725067663315046",
          "cachedResultUrl": "https://discord.com/channels/1339725067663315046",
          "cachedResultName": "Antonis's 2083server"
        },
        "options": {},
        "resource": "message",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "1339725068305170615",
          "cachedResultUrl": "https://discord.com/channels/1339725067663315046/1339725068305170615",
          "cachedResultName": "general"
        },
        "operation": "getAll",
        "authentication": "oAuth2"
      },
      "credentials": {
        "discordOAuth2Api": {
          "id": "credential-id",
          "name": "discordOAuth2Api Credential"
        }
      },
      "typeVersion": 2,
      "alwaysOutputData": false
    },
    {
      "id": "e174003f-9c72-4a9d-abed-35a1a81987a8",
      "name": "Users message",
      "type": "n8n-nodes-base.if",
      "position": [
        -960,
        660
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "cc1c45a8-9f18-4059-873f-1e1b5a14e161",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.author.username }}",
              "rightValue": "=antonis0761"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "de438564-4138-46dd-9609-a1aabaf9495a",
      "name": "Letters OR Voice",
      "type": "n8n-nodes-base.if",
      "position": [
        -780,
        640
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "30a5311b-1f73-4ff5-9245-ed8033b0dbf2",
              "operator": {
                "type": "string",
                "operation": "contains"
              },
              "leftValue": "={{ $json.content }}{{ $json.text }}",
              "rightValue": "image"
            },
            {
              "id": "20b15e33-4eec-4947-95fb-b4375215e514",
              "operator": {
                "type": "string",
                "operation": "contains"
              },
              "leftValue": "={{ $json.content }}{{ $json.text }}",
              "rightValue": "picture"
            },
            {
              "id": "778c1a3d-a047-43e5-9aa8-38d63a16775d",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.attachments[0].proxy_url }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "a450a83b-dc6b-4002-8387-c896b2eb973d",
      "name": "Google Image Generator",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1560,
        480
      ],
      "parameters": {
        "url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash-exp:generateContent",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"contents\": [\n    {\n      \"parts\": [\n        {\n          \"text\": \"{{ $json.output }}\"\n        }\n      ]\n    }\n  ],\n  \"generation_config\": {\n    \"response_modalities\": [\"Text\", \"Image\"]\n  }\n}",
        "sendBody": true,
        "sendQuery": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "queryParameters": {
          "parameters": [
            {
              "name": "key",
              "value": "API KEY"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "119c552e-7453-4390-a62b-ec311f850707",
      "name": "GROQ Audio To Text",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -160,
        -40
      ],
      "parameters": {
        "url": "https://api.groq.com/openai/v1/audio/transcriptions",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "model",
              "value": "whisper-large-v3"
            },
            {
              "name": "temperature",
              "value": "0"
            },
            {
              "name": "response_format",
              "value": "json"
            },
            {
              "name": "language",
              "value": "en"
            },
            {
              "name": "file",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "bearer"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "ce268902-ee71-489b-8df9-52a1c94dbe45",
      "name": "Fetch Image from Proxy URL",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1180,
        140
      ],
      "parameters": {
        "url": "={{ $json.attachments[0].url }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "60fcb273-7765-40be-93da-9f9338a8297b",
      "name": "Groq Image To Text",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1580,
        140
      ],
      "parameters": {
        "url": "https://api.groq.com/openai/v1/chat/completions",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": [\n        {\n          \"type\": \"text\",\n          \"text\": \"{{ $json.content }}\"\n        },\n        {\n          \"type\": \"image_url\",\n          \"image_url\": {\n            \"url\": \"{{ $json.attachments[0].url }}\"\n          }\n        }\n      ]\n    }\n  ],\n  \"model\": \"llama-3.2-11b-vision-preview\",\n  \"temperature\": 0.7,\n  \"max_completion_tokens\": 8192,\n  \"top_p\": 1,\n  \"stream\": false,\n  \"stop\": null\n} ",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_TOKEN_HERE KEY"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "63522dea-ef7c-4bff-b8fb-b9bc525fd3a6",
      "name": "Ollama Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOllama",
      "position": [
        140,
        920
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "ollamaApi": {
          "id": "credential-id",
          "name": "ollamaApi Credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "69b9557f-5317-4ebe-aa18-3555d9f0718e",
      "name": "Ollama Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOllama",
      "position": [
        1280,
        660
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "ollamaApi": {
          "id": "credential-id",
          "name": "ollamaApi Credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "6aec5a6a-e45c-4afe-bb47-459fcefbab9f",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1180,
        20
      ],
      "parameters": {
        "width": 680,
        "height": 220,
        "content": "This workflow captures Discord messages with images, processes them through the Groq Llama-3.2 vision model, and posts the AI's analysis back to the Discord channel. 📸 The system fetches images from attachments, converts them to base64 format, and sends both text and image content for comprehensive AI interpretation. 🧠 Get instant AI insights on your Discord images with just one message! ✨\""
      },
      "typeVersion": 1
    },
    {
      "id": "91f2c229-14d1-4a47-86ef-77316c85ca88",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -360,
        -260
      ],
      "parameters": {
        "color": 7,
        "width": 300,
        "height": 320,
        "content": "This workflow automatically captures audio attachments from Discord messages and transcribes them using Groq's Whisper Large v3 model. 🎵 The system fetches audio files from message attachments and sends them to the AI transcription service, converting spoken words into accurate text. 📝 Get instant transcriptions of voice messages, audio clips, and recordings shared in your Discord server! "
      },
      "typeVersion": 1
    },
    {
      "id": "1f8e4df3-4ad9-4c1d-ad4c-b0f30cc212cf",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        40,
        100
      ],
      "parameters": {
        "color": 4,
        "width": 540,
        "height": 280,
        "content": "🔍 Discord Attachment Filter & Processor 🧩: This workflow intelligently routes Discord messages based on attachment types and content. 🖼️ It first checks for waveform images, then filters based on image formats (PNG, JPEG, WebP), and finally processes specific text commands like 'create' or 'make'. 🤖 Smart routing ensures each attachment gets handled by the appropriate automation path, delivering tailored responses for different content types! ✨"
      },
      "typeVersion": 1
    },
    {
      "id": "61f44f7d-1049-4b1d-b167-9ea5b6919394",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1180,
        320
      ],
      "parameters": {
        "color": 6,
        "width": 660,
        "height": 440,
        "content": "🔄 Discord Message Monitor & Analyzer 🕵️‍♂️: This workflow creates an intelligent loop that fetches and processes messages from a specific Discord channel. 👤 The system identifies messages from a particular user, checks for keywords like 'image' or 'picture', and detects attachments. 🔄 With built-in timing controls and text validation, the workflow efficiently cycles through messages, ensuring continuous monitoring and response. 🚀 Perfect for creating automated responses to specific user requests and media shares in your Discord server! ✨"
      },
      "typeVersion": 1
    },
    {
      "id": "e7b3f9aa-37f9-4244-82b0-d6170c3acc67",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        100,
        520
      ],
      "parameters": {
        "color": 3,
        "width": 540,
        "height": 260,
        "content": "🧠 Intelligent Discord AI Assistant 🤖: This workflow powers a sophisticated AI assistant that responds to Discord messages with contextual awareness and powerful knowledge tools. 🔍 The system integrates Ollama's language model with multiple information sources including Wikipedia and web search capabilities. 💬 With memory buffer technology, the assistant maintains conversation context across interactions, delivering personalized and relevant responses. 🗣️ Text-to-speech functionality brings messages to life, creating an engaging user experience in your Discord server! ✨"
      },
      "typeVersion": 1
    },
    {
      "id": "f5142920-021a-4d53-b8d0-cf62c401f186",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1240,
        360
      ],
      "parameters": {
        "color": 3,
        "width": 720,
        "height": 220,
        "content": "🎨 Discord Image Generation Bot 🖼️: This workflow transforms text descriptions into stunning AI-generated images right in your Discord server. 🤖 The system uses Ollama's language model to create optimized image prompts from user descriptions, then leverages Google's Gemini model to generate high-quality images. 🔄 With built-in data processing, the workflow converts API responses into proper image files before seamlessly posting them back to Discord. 💡 Enhanced with search capabilities and contextual memory, the bot delivers personalized image creations based on user requests! ✨"
      },
      "typeVersion": 1
    },
    {
      "id": "ca69399e-1466-467c-b298-b9ceb7d27da8",
      "name": "Shorting Voice",
      "type": "n8n-nodes-base.if",
      "position": [
        40,
        240
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "9a5465ce-44b6-445c-a089-a484022896fb",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.attachments[0].waveform }}",
              "rightValue": "image/png"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "a5b13e6b-7edb-476d-9fd6-cd021adb646a",
      "name": "Image Type",
      "type": "n8n-nodes-base.if",
      "position": [
        280,
        260
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "d24242b4-5b72-4dfa-9143-80b4b72abd37",
              "operator": {
                "type": "string",
                "operation": "contains"
              },
              "leftValue": "={{ $json.attachments[0].content_type }}",
              "rightValue": "image/png"
            },
            {
              "id": "b9f84913-b7aa-4d49-91b5-43846266cbb4",
              "operator": {
                "type": "string",
                "operation": "contains"
              },
              "leftValue": "={{ $json.attachments[0].content_type }}",
              "rightValue": "image/jpeg"
            },
            {
              "id": "554341df-55d4-4010-a994-4dcf7bc6f790",
              "operator": {
                "type": "string",
                "operation": "contains"
              },
              "leftValue": "={{ $json.attachments[0].content_type }}",
              "rightValue": "image/webp"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "c1364ee2-9dd1-466c-8acc-57567070257f",
      "name": "Creating Or Analyzing",
      "type": "n8n-nodes-base.if",
      "position": [
        480,
        280
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "a46c1125-ca2b-420e-82dc-d2e2d6649ebb",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.content }}",
              "rightValue": "create"
            },
            {
              "id": "e85bf10f-fab7-4b08-a1f7-e79b38783f97",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.content }}",
              "rightValue": "make"
            },
            {
              "id": "855c5939-92ed-428f-8806-b93eb5135db9",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.text }}",
              "rightValue": "create"
            },
            {
              "id": "dcac6bc2-5e18-4eea-8d56-0afb3ce98207",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.text }}",
              "rightValue": "make"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "cb5b8226-6a34-4e4f-8847-b20ad02ffc40",
      "name": "General Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        100,
        680
      ],
      "parameters": {
        "text": "={{ $json.text }}{{ $json.content }}",
        "options": {
          "systemMessage": "=You are an AI assistant in a Discord server. You process messages, retrieve info from Wikipedia, Notion, Google Sheets, SerpAPI, and Gmail, and maintain context with a memory buffer. Respond concisely, use structured formats, be friendly, cite sources, acknowledge limits, and handle image requests and email tasks appropriately."
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "5ffba64b-ea12-4c85-8216-648c60c11d5c",
      "name": "Image Prompter",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1240,
        480
      ],
      "parameters": {
        "text": "={{ $json.text }}{{ $json.content }}",
        "options": {
          "systemMessage": "=Analyze my image description, then create a concise, detailed, realistic prompt (20 words max) without including \"\\n\\n\" in your response.Always have the word \"Create\" at the beggining of your prompt."
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    }
  ],
  "pinData": {},
  "connections": {
    "Code": {
      "main": [
        [
          {
            "node": "Discord2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Reciever",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait2": {
      "main": [
        [
          {
            "node": "Reciever",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait3": {
      "main": [
        [
          {
            "node": "Reciever",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search": {
      "ai_tool": [
        [
          {
            "node": "General Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Discord": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search3": {
      "ai_tool": [
        [
          {
            "node": "Image Prompter",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Discord2": {
      "main": [
        [
          {
            "node": "Wait3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Discord3": {
      "main": [
        [
          {
            "node": "Wait3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Reciever": {
      "main": [
        [
          {
            "node": "Users message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wikipedia": {
      "ai_tool": [
        [
          {
            "node": "General Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Image Type": {
      "main": [
        [
          {
            "node": "Fetch Image from Proxy URL",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Creating Or Analyzing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wikipedia3": {
      "ai_tool": [
        [
          {
            "node": "Image Prompter",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "n8n Trigger": {
      "main": [
        [
          {
            "node": "Reciever",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "General Agent": {
      "main": [
        [
          {
            "node": "Discord",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Users message": {
      "main": [
        [
          {
            "node": "Letters OR Voice",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Image Prompter": {
      "main": [
        [
          {
            "node": "Google Image Generator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Shorting Voice": {
      "main": [
        [
          {
            "node": "Fetch Audio from URL",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Image Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Letters OR Voice": {
      "main": [
        [
          {
            "node": "Shorting Voice",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "General Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Ollama Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "General Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "GROQ Audio To Text": {
      "main": [
        [
          {
            "node": "Letters OR Voice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Groq Image To Text": {
      "main": [
        [
          {
            "node": "Discord3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Ollama Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Image Prompter",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Audio from URL": {
      "main": [
        [
          {
            "node": "GROQ Audio To Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Window Buffer Memory": {
      "ai_memory": [
        [
          {
            "node": "General Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Creating Or Analyzing": {
      "main": [
        [
          {
            "node": "General Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Image Prompter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Window Buffer Memory1": {
      "ai_memory": [
        [
          {
            "node": "Image Prompter",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Google Image Generator": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert Binary to Base64": {
      "main": [
        [
          {
            "node": "Groq Image To Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Image from Proxy URL": {
      "main": [
        [
          {
            "node": "Convert Binary to Base64",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}