{
  "name": "All-in-one Telegram/Baserow AI assistant 🤖🧠 Voice/Photo/Save notes/Long term mem",
  "nodes": [
    {
      "id": "bbcaac28-f07c-421b-91c6-e3b2d024a71f",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -900,
        80
      ],
      "parameters": {
        "width": 340,
        "height": 380,
        "content": "## Retrieve Long Term Memories\nBaserow"
      }
    },
    {
      "id": "399c0a44-72b5-4e71-b578-3e4eb8087b3c",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -180,
        420
      ],
      "parameters": {
        "width": 280,
        "height": 380,
        "content": "## Save To Current Chat Memory"
      }
    },
    {
      "id": "d0438c1d-42e4-47d0-b23b-78f9cee5a28c",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        140,
        420
      ],
      "parameters": {
        "width": 280,
        "height": 380,
        "content": "## Save Long Term Memories\nBaserow"
      }
    },
    {
      "id": "d8cbf733-2a69-45d5-9767-43e8c67a43ee",
      "name": "gpt-4o-mini",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -400,
        580
      ]
    },
    {
      "id": "3cd6b923-b369-45e6-a3c1-5fff74a3074c",
      "name": "Chat Response",
      "type": "n8n-nodes-base.set",
      "position": [
        220,
        160
      ]
    },
    {
      "id": "912bf06d-ae8f-4513-a0c9-83c1edb1c159",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -500,
        420
      ],
      "parameters": {
        "width": 280,
        "height": 380,
        "content": "## LLM"
      }
    },
    {
      "id": "d5cf2019-d9bb-4fb6-b95c-e9e9f9ac5808",
      "name": "Telegram Response",
      "type": "n8n-nodes-base.telegram",
      "position": [
        560,
        180
      ]
    },
    {
      "id": "0858e353-8d83-437c-90bc-f57b31e92d1c",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        440,
        60
      ],
      "parameters": {
        "width": 360,
        "height": 300,
        "content": "## Telegram \n(Optional)"
      }
    },
    {
      "id": "c315e630-2ed3-4141-a715-ab08849336be",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -540,
        80
      ],
      "parameters": {
        "width": 1320,
        "height": 780,
        "content": "## AI AGENT with Long Term Memory & Note Storage"
      }
    },
    {
      "id": "2d09319d-f3be-43b8-a134-929992d4f469",
      "name": "AI Tools Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -140,
        180
      ]
    },
    {
      "id": "4a5a636a-e526-4b0f-bf11-8cd623e46c68",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        460,
        420
      ],
      "parameters": {
        "width": 280,
        "height": 380,
        "content": "## Save Notes\nBaserow"
      }
    },
    {
      "id": "46cb38d9-4932-481e-96f2-14b3224de0a9",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -900,
        480
      ],
      "parameters": {
        "width": 340,
        "height": 380,
        "content": "## Retrieve Notes\nBaserow"
      }
    },
    {
      "id": "c643683f-eee6-49c2-9f1a-05ba9a0742a6",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        -320,
        180
      ]
    },
    {
      "id": "cdd999a7-d14f-4e20-88ea-4170c8cd521c",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        -480,
        180
      ]
    },
    {
      "id": "a60582a7-63ca-497e-aec0-2be8077ebc53",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2160,
        180
      ],
      "parameters": {
        "width": 420,
        "height": 260,
        "content": "## Validate Telegram User\n"
      }
    },
    {
      "id": "3b3b2573-5a2e-4c0f-8005-376ed55b068b",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2220,
        780
      ],
      "parameters": {
        "width": 1289,
        "height": 432,
        "content": "# Process Image"
      }
    },
    {
      "id": "3d27c492-758b-45d2-bc79-a51cc69ac2ef",
      "name": "Get Audio File",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -1380,
        180
      ]
    },
    {
      "id": "9bef0848-30a5-4e98-b0e8-640e061c475d",
      "name": "Analyze Image",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -1460,
        1000
      ]
    },
    {
      "id": "b493ea36-c9f6-470d-97a9-8df43c10af18",
      "name": "Transcribe Recording",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -1100,
        180
      ]
    },
    {
      "id": "05aff1e5-daf0-47d3-8df3-a548ca4ca2cd",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        -1240,
        540
      ]
    },
    {
      "id": "ea70790d-716b-4f5d-b3d0-99259481ef22",
      "name": "Convert to Image File",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        -1640,
        1000
      ]
    },
    {
      "id": "3e5913bf-0270-4e32-8647-80138abefde5",
      "name": "Extract from File to Base64",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -1820,
        1000
      ]
    },
    {
      "id": "7d13ffbe-9496-4037-a7f2-d7b5774698ca",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1440,
        80
      ],
      "parameters": {
        "width": 513,
        "height": 309,
        "content": "# Process Audio"
      }
    },
    {
      "id": "73570d5a-87a6-4d1f-95f3-2b8ed087a28a",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1440,
        420
      ],
      "parameters": {
        "width": 513,
        "height": 329,
        "content": "# Process Text"
      }
    },
    {
      "id": "f8851e90-d710-4bc6-9705-af4828d65a48",
      "name": "Message Router",
      "type": "n8n-nodes-base.switch",
      "position": [
        -1880,
        480
      ]
    },
    {
      "id": "88127339-2cc5-4364-9f27-6dea9df505ff",
      "name": "Image Schema1",
      "type": "n8n-nodes-base.set",
      "position": [
        -2160,
        880
      ]
    },
    {
      "id": "b0922d42-9864-4d9a-a5c9-b674892935ff",
      "name": "caption",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -1460,
        860
      ]
    },
    {
      "id": "74256b12-6f3b-44ba-a98b-bd233f90c360",
      "name": "Merge1",
      "type": "n8n-nodes-base.merge",
      "position": [
        -1260,
        860
      ]
    },
    {
      "id": "9f77577b-167c-4628-b2d1-37e17d9ddb10",
      "name": "Get Image",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -2000,
        1000
      ]
    },
    {
      "id": "ffdf119a-cfa1-408a-aaca-458691f8d56b",
      "name": "Edit Fields1",
      "type": "n8n-nodes-base.set",
      "position": [
        -1100,
        860
      ]
    },
    {
      "id": "2b750b39-c72a-46ae-8e3f-0060181d2a51",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2220,
        80
      ],
      "parameters": {
        "width": 753,
        "height": 669,
        "content": "# Secure User"
      }
    },
    {
      "id": "18fcbf54-301e-449b-bb67-7f63753ac4c5",
      "name": "Sticky Note14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1720,
        60
      ],
      "parameters": {
        "width": 273,
        "height": 269,
        "content": "# Error\n"
      }
    },
    {
      "id": "8d7824b1-92d0-4907-8468-1d04e7d40d6c",
      "name": "Postgres Chat Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
      "position": [
        -20,
        540
      ]
    },
    {
      "id": "f21c0dfa-d16a-461d-9ff3-8b9932e8abb6",
      "name": "Save Note Tool",
      "type": "n8n-nodes-base.baserowTool",
      "position": [
        560,
        600
      ]
    },
    {
      "id": "242ff3e7-3421-4bc4-a877-0164cee7cd69",
      "name": "Save Memory",
      "type": "n8n-nodes-base.baserowTool",
      "position": [
        240,
        600
      ]
    },
    {
      "id": "f681f671-7759-46ba-b674-5b8b0e385d09",
      "name": "Listen for Telegram Events",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -2380,
        240
      ]
    },
    {
      "id": "959a8a01-0fb9-4bc9-9997-cc49b3a81216",
      "name": "Validation",
      "type": "n8n-nodes-base.set",
      "position": [
        -2100,
        240
      ]
    },
    {
      "id": "7903c22c-26f2-4e89-9e27-ee945e225b0e",
      "name": "Check User & Chat ID",
      "type": "n8n-nodes-base.if",
      "position": [
        -1920,
        240
      ]
    },
    {
      "id": "262c2621-5499-4481-ad94-97650b0f9714",
      "name": "Sticky Note15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2460,
        160
      ],
      "parameters": {
        "width": 273,
        "height": 269,
        "content": "# Start Here"
      }
    },
    {
      "id": "1cc31571-7d01-4cac-81a0-8cb6691ef1ed",
      "name": "Error message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -1640,
        160
      ]
    },
    {
      "id": "72b0fd9e-a82c-455b-a1d7-face4a9d55b4",
      "name": "Baserow Retrieve Memories",
      "type": "n8n-nodes-base.baserow",
      "position": [
        -780,
        220
      ]
    },
    {
      "id": "40618bf6-657a-4b8a-818b-90b5e7aecbd5",
      "name": "Baserow Retrieve Notes",
      "type": "n8n-nodes-base.baserow",
      "position": [
        -780,
        620
      ]
    },
    {
      "id": "87bfdbe7-bf2f-40d8-8fb5-c0c0015d8a10",
      "name": "Window Memory (Easy Mode)",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -140,
        640
      ]
    },
    {
      "id": "02f650e9-3d8d-4622-9cd9-16154d4d27c5",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        300,
        820
      ],
      "parameters": {
        "width": 280,
        "height": 520,
        "content": "## Baserow Set-up:\n- Create a new Workspace called \"Memories and Notes\"\n- Create a table within the new workspace called \"Memory Table\"\n- Within the \"Memory Table\" table, create two fields\n- First fie"
      }
    },
    {
      "id": "26efbccd-7605-4308-85d2-c91cdd4897ad",
      "name": "Sticky Note16",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        580,
        840
      ],
      "parameters": {
        "width": 720,
        "height": 1180,
        "content": "## Baserow Memory Table Setup:\n![Baserow example 1](https://i.imgur.com/hXADtza.png)\n## Name first field \"Memory\" and set to \"Long Text\":\n![Baserow example 2](https://i.imgur.com/AJG0jO6.png)\n## Name "
      }
    },
    {
      "id": "d30c8a6a-4668-49f9-8555-0f827d8157c0",
      "name": "Sticky Note17",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1300,
        860
      ],
      "parameters": {
        "width": 540,
        "height": 1120,
        "content": "## Tool node Setup Example:\n![Baserow example 2](https://i.imgur.com/DQ6jolu.png)"
      }
    },
    {
      "id": "54dce9dd-f06c-4e61-9a96-b691fe76dfa3",
      "name": "Sticky Note18",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2120,
        400
      ],
      "parameters": {
        "width": 150,
        "height": 80,
        "content": "## *Setup validation"
      }
    },
    {
      "id": "9166bd3d-2f21-4f19-b787-ccf9be5b5acc",
      "name": "Sticky Note19",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -120,
        140
      ],
      "parameters": {
        "width": 200,
        "height": 120,
        "content": "## *Setup Prompt\n"
      }
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge1": {
      "main": [
        [
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "caption": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "AI Tools Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Image": {
      "main": [
        [
          {
            "node": "Extract from File to Base64",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validation": {
      "main": [
        [
          {
            "node": "Check User & Chat ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Baserow Retrieve Memories",
            "type": "main",
            "index": 0
          },
          {
            "node": "Baserow Retrieve Notes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Memory": {
      "ai_tool": [
        [
          {
            "node": "AI Tools Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "gpt-4o-mini": {
      "ai_languageModel": [
        [
          {
            "node": "AI Tools Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields1": {
      "main": [
        [
          {
            "node": "Baserow Retrieve Memories",
            "type": "main",
            "index": 0
          },
          {
            "node": "Baserow Retrieve Notes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze Image": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Image Schema1": {
      "main": [
        [
          {
            "node": "Get Image",
            "type": "main",
            "index": 0
          },
          {
            "node": "caption",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Tools Agent": {
      "main": [
        [
          {
            "node": "Telegram Response",
            "type": "main",
            "index": 0
          },
          {
            "node": "Chat Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Audio File": {
      "main": [
        [
          {
            "node": "Transcribe Recording",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Message Router": {
      "main": [
        [
          {
            "node": "Get Audio File",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Image Schema1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Error message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Note Tool": {
      "ai_tool": [
        [
          {
            "node": "AI Tools Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Check User & Chat ID": {
      "main": [
        [
          {
            "node": "Message Router",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Error message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Postgres Chat Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Tools Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Transcribe Recording": {
      "main": [
        [
          {
            "node": "Baserow Retrieve Memories",
            "type": "main",
            "index": 0
          },
          {
            "node": "Baserow Retrieve Notes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to Image File": {
      "main": [
        [
          {
            "node": "Analyze Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Baserow Retrieve Notes": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Baserow Retrieve Memories": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Listen for Telegram Events": {
      "main": [
        [
          {
            "node": "Validation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File to Base64": {
      "main": [
        [
          {
            "node": "Convert to Image File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}