{
  "name": "Alfred (funcional)",
  "nodes": [
    {
      "parameters": {},
      "id": "5e24da54-9f0a-4246-b202-15ca59b47f58",
      "name": "sessionId-master",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1240,
        1220
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Consume the Gmail API to get the last emails",
        "operation": "getAll",
        "limit": "={{ $fromAI(\"limit\", \"The maximal number of mails to receive.\", \"number\") }}",
        "filters": {
          "q": "in:inbox"
        }
      },
      "id": "8a228c87-fbf1-4904-a7ce-5737057c4609",
      "name": "Get last emails",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        -380,
        1560
      ],
      "typeVersion": 2.1,
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Consume Google Calendar API to receive a list of calendar events between \"start\" and \"end\". Make sure to pass datetime.",
        "operation": "getAll",
        "calendar": {
          "__rl": true,
          "value": "anaue736@gmail.com",
          "mode": "list",
          "cachedResultName": "anaue.100@hotmail.com"
        },
        "limit": "={{ $fromAI('limit','the amount of event',\"number\") }}",
        "timeMin": "={{ $fromAI('start','start date in format \"2017-07-01T13:00:00+02:00\"') }}",
        "timeMax": "={{ $fromAI('end','end date in format \"2017-07-01T13:00:00+02:00\"') }}",
        "options": {}
      },
      "id": "ef62f7b9-2288-48dc-bbf5-50aa8162774c",
      "name": "Get calendar events",
      "type": "n8n-nodes-base.googleCalendarTool",
      "position": [
        -380,
        2120
      ],
      "typeVersion": 1.3,
      "credentials": {
        "googleCalendarOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {},
      "id": "aae398e9-16e2-4662-9342-238e7e63f91d",
      "name": "When clicking \u2018Test workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        200,
        100
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "resource": "thread",
        "filters": {}
      },
      "id": "def40eed-bd25-446e-80ff-7cf858723943",
      "name": "Gmail - get recent Threads",
      "type": "n8n-nodes-base.gmail",
      "position": [
        500,
        300
      ],
      "typeVersion": 2.1,
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "resource": "thread",
        "operation": "get",
        "threadId": "={{ $json.id }}",
        "options": {}
      },
      "id": "ab79a5b2-539b-4914-b29c-0950e4177417",
      "name": "Gmail1",
      "type": "n8n-nodes-base.gmail",
      "position": [
        720,
        300
      ],
      "typeVersion": 2.1,
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "id": "c2d4d9f7-37ef-4865-80b6-0acf442148d7",
      "name": "Embeddings OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        1140,
        620
      ],
      "typeVersion": 1.2,
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsonMode": "expressionData",
        "jsonData": "={{ $json.emailSummary }}",
        "options": {
          "metadata": {
            "metadataValues": [
              {
                "name": "threadId",
                "value": "={{ $json.id }}"
              }
            ]
          }
        }
      },
      "id": "baa41c3b-eb06-45ed-a774-85cd57125da5",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        1380,
        480
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "chunkSize": 2000
      },
      "id": "b810adfa-733d-4909-9386-1add795106a2",
      "name": "Token Splitter",
      "type": "@n8n/n8n-nodes-langchain.textSplitterTokenSplitter",
      "position": [
        1400,
        620
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const result = {}\n\nfunction summarizeConversation(messages) {\n  return messages.map(msg => {\n    const date = new Date(Number(msg.internalDate)).toISOString();\n    return `\n\n\ud83d\udcc5 ${date}\n\ud83d\udce8 From: ${msg.From}\n\ud83d\udce5 To: ${msg.To}\n\ud83d\udccc Subject: ${msg.Subject}\n\n${msg.snippet}\n`.trim();\n  }).join(\"\\n\\n-----------------------\\n\\n\");\n}\n\n$json.emailSummary = summarizeConversation($json.messages);\n\nreturn $json;"
      },
      "id": "0793538a-d128-4f6d-9570-b185c925a953",
      "name": "Code - Summarize Email Thread as Text",
      "type": "n8n-nodes-base.code",
      "position": [
        940,
        300
      ],
      "typeVersion": 2
    },
    {
      "parameters": {
        "options": {}
      },
      "id": "ec285e93-8021-431d-839f-4810c404d719",
      "name": "Embeddings OpenAI1",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        220,
        2320
      ],
      "typeVersion": 1.2,
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "id": "e67d1b92-5c31-4e65-898e-ca3e64411d54",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        520,
        2300
      ],
      "typeVersion": 1.2,
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Call the Gmail API to delete an email. Always request the email message id before calling this tool.",
        "operation": "delete",
        "messageId": "={{ $fromAI('Message_ID', ``, 'string') }}"
      },
      "id": "a29fe687-77cf-47f7-baec-ff4aa5aa3646",
      "name": "Delete an email",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        -40,
        1560
      ],
      "typeVersion": 2.1,
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Call Gmail API to create a Draft message as Reply To an existing email or email thread. Pass the correct Thread-Id of the message. To get the Thread ID call the Get Email Tool before.",
        "resource": "draft",
        "subject": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Subject', ``, 'string') }}",
        "message": "={{ $fromAI('Message', `The Text that should be send in reply`, 'string') }}",
        "options": {
          "threadId": "={{ $fromAI('thread-ID', `The ID of the thread. Need to be received from the Email Tool Response. Use the exact ID and better call the Get Email Tool again`, 'string') }}",
          "sendTo": "={{ $fromAI('To_Email', `The email adress of the sender`, 'string') }}"
        }
      },
      "id": "ce8fffa6-c0fc-4dac-8677-fee3c524ad52",
      "name": "Create an Email Draft as response to a thread",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        -380,
        1760
      ],
      "typeVersion": 2.1,
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Call Gmail API to create a New outgoing Draft message.",
        "resource": "draft",
        "subject": "={{ $fromAI('Subject', ``, 'string') }}",
        "message": "={{ $fromAI('Message', `The Text that should be send in reply`, 'string') }}",
        "options": {
          "sendTo": "={{ $fromAI('To_Email', `The email adress of the sender`, 'string') }}"
        }
      },
      "id": "caa03105-39d9-437c-81b3-bbeadb80204e",
      "name": "Create an New Email Draft",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        -200,
        1560
      ],
      "typeVersion": 2.1,
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "content": "## Email Access Tools",
        "height": 480,
        "width": 520,
        "color": 6
      },
      "id": "76e43798-a028-4dd4-8a8d-8462486e83ac",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -420,
        1480
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "content": "## Calender Access Tools",
        "height": 500,
        "width": 520,
        "color": 6
      },
      "id": "814b9d41-3542-4174-bfea-4e99b280254a",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -420,
        1980
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Consume Google Calendar API to add a new event or meeting to the calender",
        "calendar": {
          "__rl": true,
          "value": "anaue736@gmail.com",
          "mode": "list",
          "cachedResultName": "anaue.100@hotmail.com"
        },
        "start": "={{ $fromAI('Start', ``, 'string') }}",
        "end": "={{ $fromAI('End', ``, 'string') }}",
        "useDefaultReminders": "={{ $fromAI('Use_Default_Reminders', ``, 'boolean') }}",
        "additionalFields": {
          "description": "={{ $fromAI('Description', ``, 'string') }}",
          "summary": "={{ $fromAI('Summary', ``, 'string') }}"
        }
      },
      "id": "0e942d13-3c2f-4e88-bc1f-4e47695c1097",
      "name": "Add an calender entry",
      "type": "n8n-nodes-base.googleCalendarTool",
      "position": [
        -20,
        2120
      ],
      "typeVersion": 1.3,
      "credentials": {
        "googleCalendarOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "content": "## Knowlede about past email conversations",
        "height": 600,
        "width": 520,
        "color": 5
      },
      "id": "866f7032-5247-46fd-9c2b-cdde7bf0503a",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        120,
        1880
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "filters": {}
      },
      "id": "3e04af54-3816-41d8-94cc-a7d183c88088",
      "name": "Gmail Trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -1400,
        320
      ],
      "typeVersion": 1.2,
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini",
          "cachedResultName": "gpt-4.1-mini"
        },
        "options": {}
      },
      "id": "347e207e-7df1-4322-b020-3e946f8bec4b",
      "name": "OpenAI Chat Model2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1080,
        560
      ],
      "typeVersion": 1.2,
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "disabled": true
    },
    {
      "parameters": {
        "operation": "addLabels",
        "messageId": "={{ $json.id }}",
        "labelIds": [
          "Label_4725571417728382593"
        ]
      },
      "id": "d742a560-1802-4e50-95ed-a80d23adea53",
      "name": "Gmail label as kunde",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -440,
        220
      ],
      "typeVersion": 2.1,
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "content": "## Email Thread Knowledge adder",
        "height": 780,
        "width": 1680,
        "color": 6
      },
      "id": "8d2228cd-985a-40da-93e0-8d117c5de795",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        100,
        -40
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Consume the Gmail API to receive an email by message-id",
        "operation": "get",
        "messageId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Message_ID', ``, 'string') }}"
      },
      "id": "71db6992-bdc1-42f4-9e78-4b04838f412d",
      "name": "Get an email by MessageID",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        -40,
        1760
      ],
      "typeVersion": 2.1,
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "description": "Can answer questions and do research in previous email conversations. Use this tool whenever you need more context about past conversations to an email. \nFor better retrieval and more context always pass the email-adresses to the query!\n"
      },
      "id": "88109344-0b5d-487f-baa2-db45c389e0b7",
      "name": "Research context and infos in previous conversations",
      "type": "@n8n/n8n-nodes-langchain.toolVectorStore",
      "position": [
        240,
        2000
      ],
      "typeVersion": 1.1
    },
    {
      "parameters": {
        "operation": "addLabels",
        "messageId": "={{ $json.id }}",
        "labelIds": [
          "Label_749967004333244217"
        ]
      },
      "id": "9ae3f37e-6de3-44fc-8d73-eef6b711700b",
      "name": "Gmail - Label as Colleges",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -440,
        60
      ],
      "typeVersion": 2.1,
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "inputText": "=Email Subject: {{ $json.Subject }}\n\nEMail From: {{ $json.From }}\n\n------\n##Email Snippet: \n{{ $json.snippet }}\n\n",
        "categories": {
          "categories": [
            {
              "category": "Kollegen",
              "description": "any email from colleagues with the sender @example.com"
            },
            {
              "category": "Kunden",
              "description": "Every email with an existing contact in the CRM or that sounds like a customer.|Also mails that sound like a customer inquiry and mails that show a project reference."
            }
          ]
        },
        "options": {
          "fallback": "other"
        }
      },
      "id": "a8723748-350a-4424-aac1-11123cdce031",
      "name": "Classify Emails",
      "type": "@n8n/n8n-nodes-langchain.textClassifier",
      "position": [
        -1080,
        180
      ],
      "typeVersion": 1,
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "mode": "insert",
        "clearStore": true
      },
      "id": "126aac06-39c0-4085-97bd-a4d42c23dc23",
      "name": "Write - Threads History Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
      "position": [
        1260,
        300
      ],
      "typeVersion": 1.1
    },
    {
      "parameters": {
        "mode": "load",
        "prompt": "workshop",
        "topK": 100
      },
      "id": "f06b6f4b-1718-45ab-8015-3adc4bf50e36",
      "name": "Read- Threads History Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
      "position": [
        1180,
        100
      ],
      "typeVersion": 1.1
    },
    {
      "parameters": {},
      "id": "f443338f-df8f-4ff1-bd94-e1fa9265c2a2",
      "name": "Threads History Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
      "position": [
        160,
        2160
      ],
      "typeVersion": 1.1
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Formats the date in the name of the day of the week. Always use this before you output weekdays.",
        "operation": "formatDate",
        "date": "={{ $fromAI('Date', ``, 'string') }}",
        "format": "custom",
        "customFormat": "EEEE dd MM ",
        "outputFieldName": "=formattedDate",
        "options": {}
      },
      "id": "a8f42274-2d64-4e86-ac65-653f270eacaa",
      "name": "Determine the name of the day of the week",
      "type": "n8n-nodes-base.dateTimeTool",
      "position": [
        -280,
        2320
      ],
      "typeVersion": 2
    },
    {
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegramTrigger",
      "typeVersion": 1.2,
      "position": [
        -400,
        1240
      ],
      "id": "a77d7569-8cd7-440d-b8bc-c26bdf0c4785",
      "name": "Telegram Trigger",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "sendTo": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('To', ``, 'string') }}",
        "subject": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Subject', ``, 'string') }}",
        "message": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Message', ``, 'string') }}",
        "options": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.gmailTool",
      "typeVersion": 2.1,
      "position": [
        -200,
        1760
      ],
      "id": "2c638eac-91af-48a2-b468-461e5618ef15",
      "name": "Gmail",
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "delete",
        "calendar": {
          "__rl": true,
          "value": "anaue736@gmail.com",
          "mode": "list",
          "cachedResultName": "anaue.100@hotmail.com"
        },
        "eventId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Event_ID', ``, 'string') }}",
        "options": {}
      },
      "type": "n8n-nodes-base.googleCalendarTool",
      "typeVersion": 1.3,
      "position": [
        -200,
        2120
      ],
      "id": "85a17293-1497-47b0-a6b4-8909bd7c3a5c",
      "name": "Google Calendar",
      "credentials": {
        "googleCalendarOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "options": {
          "gl": "br",
          "google_domain": "google.com",
          "hl": "=pt"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.toolSerpApi",
      "typeVersion": 1,
      "position": [
        1820,
        1680
      ],
      "id": "e4b798d9-aeef-44b1-8027-857b50bf79d4",
      "name": "SerpAPI",
      "credentials": {
        "serpApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Consume Google Calendar API to add a new event or meeting to the calender",
        "operation": "update",
        "calendar": {
          "__rl": true,
          "value": "anaue736@gmail.com",
          "mode": "list",
          "cachedResultName": "anaue.100@hotmail.com"
        },
        "eventId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Event_ID', ``, 'string') }}",
        "updateFields": {}
      },
      "id": "813c99aa-6ae3-4d47-95af-1a32578d890a",
      "name": "Add an calender entry1",
      "type": "n8n-nodes-base.googleCalendarTool",
      "position": [
        -100,
        2320
      ],
      "typeVersion": 1.3,
      "credentials": {
        "googleCalendarOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "download",
        "path": "/Rag/embeddings_part_04.json"
      },
      "type": "n8n-nodes-base.dropbox",
      "typeVersion": 1,
      "position": [
        2240,
        120
      ],
      "id": "f7171d49-aad3-4dea-9cc7-c665ee065487",
      "name": "Dropbox",
      "credentials": {
        "dropboxApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "mode": "insert",
        "qdrantCollection": {
          "__rl": true,
          "value": "=anaue_dados",
          "mode": "id"
        },
        "embeddingBatchSize": 1536,
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "typeVersion": 1.1,
      "position": [
        2860,
        120
      ],
      "id": "b5c4c67f-8c0c-455d-ad61-3c51ae3d5a26",
      "name": "Qdrant Vector Store",
      "credentials": {
        "qdrantApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.1,
      "position": [
        1980,
        120
      ],
      "id": "d9d9a3d8-fb80-4044-b82e-a423eb039d2f",
      "name": "When chat message received"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "typeVersion": 1.2,
      "position": [
        2720,
        360
      ],
      "id": "863b8c5f-c028-40d3-83d6-3280c8a6f24b",
      "name": "Embeddings OpenAI2",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "fromJson",
        "options": {}
      },
      "type": "n8n-nodes-base.extractFromFile",
      "typeVersion": 1,
      "position": [
        2520,
        120
      ],
      "id": "141551cb-4d62-497c-9d30-9438313b35ed",
      "name": "Extract from File"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "typeVersion": 1,
      "position": [
        2980,
        480
      ],
      "id": "a1fc6caa-e9ea-4348-8fca-8b4e69d413f2",
      "name": "Default Data Loader1"
    },
    {
      "parameters": {
        "separator": "%",
        "chunkSize": 300,
        "chunkOverlap": 150
      },
      "type": "@n8n/n8n-nodes-langchain.textSplitterCharacterTextSplitter",
      "typeVersion": 1,
      "position": [
        3060,
        580
      ],
      "id": "3b310449-1f2e-4255-9081-e665a66a3230",
      "name": "Character Text Splitter"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-4-turbo",
          "mode": "list",
          "cachedResultName": "gpt-4-turbo"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        1500,
        1680
      ],
      "id": "f094a230-94fe-4a77-ab94-68fe801087de",
      "name": "OpenAI Chat Model3",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $('Telegram Trigger').item.json.message.message_id }}",
        "contextWindowLength": 10
      },
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        1660,
        1680
      ],
      "id": "de6c4609-97bf-4214-9a60-65424c63e78b",
      "name": "Simple Memory1"
    },
    {
      "parameters": {
        "content": "## Treinamento Rag Externo\n\n",
        "height": 780,
        "width": 1420,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1880,
        -40
      ],
      "typeVersion": 1,
      "id": "30fca07d-1234-4fb1-a172-e1f325ab6eda",
      "name": "Sticky Note7"
    },
    {
      "parameters": {
        "mode": "retrieve-as-tool",
        "toolName": "notion_memory",
        "toolDescription": "Used to look up and retrieve relevant passages from my personal Notion-based knowledge stored in Qdrant.\n",
        "qdrantCollection": {
          "__rl": true,
          "value": "anaue_dados",
          "mode": "list",
          "cachedResultName": "anaue_dados"
        },
        "topK": 8,
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "typeVersion": 1.1,
      "position": [
        180,
        1580
      ],
      "id": "670b056e-6699-45ab-98c6-5ffbc4a5fe3f",
      "name": "Qdrant Vector Store3",
      "credentials": {
        "qdrantApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "typeVersion": 1.2,
      "position": [
        460,
        1700
      ],
      "id": "f60e8e0e-8b0e-4bb0-be29-e5a743186acf",
      "name": "Embeddings OpenAI4",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "mode": "insert",
        "qdrantCollection": {
          "__rl": true,
          "value": "=anaue_dados",
          "mode": "id"
        },
        "embeddingBatchSize": 1536,
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "typeVersion": 1.1,
      "position": [
        780,
        2020
      ],
      "id": "e1450625-5acc-4998-8169-67c49db106d8",
      "name": "Qdrant Vector Store1",
      "credentials": {
        "qdrantApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "typeVersion": 1.2,
      "position": [
        860,
        2200
      ],
      "id": "55e20731-6c87-4eb0-80af-7670c79ee0c5",
      "name": "Embeddings OpenAI3",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "typeVersion": 1,
      "position": [
        980,
        2200
      ],
      "id": "9117fb89-ba88-49ff-8ef3-d71178e4e08c",
      "name": "Default Data Loader2"
    },
    {
      "parameters": {
        "separator": "%",
        "chunkSize": 300,
        "chunkOverlap": 150
      },
      "type": "@n8n/n8n-nodes-langchain.textSplitterCharacterTextSplitter",
      "typeVersion": 1,
      "position": [
        1140,
        2320
      ],
      "id": "4d93d932-0518-4c68-9986-84e4cca112bd",
      "name": "Character Text Splitter1"
    },
    {
      "parameters": {
        "content": "## Treinamento Rag Automatico\n",
        "height": 1000,
        "width": 800,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        660,
        1480
      ],
      "typeVersion": 1,
      "id": "3e3b7e61-d8ea-43e1-9024-62a9e8dcc58a",
      "name": "Sticky Note8"
    },
    {
      "parameters": {
        "content": "## Inteligencia RAG\n",
        "height": 380,
        "width": 520,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        120,
        1480
      ],
      "typeVersion": 1,
      "id": "6b359eea-2717-448f-8897-8bf24a9cf405",
      "name": "Sticky Note9"
    },
    {
      "parameters": {
        "content": "## Email Sorting Agent\n",
        "height": 720,
        "width": 1500,
        "color": 6
      },
      "id": "e2efa189-0c18-41d6-bf13-205aa1313421",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1520,
        20
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "jsonSchemaExample": "{\n  \"should_index\": true\n}\n"
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.2,
      "position": [
        940,
        1800
      ],
      "id": "cacd8c47-6333-432b-8165-11f2d0666db9",
      "name": "Structured Output Parser1"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "94c3dd10-0a2d-4305-9bbd-c285255c786f",
              "name": "text",
              "value": "={{ $json.message.text }}",
              "type": "string"
            },
            {
              "id": "dc17005e-557a-4591-afcc-9a5a71ca4bc3",
              "name": "message.voice",
              "value": "={{ $json.message.voice }}",
              "type": "object"
            },
            {
              "id": "9eb78425-83bf-4668-9dfa-aace4a881ee9",
              "name": "data",
              "value": "",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -200,
        1240
      ],
      "id": "e448ca32-3533-4b1b-bdad-481b8bcd2923",
      "name": "\u00c1udio/Texto "
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "eaf6838e-6baa-499c-8a99-7a9abcabdb73",
                    "leftValue": "={{ $json.text }}",
                    "rightValue": "",
                    "operator": {
                      "type": "string",
                      "operation": "notEmpty",
                      "singleValue": true
                    }
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.message.voice.file_id }}\n",
                    "rightValue": "",
                    "operator": {
                      "type": "string",
                      "operation": "notEmpty",
                      "singleValue": true
                    },
                    "id": "a7fe2b82-5bf6-4bf7-91c0-f92509f28c0e"
                  }
                ],
                "combinator": "and"
              }
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        -40,
        1240
      ],
      "id": "0c52cf09-a5fa-4537-ad67-2554f9024dac",
      "name": "IF audio/texto"
    },
    {
      "parameters": {
        "resource": "file",
        "fileId": "={{ $json[\"message\"][\"voice\"][\"file_id\"] }}"
      },
      "id": "3060dcd0-7914-4fe0-be30-3f3aeb582a8e",
      "name": "Baixar audio",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1,
      "position": [
        240,
        1080
      ],
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "resource": "audio",
        "operation": "transcribe",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        440,
        1080
      ],
      "id": "234a6e5d-1ec9-4e2d-ad5b-0d6cf6c443ec",
      "name": "Transcrever o audio",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "90e830aa-574a-4bf4-8f6b-c670495c2cab",
              "name": "chatInput",
              "value": "={{ $json.text }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        720,
        1220
      ],
      "id": "244fcf26-61f9-4af7-92af-ed23293206ac",
      "name": "audio/texto = text (rename)"
    },
    {
      "parameters": {
        "options": {
          "timezone": "America/Sao_Paulo"
        }
      },
      "type": "n8n-nodes-base.dateTime",
      "typeVersion": 2,
      "position": [
        900,
        1220
      ],
      "id": "f38e81f9-f5c0-4704-b1bf-a19e6bdb67dd",
      "name": "Dia de hoje",
      "alwaysOutputData": true,
      "executeOnce": true
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "90e830aa-574a-4bf4-8f6b-c670495c2cab",
              "name": "chatInput",
              "value": "={{ $('audio/texto = text (rename)').item.json.chatInput }}",
              "type": "string"
            },
            {
              "id": "78bd083b-81b9-46b4-8c7d-abf1fb5172cb",
              "name": "messageId",
              "value": "={{ $('Telegram Trigger').item.json.message.message_id }}",
              "type": "string"
            },
            {
              "id": "8b54f1ae-f37b-41e7-8b22-750ff87972ad",
              "name": "SessionId",
              "value": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
              "type": "string"
            },
            {
              "id": "8d9186e3-9be7-4806-9ec8-17b68036ed5e",
              "name": "Data de hoje",
              "value": "={{ $('Dia de hoje').item.json.currentDate }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1080,
        1220
      ],
      "id": "e267c4b9-9746-47fe-b535-49cefdde1d70",
      "name": "Puxar informa\u00e7\u00f5es "
    },
    {
      "parameters": {
        "options": {
          "systemMessage": "seu nome \u00e9 alfred voc\u00ea \u00e9 um agente pessoal de conversa que gerencia o gmail e o google calendar"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2,
      "position": [
        1400,
        1220
      ],
      "id": "9fed23a0-c1f8-46af-b95d-0e9cf2b65896",
      "name": "Alfred (Agent)"
    },
    {
      "parameters": {
        "jsCode": "return [\n  {\n    json: {\n      textoLimpo: $json.output\n        .replace(/\\*\\*/g, '')              // Remove negrito\n        .replace(/\\\\n/g, ' ')              // Remove \"\\n\"\n        .replace(/\\s+/g, ' ')              // Remove espa\u00e7os extras\n        .trim()\n    }\n  }\n];\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1000,
        940
      ],
      "id": "4bfbaafc-e0f2-4eec-bf77-9bea5616d058",
      "name": "Responder em audio"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.elevenlabs.io/v1/text-to-speech/qarDw4DEvUqP3FBlpO0T",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "xi-api-key",
              "value": "sk_669ea5ff93fe9027be87b7b057906037452ef3c3086c3933"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "contentType": "raw",
        "rawContentType": "application/json",
        "body": "={   \"text\": \"{{ $json.textoLimpo }}\",   \"model_id\": \"eleven_monolingual_v1\",   \"voice_settings\": {     \"stability\": 0.5,     \"similarity_boost\": 0.75   } }",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1320,
        940
      ],
      "id": "cfcef4cf-a3f4-41f3-b856-000df00c3321",
      "name": "Eleven Labs"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=mensagem a ser classificada: {{ $json.chatInput }}\n\nVoc\u00ea \u00e9 um **classificador de indexa\u00e7\u00e3o de mem\u00f3ria** que recebe apenas o texto exato de uma mensagem enviada pelo usu\u00e1rio.  \nSeu trabalho \u00e9 DECIDIR SE ESSA MENSAGEM DEVE SER SALVA como \u201cmem\u00f3ria\u201d (ou \u201cnota\u201d) em um banco vetorial (Qdrant).  \n\n\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013  \n\ud83d\udd34 **A SA\u00cdDA DEVE SER UM \u00daNICO OBJETO JSON V\u00c1LIDO. N\u00c3O RETORNE QUALQUER TEXTO ANTES OU DEPOIS.**  \n\n1. Se a mensagem **dever ser salva**, retorne EXATAMENTE:\njson\n{\n  \"should_index\": true,\n  \"memory_text\": \"<texto exato a ser salvo>\"\n}\nSe a mensagem N\u00c3O for para salvar, retorne EXATAMENTE:\n\njson\nCopiar\nEditar\n{\n  \"should_index\": false\n}\nNada al\u00e9m disso deve ser retornado.\n\n\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\n\nQuando SALVAR (should_index: true)\nMarque true quando QUALQUER uma das condi\u00e7\u00f5es abaixo for verdadeira:\n\n\u2705 1. Come\u00e7a com prefixos de inten\u00e7\u00e3o clara (case-insensitive):\n\"Tarefa anotada:\"\n\n\"Tarefa:\"\n\n\"Anota\u00e7\u00e3o:\"\n\n\"Nota:\"\n\n\"Lembrete:\"\n\n\"Registrar:\"\n\n\"Registrar isso:\"\n\n\"Crie uma nota:\"\n\n\"Crie uma tarefa:\"\n\n\u2705 2. Cont\u00e9m verbos comuns relacionados a lembrar/salvar/planejar:\nSe o texto contiver qualquer uma das seguintes palavras ou express\u00f5es (mesmo dentro de frases informais), considere should_index: true:\n\nanotar, registrar, salvar, lembrar, agendar, planejar, programar, criar tarefa, adicionar tarefa, marcar, armazenar\n\n\u201cme lembre\u201d, \u201cme avise\u201d, \u201cn\u00e3o esquecer\u201d, \u201cn\u00e3o posso esquecer\u201d, \u201cdeixar registrado\u201d\n\nExemplos v\u00e1lidos:\n\n\u201cAnota a\u00ed que preciso revisar os contratos segunda.\u201d\n\n\u201cPode salvar isso como uma tarefa pra amanh\u00e3?\u201d\n\n\u201cLembrar de mandar mensagem pra Fernanda depois da reuni\u00e3o.\u201d\n\n\u2705 3. Instru\u00e7\u00f5es para o futuro (mesmo que sem verbo espec\u00edfico):\nSe a mensagem indicar qualquer tipo de a\u00e7\u00e3o futura, mesmo de forma informal ou sem verbo de \"salvar\", considere como tarefa:\n\nExemplos v\u00e1lidos:\n\n\u201cPassar no banco antes das 17h.\u201d\n\n\u201cRevisar o v\u00eddeo amanh\u00e3 de manh\u00e3.\u201d\n\n\u201cResponder e-mail da Mariana at\u00e9 sexta.\u201d\n\n\u2705 4. Informa\u00e7\u00e3o \u00fatil, pessoal, e com mais de 50 caracteres:\nMesmo sem verbo de a\u00e7\u00e3o, se o texto trouxer uma informa\u00e7\u00e3o com contexto relevante, como planos, compromissos ou decis\u00f5es, e tiver mais de 50 caracteres, considere como nota:\n\nExemplos v\u00e1lidos:\n\n\u201cEstou pensando em lan\u00e7ar o curso s\u00f3 depois do feriado, quando a audi\u00eancia estiver mais ativa.\u201d\n\n\u201cEssa semana quero focar s\u00f3 nos conte\u00fados de funil intermedi\u00e1rio.\u201d\n\n\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\n\nQuando N\u00c3O SALVAR (should_index: false)\nMarque false nos seguintes casos:\n\n\u274c 1. Mensagens gen\u00e9ricas de bate-papo:\n\u201cOi, tudo bem?\u201d\n\n\u201cHahaha boa!\u201d\n\n\u201cKkkk entendi.\u201d\n\n\u201cSim, claro.\u201d\n\n\u274c 2. Coment\u00e1rios ou perguntas sem a\u00e7\u00e3o futura:\n\u201cVoc\u00ea acha que esse t\u00edtulo ficou bom?\u201d\n\n\u201cGostei desse formato!\u201d\n\n\u201cE se us\u00e1ssemos outra abordagem?\u201d\n\n\u274c 3. Rea\u00e7\u00f5es, emo\u00e7\u00f5es ou elogios sem valor de contexto futuro:\n\u201cQue legal isso!\u201d\n\n\u201cVoc\u00ea \u00e9 demais.\u201d\n\n\u201cIsso me deu uma ideia\u201d \u2190 (a menos que a ideia venha depois)\n\n\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\nLEMBRE-SE: A sa\u00edda \u00e9 apenas o JSON puro. N\u00e3o inclua nenhuma explica\u00e7\u00e3o ou coment\u00e1rio.\n\n{{ $json.messageId }}\n{{ $json.SessionId }}\n{{ $json['Data de hoje'] }}\n{{ $json.Autor }}",
        "hasOutputParser": true,
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2,
      "position": [
        860,
        1600
      ],
      "id": "2ad306f9-5b19-4b3f-9d9b-7c94e86e1f8c",
      "name": "Identifica se deve guardar informa\u00e7\u00e3o no RAG"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.output.should_index }}",
                    "rightValue": "",
                    "operator": {
                      "type": "boolean",
                      "operation": "true",
                      "singleValue": true
                    },
                    "id": "4104bb68-0283-4a87-9974-c81c1bfe1acf"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Indexar"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "3710464f-1195-4785-92cf-275064bca233",
                    "leftValue": "={{ $json.output.should_index }}",
                    "rightValue": "",
                    "operator": {
                      "type": "boolean",
                      "operation": "false",
                      "singleValue": true
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "NaoIndexar"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        1220,
        1600
      ],
      "id": "b01a4706-fceb-4d9a-b768-27c2aeabee4f",
      "name": "IF guardar/n\u00e3o guardar"
    },
    {
      "parameters": {
        "options": {
          "timezone": "America/Sao_Paulo"
        }
      },
      "type": "n8n-nodes-base.dateTime",
      "typeVersion": 2,
      "position": [
        1120,
        1800
      ],
      "id": "debe8214-ed6b-4371-bdd0-e40e83cbb470",
      "name": "Dia de hoje1",
      "alwaysOutputData": true,
      "executeOnce": true
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "90e830aa-574a-4bf4-8f6b-c670495c2cab",
              "name": "chatInput",
              "value": "={{ $('audio/texto = text (rename)').item.json.chatInput }}",
              "type": "string"
            },
            {
              "id": "78bd083b-81b9-46b4-8c7d-abf1fb5172cb",
              "name": "messageId",
              "value": "={{ $('Telegram Trigger').item.json.message.message_id }}",
              "type": "string"
            },
            {
              "id": "8b54f1ae-f37b-41e7-8b22-750ff87972ad",
              "name": "SessionId",
              "value": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
              "type": "string"
            },
            {
              "id": "8d9186e3-9be7-4806-9ec8-17b68036ed5e",
              "name": "Data de hoje",
              "value": "={{ $('Dia de hoje').item.json.currentDate }}",
              "type": "string"
            },
            {
              "id": "e03e2d17-0d15-406e-bc36-c0bec51df9ce",
              "name": "Autor",
              "value": "={{ $('Telegram Trigger').item.json.message.chat.first_name }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1280,
        1800
      ],
      "id": "6b492851-50ca-4dc0-bee0-949990505c07",
      "name": "Puxar informa\u00e7\u00f5es 1"
    },
    {
      "parameters": {
        "jsCode": "",
        "specifyInputSchema": true
      },
      "type": "@n8n/n8n-nodes-langchain.toolCode",
      "typeVersion": 1.2,
      "position": [
        1980,
        1680
      ],
      "id": "a72a9169-9786-437e-8a20-246820a4bcbf",
      "name": "Code Tool"
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "text": "={{ $json.output }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        1780,
        1220
      ],
      "id": "7f5769af-637a-47d2-8978-29ad23ca42e2",
      "name": "Telegram",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "90e830aa-574a-4bf4-8f6b-c670495c2cab",
              "name": "chatInput",
              "value": "={{ $json.output }}",
              "type": "string"
            },
            {
              "id": "78bd083b-81b9-46b4-8c7d-abf1fb5172cb",
              "name": "messageId",
              "value": "={{ $('Telegram Trigger').item.json.message.message_id }}",
              "type": "string"
            },
            {
              "id": "8b54f1ae-f37b-41e7-8b22-750ff87972ad",
              "name": "SessionId",
              "value": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
              "type": "string"
            },
            {
              "id": "8d9186e3-9be7-4806-9ec8-17b68036ed5e",
              "name": "Data de hoje",
              "value": "={{ $('Dia de hoje').item.json.currentDate }}",
              "type": "string"
            },
            {
              "id": "e03e2d17-0d15-406e-bc36-c0bec51df9ce",
              "name": "Autor",
              "value": "={{ $('Telegram Trigger').item.json.message.chat.first_name }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        720,
        1600
      ],
      "id": "8bc867db-5b02-4a7a-859d-a98c66119770",
      "name": "Puxar informa\u00e7\u00f5es 2"
    },
    {
      "parameters": {
        "operation": "delete",
        "tableId": "tarefas"
      },
      "type": "n8n-nodes-base.supabaseTool",
      "typeVersion": 1,
      "position": [
        1980,
        2140
      ],
      "id": "df0e4d74-8e55-45ec-8369-534a843c9cef",
      "name": "Supabase - Tarefas6",
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "tableId": "tarefas",
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": "id",
              "fieldValue": "={{ $json.messageId }}"
            },
            {
              "fieldId": "titulo",
              "fieldValue": "={{ $fromAI(\"title\", \"T\u00edtulo padr\u00e3o\") }}"
            },
            {
              "fieldId": "prazo",
              "fieldValue": "={{ $fromAI(\"prazo\", \"2025-12-31\") }}"
            },
            {
              "fieldId": "status",
              "fieldValue": "={{ $fromAI(\"status\", \"pendente\") }}"
            },
            {
              "fieldId": "prioridade",
              "fieldValue": "={{ $fromAI(\"prioridade\", \"media\") }}"
            },
            {
              "fieldId": "origem",
              "fieldValue": "={{ $fromAI(\"origem\", \"agente\") }}"
            },
            {
              "fieldId": "criado_em",
              "fieldValue": "={{ $fromAI(\"criado_em\", \"data\") }}"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.supabaseTool",
      "typeVersion": 1,
      "position": [
        1860,
        2140
      ],
      "id": "47590839-9cbe-4ad7-916d-1c4f253e2621",
      "name": "Supabase - Tarefas1",
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "hasOutputParser": true,
        "options": {
          "systemMessage": "=# Papel e Objetivo\nVoc\u00ea \u00e9 um assistente de IA avan\u00e7ado que funciona como o c\u00e9rebro de um sistema de automa\u00e7\u00e3o. Sua fun\u00e7\u00e3o \u00e9 analisar a linguagem natural do usu\u00e1rio e determinar qual ferramenta de software (`tool`) deve ser acionada para cumprir o pedido. Sua resposta deve ser **exclusivamente a chamada da ferramenta selecionada**, sem nenhum texto ou explica\u00e7\u00e3o adicional.\n\n# Ferramentas Dispon\u00edveis\nVoc\u00ea tem acesso \u00e0s seguintes ferramentas:\n\n### 1. Ferramenta: `criar_tarefa`\n- **Descri\u00e7\u00e3o**: Use esta ferramenta para criar uma nova tarefa, um item de a\u00e7\u00e3o ou um lembrete. Ideal para quando o usu\u00e1rio expressa a necessidade de FAZER algo concreto.\n- **Par\u00e2metros**:\n    - `titulo` (string, obrigat\u00f3rio): Um resumo curto e direto da a\u00e7\u00e3o.\n    - `descricao` (string, opcional): Detalhes adicionais sobre a tarefa.\n    - `prazo` (string, opcional): A data final no formato AAAA-MM-DD.\n    - `prioridade` (string, opcional): A urg\u00eancia da tarefa. Valores poss\u00edveis: \"baixa\", \"m\u00e9dia\", \"alta\".\n    - `contexto` (string, opcional): Onde a tarefa se encaixa (ex: \"pessoal\", \"trabalho\").\n\n### 2. Ferramenta: `salvar_ideia`\n- **Descri\u00e7\u00e3o**: Use esta ferramenta para registrar um conceito, um pensamento, uma sugest\u00e3o ou qualquer informa\u00e7\u00e3o que n\u00e3o seja uma tarefa acion\u00e1vel. Ideal para quando o usu\u00e1rio est\u00e1 PENSANDO em algo para o futuro.\n- **Par\u00e2metros**:\n    - `titulo` (string, obrigat\u00f3rio): Um resumo curto da ideia.\n    - `descricao` (string, opcional): Detalhes adicionais sobre a ideia.\n    - `tags` (array de strings, opcional): Uma lista de palavras-chave que categorizam a ideia.\n\n# Regras de Execu\u00e7\u00e3o\n\n1.  **An\u00e1lise de Inten\u00e7\u00e3o**: Primeiro, determine a inten\u00e7\u00e3o principal do usu\u00e1rio: \u00e9 uma A\u00c7\u00c3O (usar `criar_tarefa`) ou um PENSAMENTO (usar `salvar_ideia`)?\n\n2.  **Interpreta\u00e7\u00e3o de Datas**: Para o par\u00e2metro `prazo`, voc\u00ea DEVE converter datas relativas para o formato `AAAA-MM-DD`. A data de hoje \u00e9 **5 de junho de 2025**.\n    - \"amanh\u00e3\" -> `2025-06-06`\n    - \"depois de amanh\u00e3\" -> `2025-06-07`\n    - \"pr\u00f3xima segunda-feira\" -> `2025-06-09`\n\n3.  **Infer\u00eancia de Dados**: Extraia informa\u00e7\u00f5es do contexto. Se o usu\u00e1rio mencionar \"urgente\" ou \"importante\", use `prioridade: \"alta\"`. Se ele mencionar um projeto ou \u00e1rea da vida, use o `contexto`.\n\n4.  **N\u00e3o Invente Dados**: Se uma informa\u00e7\u00e3o para um par\u00e2metro opcional n\u00e3o estiver no texto, simplesmente n\u00e3o inclua aquele par\u00e2metro na sua resposta.\n\n# Exemplos Pr\u00e1ticos\n\n**Exemplo 1:**\n- **Input do Usu\u00e1rio**: \"preciso agendar para depois de amanh\u00e3 a revis\u00e3o do relat\u00f3rio financeiro. \u00e9 bem urgente e \u00e9 do trabalho.\"\n- **Sua Sa\u00edda Esperada (Chamada da Ferramenta)**:\n```json\n{\n  \"tool\": \"criar_tarefa\",\n  \"parameters\": {\n    \"titulo\": \"Revisar relat\u00f3rio financeiro\",\n    \"prazo\": \"2025-06-07\",\n    \"prioridade\": \"alta\",\n    \"contexto\": \"trabalho\"\n  }\n}\nExemplo 2:\n\nInput do Usu\u00e1rio: \"tive um pensamento sobre um novo app de viagens que usa realidade aumentada. poderia ser um projeto de inova\u00e7\u00e3o.\"\nSua Sa\u00edda Esperada (Chamada da Ferramenta):\nJSON\n\n{\n  \"tool\": \"salvar_ideia\",\n  \"parameters\": {\n    \"titulo\": \"App de viagens com realidade aumentada\",\n    \"descricao\": \"Um novo aplicativo de viagens que usa realidade aumentada como um projeto de inova\u00e7\u00e3o.\",\n    \"tags\": [\"app\", \"viagens\", \"realidade aumentada\", \"inova\u00e7\u00e3o\"]\n  }\n}\n\n### Por que este Prompt \u00e9 Melhor?\n\n1.  **Foco em Ferramentas**: Ele deixa expl\u00edcito desde a primeira linha que o objetivo \u00e9 **escolher e chamar uma ferramenta**, que \u00e9 exatamente como um Agente de Ferramentas funciona.\n2.  **Contrato Claro**: A se\u00e7\u00e3o `# Ferramentas Dispon\u00edveis` funciona como um \"manual de instru\u00e7\u00f5es\" para a IA. Ela sabe exatamente quais ferramentas existem e quais \"pe\u00e7as\" (par\u00e2metros) cada uma precisa.\n3.  **Regras Diretas**: As `# Regras de Execu\u00e7\u00e3o` s\u00e3o mais claras e focadas na a\u00e7\u00e3o de extrair e formatar os par\u00e2metros para a ferramenta, em vez de formatar um JSON gen\u00e9rico.\n4.  **Exemplos Corretos**: Os exemplos mostram o formato de sa\u00edda exato que o sistema de Agente de Ferramentas espera: o nome da ferramenta e um objeto com seus par\u00e2metros. Isso treina a IA a responder da maneira correta para que o n8n possa executar a a\u00e7\u00e3o.\n\nSEMPRE ENVIE PARA O SUPABASE"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2,
      "position": [
        1580,
        1900
      ],
      "id": "a674bd21-d2bd-4f13-a086-fbcd56411d33",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "operation": "update",
        "tableId": "ideias",
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": "titulo",
              "fieldValue": "={{ $fromAI(\"titulo\", \"T\u00edtulo padr\u00e3o\") }}"
            },
            {
              "fieldId": "descricao",
              "fieldValue": "={{ $fromAI(\"descricao\", \"descri\u00e7\u00e3o da ideia\") }}"
            },
            {
              "fieldId": "origem",
              "fieldValue": "={{ $fromAI(\"origem\", \"agente\") }}"
            },
            {
              "fieldId": "criado_em",
              "fieldValue": "={{ $fromAI(\"criado_em\", \"data\") }}"
            },
            {
              "fieldId": "data",
              "fieldValue": "={{ $fromAI(\"data\", \"data da ideia\") }}"
            },
            {
              "fieldId": "tags",
              "fieldValue": "={{ $fromAI(\"tags\", \"marca\u00e7\u00e3o de ideias\") }}"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.supabaseTool",
      "typeVersion": 1,
      "position": [
        1860,
        2320
      ],
      "id": "fb4f178d-d97b-4c07-9b1a-968e3cf02dd5",
      "name": "Supabase - Ideias1",
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "delete",
        "tableId": "ideias"
      },
      "type": "n8n-nodes-base.supabaseTool",
      "typeVersion": 1,
      "position": [
        1980,
        2320
      ],
      "id": "71fcad56-175b-4faa-b512-cc4e28bb2962",
      "name": "Supabase - Ideias2",
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "content": "## SupaBase Front-end\n",
        "height": 660,
        "width": 620
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1480,
        1820
      ],
      "typeVersion": 1,
      "id": "a8ab187b-78f1-47ff-83b6-f052291e027c",
      "name": "Sticky Note10"
    },
    {
      "parameters": {
        "tableId": "ideias",
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": "titulo",
              "fieldValue": "={{ $fromAI(\"titulo\", \"T\u00edtulo padr\u00e3o\") }}"
            },
            {
              "fieldId": "descricao",
              "fieldValue": "={{ $fromAI(\"descricao\", \"descri\u00e7\u00e3o da ideia\") }}"
            },
            {
              "fieldId": "origem",
              "fieldValue": "={{ $fromAI(\"origem\", \"agente\") }}"
            },
            {
              "fieldId": "criado_em",
              "fieldValue": "={{ $fromAI(\"criado_em\", \"data\") }}"
            },
            {
              "fieldId": "data",
              "fieldValue": "={{ $fromAI(\"data\", \"data da ideia\") }}"
            },
            {
              "fieldId": "tags",
              "fieldValue": "={{ $fromAI(\"tags\", \"marca\u00e7\u00e3o de ideias\") }}"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.supabaseTool",
      "typeVersion": 1,
      "position": [
        1740,
        2320
      ],
      "id": "7da4735c-fa2f-44e4-bef2-bb9f924dc7b1",
      "name": "salvar_ideia",
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "tableId": "tarefas",
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": "titulo",
              "fieldValue": "={{ $fromAI(\"titulo\", \"T\u00edtulo padr\u00e3o\") }}"
            },
            {
              "fieldId": "prazo",
              "fieldValue": "={{ $fromAI(\"prazo\", \"2025-12-31\") }}"
            },
            {
              "fieldId": "status",
              "fieldValue": "={{ $fromAI(\"status\", \"pendente\") }}"
            },
            {
              "fieldId": "prioridade",
              "fieldValue": "={{ $fromAI(\"prioridade\", \"media\") }}"
            },
            {
              "fieldId": "origem",
              "fieldValue": "={{ $fromAI(\"origem\", \"agente\") }}"
            },
            {
              "fieldId": "criado_em",
              "fieldValue": "={{ $fromAI(\"criado_em\", \"data\") }}"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.supabaseTool",
      "typeVersion": 1,
      "position": [
        1740,
        2140
      ],
      "id": "43604c5a-96da-4e0b-8fd0-0ec1bbdb9432",
      "name": "create_tarefa",
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "model": "deepseek-reasoner",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatDeepSeek",
      "typeVersion": 1,
      "position": [
        820,
        1800
      ],
      "id": "847ed64c-3c35-4b86-b2f4-afe341d32f99",
      "name": "DeepSeek Chat Model",
      "credentials": {
        "deepSeekApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "model": "deepseek-reasoner",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatDeepSeek",
      "typeVersion": 1,
      "position": [
        1540,
        2140
      ],
      "id": "6de8f13c-8cfa-46d4-89a8-21fc5cc24ed4",
      "name": "DeepSeek Chat Model1",
      "credentials": {
        "deepSeekApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Gmail1": {
      "main": [
        [
          {
            "node": "Code - Summarize Email Thread as Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail Trigger": {
      "main": [
        [
          {
            "node": "Classify Emails",
            "type": "main",
            "index": 0
          },
          {
            "node": "Gmail - get recent Threads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Token Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "Classify Emails": {
      "main": [
        [
          {
            "node": "Gmail - Label as Colleges",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Gmail label as kunde",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Delete an email": {
      "ai_tool": [
        [
          {
            "node": "Alfred (Agent)",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get last emails": {
      "ai_tool": [
        [
          {
            "node": "Alfred (Agent)",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "sessionId-master": {
      "main": [
        [
          {
            "node": "Alfred (Agent)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Read- Threads History Vector Store",
            "type": "ai_embedding",
            "index": 0
          },
          {
            "node": "Write - Threads History Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI1": {
      "ai_embedding": [
        [
          {
            "node": "Threads History Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Research context and infos in previous conversations",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "Classify Emails",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Write - Threads History Vector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Get calendar events": {
      "ai_tool": [
        [
          {
            "node": "Alfred (Agent)",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Add an calender entry": {
      "ai_tool": [
        [
          {
            "node": "Alfred (Agent)",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Create an New Email Draft": {
      "ai_tool": [
        [
          {
            "node": "Alfred (Agent)",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get an email by MessageID": {
      "ai_tool": [
        [
          {
            "node": "Alfred (Agent)",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Gmail - get recent Threads": {
      "main": [
        [
          {
            "node": "Gmail1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Threads History Vector Store": {
      "ai_vectorStore": [
        [
          {
            "node": "Research context and infos in previous conversations",
            "type": "ai_vectorStore",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Test workflow\u2019": {
      "main": [
        [
          {
            "node": "Gmail - get recent Threads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code - Summarize Email Thread as Text": {
      "main": [
        [
          {
            "node": "Write - Threads History Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Determine the name of the day of the week": {
      "ai_tool": [
        [
          {
            "node": "Alfred (Agent)",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Create an Email Draft as response to a thread": {
      "ai_tool": [
        [
          {
            "node": "Alfred (Agent)",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Research context and infos in previous conversations": {
      "ai_tool": [
        [
          {
            "node": "Alfred (Agent)",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "\u00c1udio/Texto ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail": {
      "ai_tool": [
        [
          {
            "node": "Alfred (Agent)",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Google Calendar": {
      "ai_tool": [
        [
          {
            "node": "Alfred (Agent)",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "SerpAPI": {
      "ai_tool": [
        [
          {
            "node": "Alfred (Agent)",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Add an calender entry1": {
      "ai_tool": [
        [
          {
            "node": "Alfred (Agent)",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Dropbox": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "Dropbox",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI2": {
      "ai_embedding": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader1": {
      "ai_document": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Character Text Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader1",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model3": {
      "ai_languageModel": [
        [
          {
            "node": "Alfred (Agent)",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory1": {
      "ai_memory": [
        [
          {
            "node": "Alfred (Agent)",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI4": {
      "ai_embedding": [
        [
          {
            "node": "Qdrant Vector Store3",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Qdrant Vector Store3": {
      "ai_tool": [
        [
          {
            "node": "Alfred (Agent)",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI3": {
      "ai_embedding": [
        [
          {
            "node": "Qdrant Vector Store1",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader2": {
      "ai_document": [
        [
          {
            "node": "Qdrant Vector Store1",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Character Text Splitter1": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader2",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser1": {
      "ai_outputParser": [
        [
          {
            "node": "Identifica se deve guardar informa\u00e7\u00e3o no RAG",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "\u00c1udio/Texto ": {
      "main": [
        [
          {
            "node": "IF audio/texto",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF audio/texto": {
      "main": [
        [
          {
            "node": "audio/texto = text (rename)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Baixar audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Baixar audio": {
      "main": [
        [
          {
            "node": "Transcrever o audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcrever o audio": {
      "main": [
        [
          {
            "node": "audio/texto = text (rename)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "audio/texto = text (rename)": {
      "main": [
        [
          {
            "node": "Dia de hoje",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Dia de hoje": {
      "main": [
        [
          {
            "node": "Puxar informa\u00e7\u00f5es ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Puxar informa\u00e7\u00f5es ": {
      "main": [
        [
          {
            "node": "sessionId-master",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Alfred (Agent)": {
      "main": [
        [
          {
            "node": "Telegram",
            "type": "main",
            "index": 0
          },
          {
            "node": "Puxar informa\u00e7\u00f5es 2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Responder em audio": {
      "main": [
        [
          {
            "node": "Eleven Labs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Identifica se deve guardar informa\u00e7\u00e3o no RAG": {
      "main": [
        [
          {
            "node": "IF guardar/n\u00e3o guardar",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF guardar/n\u00e3o guardar": {
      "main": [
        [
          {
            "node": "Dia de hoje1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Dia de hoje1": {
      "main": [
        [
          {
            "node": "Puxar informa\u00e7\u00f5es 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Puxar informa\u00e7\u00f5es 1": {
      "main": [
        [
          {
            "node": "Qdrant Vector Store1",
            "type": "main",
            "index": 0
          },
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code Tool": {
      "ai_tool": [
        [
          {
            "node": "Alfred (Agent)",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Puxar informa\u00e7\u00f5es 2": {
      "main": [
        [
          {
            "node": "Identifica se deve guardar informa\u00e7\u00e3o no RAG",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Supabase - Tarefas6": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Supabase - Tarefas1": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Supabase - Ideias1": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Supabase - Ideias2": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "salvar_ideia": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "create_tarefa": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "DeepSeek Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Identifica se deve guardar informa\u00e7\u00e3o no RAG",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "DeepSeek Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "c4406a5b-e406-4435-a2cf-e9deeeb11e77",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "2KmDQo3M7im9f022",
  "tags": []
}