AutomationFlowsAI & RAG › Self-learning AI Assistant with Permanent Memory | Gpt,telegram & Pinecone RAG

Self-learning AI Assistant with Permanent Memory | Gpt,telegram & Pinecone RAG

ByTianyi @muzi on n8n.io

Imagine having a personal AI secretary accessible right from your Telegram, ready to assist you with information and remember everything you discuss. This n8n workflow transforms Telegram into your intelligent assistant, capable of understanding text, audio, and images, and…

Event trigger★★★★★ complexityAI-powered42 nodesTelegram TriggerOpenAIAgentTelegramPinecone Vector StoreOpenAI EmbeddingsGoogle Docs ToolDocument Default Data Loader
AI & RAG Trigger: Event Nodes: 42 Complexity: ★★★★★ AI nodes: yes Added:

This workflow corresponds to n8n.io template #3183 — we link there as the canonical source.

This workflow follows the Agent → Documentdefaultdataloader recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "k5YYR7a774KfacMW",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "BuildandQueryRAGOnTheFly",
  "tags": [
    {
      "id": "W7eaE1NVqTisi5k2",
      "name": "RAG",
      "createdAt": "2025-01-26T15:21:53.716Z",
      "updatedAt": "2025-01-26T15:21:53.716Z"
    }
  ],
  "nodes": [
    {
      "id": "7c33c6d9-dfb8-40a0-8b1a-c9ee1242d44e",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -420,
        -300
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "d17fcc31-b932-4aeb-aecc-7b13f4fd602c",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        -180,
        -300
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "a151fede-fa66-401f-88c2-2beba3362cf6",
      "name": "OpenAI",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        320,
        -300
      ],
      "parameters": {},
      "typeVersion": 1.8
    },
    {
      "id": "56e81ec3-6fab-4b7a-93fe-18e65246f585",
      "name": "OpenAI1",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        140,
        0
      ],
      "parameters": {},
      "typeVersion": 1.8
    },
    {
      "id": "18a37f14-07fc-45f8-b6b0-77a8dda0584f",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        900,
        -300
      ],
      "parameters": {},
      "typeVersion": 1.7
    },
    {
      "id": "5952a2ba-eeb3-43ad-b0ae-65f26609ad06",
      "name": "Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1520,
        -300
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "66fd7dd4-2483-44e2-8466-4878f642c736",
      "name": "Edit Fields_Audio",
      "type": "n8n-nodes-base.set",
      "position": [
        520,
        -300
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "c0b82e83-1dd3-4850-9f21-3e0fe1cfecb6",
      "name": "Edit Fields_Image",
      "type": "n8n-nodes-base.set",
      "position": [
        520,
        0
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "1cd81b02-e484-4e81-80de-930a51075c0c",
      "name": "Edit Fields_Text",
      "type": "n8n-nodes-base.set",
      "position": [
        520,
        -560
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "6d929607-2a3a-4be5-8c4a-fba8b152085d",
      "name": "Pinecone Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        1460,
        60
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "9afe3e19-daff-44d6-aa8a-493c59425a96",
      "name": "Embeddings OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        1460,
        200
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "3bfae820-d848-43f4-b9fe-cb272e1a71de",
      "name": "Google Docs",
      "type": "n8n-nodes-base.googleDocsTool",
      "position": [
        1180,
        220
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "10924192-0993-4f13-9306-28c9d8c59455",
      "name": "Pinecone Vector Store1",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        400,
        420
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a560784c-f3f6-4f46-af49-1ea7fd0c83f8",
      "name": "Embeddings OpenAI1",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        340,
        620
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "d68c5300-ff13-453e-9e05-c33f6eabdb6c",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        480,
        620
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a1a73aef-5fde-45d2-871e-4a2e921fc830",
      "name": "Recursive Character Text Splitter",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        500,
        780
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "42defa33-f8ac-41bb-bc4b-d566dff7eed6",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -400,
        420
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "785f215a-6af0-4afd-b445-ae93414042bc",
      "name": "Google Docs1",
      "type": "n8n-nodes-base.googleDocs",
      "position": [
        -160,
        420
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "a827357d-3973-49c3-aeb5-15645ea58d26",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        80,
        420
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "89690c25-9f28-4af2-b1e4-98ac1fd2d960",
      "name": "Google Docs2",
      "type": "n8n-nodes-base.googleDocs",
      "position": [
        840,
        420
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "2e0b1517-2d23-46dd-a243-fbf7fdcbf5b7",
      "name": "Deepseek",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        800,
        60
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "6525d4fc-0453-4a9d-8a66-f9c5e8675b71",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -480,
        -400
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "c9a181bd-1a1a-4d5e-82f9-dcada76c2e9f",
      "name": "Window Buffer Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        960,
        60
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "9a0d2c7b-4018-4b58-bb34-7942abe1d748",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        -400
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "d1a1aaa1-89cf-4fcf-a182-d3fccfe8826b",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        460,
        -660
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "36f9ffde-7702-448e-9ff7-ba2bc4073a99",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        460,
        -380
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "0f508504-03b7-4c91-bf8f-4d9a7ae1b3a4",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        460,
        -80
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "054108d3-08ab-4307-8646-b807296c3fc0",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        100,
        -380
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "4a37c0df-46c0-4020-9543-ce2f23f10c0b",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        100,
        -80
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "014deec0-2077-4d68-80cf-273e49f21c65",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        820,
        -660
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "42f5210b-1e2c-474b-ac12-3078f759d730",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1420,
        -20
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "7c5f03aa-35e0-4796-98ea-575084c3df04",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1120,
        -20
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "66f30d10-77ad-472e-a770-bb96f904b882",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1420,
        -340
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "1502dba0-d6df-482e-89b2-dfe0144a2226",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        900,
        -20
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "1c6320a9-e912-4e36-a453-17c705ac863f",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -460,
        320
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "e04641a7-4c2b-4025-a759-933895df7ea3",
      "name": "DownloadAudio",
      "type": "n8n-nodes-base.telegram",
      "position": [
        140,
        -300
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "129b74c6-6b35-4e71-bc3b-1f11c5912ade",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -180,
        340
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "a8f804b2-06dc-45f4-8d48-c78856b73e81",
      "name": "Sticky Note14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        300,
        340
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "402f2478-b447-4445-9516-b171ff7d3d8b",
      "name": "Sticky Note15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        780,
        340
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "dc220ca7-c7cc-4493-93c6-476b58a46522",
      "name": "Sticky Note16",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -480,
        -1040
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "62da83cc-c28b-477a-b79f-0867072f5776",
      "name": "Sticky Note17",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -480,
        -860
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "e976bdbc-e59b-4dc6-8321-c8055287a5ff",
      "name": "Sticky Note18",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -480,
        620
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "a17b9012-229c-4dcd-a546-ba3439872ecd",
  "connections": {
    "OpenAI": {
      "main": [
        [
          {
            "node": "Edit Fields_Audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Edit Fields_Text",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "DownloadAudio",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "OpenAI1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI1": {
      "main": [
        [
          {
            "node": "Edit Fields_Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Deepseek": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Pinecone Vector Store1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Docs": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Google Docs1": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DownloadAudio": {
      "main": [
        [
          {
            "node": "OpenAI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields_Text": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Google Docs1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields_Audio": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields_Image": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI1": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store1",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Pinecone Vector Store1",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Window Buffer Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Pinecone Vector Store": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Pinecone Vector Store1": {
      "main": [
        [
          {
            "node": "Google Docs2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Recursive Character Text Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Imagine having a personal AI secretary accessible right from your Telegram, ready to assist you with information and remember everything you discuss. This n8n workflow transforms Telegram into your intelligent assistant, capable of understanding text, audio, and images, and…

Source: https://n8n.io/workflows/3183/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

A lightweight, self-hosted AI assistant built entirely in n8n. Multi-channel messaging (Telegram, WhatsApp, Gmail), persistent memory, task management, and autonomous work — all in a single visual wor

Telegram Trigger, OpenRouter Chat, Data Table +20
AI & RAG

This workflow implements an advanced AI automation agent (OpenClaw Agent) that interacts with users through Telegram and integrates multiple AI models, external tools, and cloud services to automate c

Telegram Trigger, Telegram, OpenAI +21
AI & RAG

Your AI workforce is ready. Are you?

Google Sheets Tool, Mcp Trigger, Google Drive +29
AI & RAG

This comprehensive workflow bundle is designed as a powerful starter kit, enabling you to build a multi-functional AI assistant on Telegram. It seamlessly integrates AI-powered voice interactions, an

Telegram Trigger, Telegram, OpenAI +19
AI & RAG

This intelligent chatbot leverages cutting-edge financial APIs and AI-driven analysis to deliver comprehensive stock research reports. Get instant access to professional-grade investment analysis that

Tool Think, Supabase Vector Store, OpenAI Embeddings +15