ππ€ DeepSeek AI agent + Telegram + LONG TERM memory π§
Needs changesNeeds changes. This template uses 1 thing(s) that n8n 3.0 removes: AI Agent v1 (old agent modes). 1 breaking item(s) found. Static check, last run 2026-10-19.
What to replace before upgrading
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) AI Agent (v1.7) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (12)
- If
n8n-nodes-base.if - Telegram
n8n-nodes-base.telegram - Webhook
n8n-nodes-base.webhook - Edit Fields (Set)
n8n-nodes-base.set - Switch
n8n-nodes-base.switch - AI Agent
@n8n/n8n-nodes-langchain.agent - Merge
n8n-nodes-base.merge - Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow - Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger - Google Docs Tool
n8n-nodes-base.googleDocsTool - Google Docs
n8n-nodes-base.googleDocs - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi
What it does
This n8n workflow template is designed to integrate a DeepSeek AI agent with Telegram, incorporating long-term memory capabilities for personalized and context-aware responses. Here's a detailed breakdown: --- Core Features Telegram Integration - Uses a webhook to receive messages from Telegram users. - Validates user identity and message content before processing. AI-Powered Responses - Employs DeepSeek's AI models for conversational interactions. - Includes memory capabilities to personalize responses based on past interactions. Error Handling - Sends an error message if the input cannot be processed. --- Model Options π§ - DeepSeek-V3 Chat: Handles general conversational tasks. - DeepSeek-R1 Reasoning: Provides advanced reasoning capabilities for complex queries. - Memory Buffer Window: Maintains session context for ongoing conversations. --- Quick Setup π οΈ Telegram Webhook Configuration 1. Set up a webhook using the Telegram Bot API: https://api.telegram.org/bot{mybottoken}/setWebhook?url={urltosendupdatesto} Replace {mybottoken} with your bot's token and {urltosendupdatesto} with your n8n webhook URL. 2. Verify the webhook setup using: https://api.telegram.org/bot{mybottoken}/getWebhookInfo DeepSeek API Configuration 1. Base URL: https://api.deepseek.com 2. Obtain your API key from the DeepSeek platform. --- Implementation Details π§ User Validation - The workflow validates the user's first name, last name, and ID using data from incoming Telegram messages. - Only authorized users proceed to the next steps. Message Routing - Routes messages based on their type (text, audio, or image) using a switch node. - Ensures appropriate handling for each message format. AI Agent Interaction - Processes text input using DeepSeek-V3 or DeepSeek-R1 models. - Customizable system prompts define the AI's behavior and rules, ensuring user-centric and context-aware responses. Memory Management - Retrieves long-term memories stored in Google Docs to enhance personalization. - Saves new memories based on user interactions, ensuring continuity across sessions.