{
  "name": "Create a voice & text Telegram assistant with Lookio RAG and GPT-4.1",
  "nodes": [
    {
      "id": "cad8de80-6b0b-430c-a3c0-8e6a6a25c393",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        240,
        544
      ]
    },
    {
      "id": "3ccede32-2481-454e-9ccb-9e206b32d67f",
      "name": "Myself?",
      "type": "n8n-nodes-base.if",
      "position": [
        464,
        544
      ]
    },
    {
      "id": "87342e86-4f25-43ed-ae19-8a495b0888c3",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2256,
        560
      ]
    },
    {
      "id": "e17cfbab-3149-45b3-9903-6b5b8b264b8f",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        2272,
        816
      ]
    },
    {
      "id": "182a9d2e-8747-48bf-9c8b-ca606915ce7b",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        880,
        240
      ],
      "parameters": {
        "width": 873,
        "height": 325,
        "content": "# Process Audio"
      }
    },
    {
      "id": "5ad3276d-f713-401f-8ee2-de72243eb426",
      "name": "Get Audio File",
      "type": "n8n-nodes-base.telegram",
      "position": [
        912,
        400
      ]
    },
    {
      "id": "4ac926fe-165b-4b11-ad8d-a5ebc040c4fc",
      "name": "Message Router",
      "type": "n8n-nodes-base.switch",
      "position": [
        688,
        512
      ]
    },
    {
      "id": "49027af2-e53b-4dfc-ac8e-b849cb6c9db6",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2400,
        768
      ],
      "parameters": {
        "width": 336,
        "height": 400,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Lookio tool\n\nThe agent calls this tool to get answers based on the knowledge base you've built in Lookio.\n- Add your [Lookio](https://www.lookio.app/) API key\n- Specify the ID of th"
      }
    },
    {
      "id": "ce0b2d93-2276-47ca-857a-c83a72f0c3e1",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1904,
        768
      ],
      "parameters": {
        "width": 336,
        "height": 400,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## AI model\n\nThe core AI model of your agent. Connect your OpenAI API key or switch to your favorite LLM provider."
      }
    },
    {
      "id": "f667095e-cf14-4784-9a55-a4261ae00f1a",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2192,
        320
      ],
      "parameters": {
        "width": 352,
        "height": 400,
        "content": "## The agent\n\nThis agent will distribute the relevant questions to Lookio via the \"Query knowledge base\" tool. Feel free to provide more context in its system message and add instructions when it come"
      }
    },
    {
      "id": "615e79ce-d872-4b99-96a2-02c9436b63c2",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2032,
        832
      ]
    },
    {
      "id": "a8da1688-7bfd-4c68-a1da-45523c8628a2",
      "name": "Telegram answer",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2832,
        560
      ]
    },
    {
      "id": "1dbd7647-e5ac-449a-8e45-34126b4af8bf",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1216,
        272
      ],
      "parameters": {
        "width": 265,
        "height": 277,
        "content": "### AI transcription\n\nYou can replace with another model like OpenAI's."
      }
    },
    {
      "id": "73f644d2-97f9-4718-b0e6-982a44129470",
      "name": "Query knowledge base",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        2544,
        832
      ]
    },
    {
      "id": "6d132f95-391c-4a97-a8fa-92663fa608f0",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        384,
        304
      ],
      "parameters": {
        "width": 265,
        "height": 405,
        "content": "### Make this bot private\n\nTelegram bots are public by default, so we're adding a filter here based on your unique Telegram username. Change the value to ensure only your messages can go through, or d"
      }
    },
    {
      "id": "d4f5488f-f234-4142-b561-4349550c57f5",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        896,
        592
      ],
      "parameters": {
        "width": 873,
        "height": 293,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n# Process text"
      }
    },
    {
      "id": "dd9663af-3587-42c9-bdf0-a6c3cc2ba6d1",
      "name": "Prepare message from audio",
      "type": "n8n-nodes-base.set",
      "position": [
        1584,
        400
      ]
    },
    {
      "id": "c18dfaf8-6189-4d78-b0d1-47af2a6e17be",
      "name": "Prepare message from text",
      "type": "n8n-nodes-base.set",
      "position": [
        1168,
        672
      ]
    },
    {
      "id": "c348dadb-0377-4a6e-9e5e-2f8ec77bd411",
      "name": "Consolidate user message",
      "type": "n8n-nodes-base.set",
      "position": [
        1872,
        560
      ]
    },
    {
      "id": "a881e44a-f8f4-456e-98e5-51850791967d",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        208,
        -400
      ],
      "parameters": {
        "width": 880,
        "height": 544,
        "content": "# **RAG Telegram bot with Lookio & GPT-4.1 (text + voice)**\n\n**Summary**: A Telegram bot that answers questions using your Lookio assistant. Accepts text and voice (transcribed via **Mistral** by defa"
      }
    },
    {
      "id": "eda43537-92a0-47f0-ba3f-377b3ba9f5a3",
      "name": "Mistral transcribe",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1296,
        400
      ]
    }
  ],
  "connections": {
    "Myself?": {
      "main": [
        [
          {
            "node": "Message Router",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Telegram answer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Get Audio File": {
      "main": [
        [
          {
            "node": "Mistral transcribe",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Message Router": {
      "main": [
        [
          {
            "node": "Get Audio File",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Prepare message from text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Myself?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Mistral transcribe": {
      "main": [
        [
          {
            "node": "Prepare message from audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Query knowledge base": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Consolidate user message": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare message from text": {
      "main": [
        [
          {
            "node": "Consolidate user message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare message from audio": {
      "main": [
        [
          {
            "node": "Consolidate user message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}