Communication & Messagingintermediate
November 9, 2025
7 min read
45 minutes
How to Create an AI-Powered Telegram Assistant with Persistent Memory
Build an AI-powered Telegram assistant with memory, voice transcription, task automation, and calendar management using n8n, OpenAI, Airtable, and Google tools.
By Nayma Sultana

We've all been there. You're juggling a dozen things at once: remembering to buy milk, scheduling that dentist appointment, tracking work tasks, and trying to keep your life somewhat organized. You download another productivity app. You set another reminder. And somehow, nothing sticks.
What if instead of managing multiple apps, you had one intelligent assistant that lived right in your Telegram? An assistant that remembers your preferences, manages your calendar, tracks your grocery list, handles your to-do items, and even transcribes voice messages. All without you having to switch between five different platforms.
That's exactly what this n8n workflow does. And the best part? You can build it yourself in an afternoon.
What Makes This Workflow Special
This isn't just another chatbot that forgets everything you told it five minutes ago. This workflow creates a genuine personal assistant with persistent memory, task management capabilities, and intelligent decision-making. It processes both text and voice messages, stores context about you over time, and integrates with the tools you already use.
Think of it as having a friend who never forgets what you like, what you need to do, and what's on your calendar. Except this friend is available 24/7 and never gets annoyed when you ask it to add "eggs" to your grocery list for the third time this week.
Prerequisites: What You'll Need Before Starting
Before diving into the workflow, you'll need to set up accounts and credentials for several services. Don't worry, most of these have generous free tiers.
Required APIs and Services
- Telegram Bot Token: Create a bot through BotFather on Telegram to get your API credentials
- OpenAI API Key: For the GPT-4.1-mini model that powers the conversational AI
- Airtable Account: To store memories, grocery lists, and to-do items (free tier works fine)
- Google Calendar API: For calendar management integration
- Google Gemini API: For voice message transcription using Gemini 2.5 Flash
- n8n Instance: Either self-hosted or using n8n cloud
Key Components in the Workflow
This workflow uses 24 interconnected nodes that work together seamlessly. Here are the core building blocks:
- Telegram Trigger: Listens for incoming messages
- Switch Node: Routes voice and text messages differently
- Google Gemini Node: Transcribes voice recordings
- Airtable Nodes: Multiple nodes for CRUD operations on memories, groceries, and tasks
- OpenAI Chat Model: The brain behind conversational responses
- Window Buffer Memory: Maintains conversation context
- Google Calendar Nodes: Five different nodes for calendar operations
- Agent Node: Orchestrates all the tools and decides which to use
- Merge Node: Combines data streams before processing
- Aggregate Node: Compiles memory data for context
Building Your Intelligent Assistant: Step by Step
Step 1: Set Up the Foundation with Telegram and Memory Retrieval
The workflow starts with a Telegram Trigger node that listens for incoming messages. Every time a user sends a message, two things happen simultaneously. First, the message goes to a Switch node that determines whether it's text or voice. Second, a separate branch queries Airtable to retrieve all existing memories about the user.
img_1.png
This memory retrieval is crucial. The workflow pulls from a "User Memory" table that contains past conversations, preferences, and important details. These memories include timestamps, so the AI knows which information is most recent. An Aggregate node then compiles all these memories into a structured format that the AI can understand.
Step 2: Handle Voice Messages with Transcription
When the Switch node detects a voice message, it routes it through the Telegram node to download the audio file. This file then goes to the Google Gemini node configured for audio transcription using the Gemini 2.5 Flash model.
img_2.png
The transcribed text rejoins the main workflow at the Merge node, where it combines with the retrieved memories. From this point forward, voice messages are treated just like text messages. Your assistant can now "hear" you, making it perfect for hands-free operation while driving or cooking.
Step 3: Configure the AI Agent with Tools and Instructions
The heart of this workflow is the Agent node, powered by OpenAI's GPT-4.1-mini model. But what makes it truly powerful is the comprehensive system prompt and the eleven different tools it can access.
The system prompt defines the assistant's personality: casual, concise, and helpful, like texting a friend. It instructs the AI on when to save memories (user preferences go to User Memory, feedback on communication style goes to a separate Text Memory table). The prompt also includes detailed instructions for each tool, ensuring the AI knows exactly how to manage groceries, tasks, and calendar events.
img_3.png
img_4.png
The Agent node connects to all these tools simultaneously. When you ask to add milk to your grocery list, the agent first searches the existing list, then creates the entry only if it's not already there. When you request to schedule a meeting, it checks for conflicts before creating the event. This intelligent tool usage happens automatically based on context.
Step 4: Build the Grocery Management System
Three Airtable Tool nodes work together to handle your grocery list. The Grocery Search node queries your list, Grocery Create adds new items, and Grocery Delete removes them. Each node is configured to access the same Airtable base and table.
img_5.png
The system prompt instructs the AI on proper workflow. If you say "add milk to my list," the agent first searches to avoid duplicates. If you say "I went shopping but didn't get eggs or milk," it searches the list, then selectively deletes everything except those two items. This contextual understanding transforms a simple database into an intelligent shopping assistant.
Step 5: Implement Calendar Integration with Conflict Detection
Five Google Calendar Tool nodes handle different calendar operations. The Get Events node retrieves your schedule, which the AI uses before creating, updating, or deleting events. The Create Events node adds single occurrences, while Create Recurring Events handles repeating appointments.
img_6.png
Here's where it gets smart. For single events, the workflow checks for conflicts and notifies you if something's already scheduled. But for recurring events (like "create a meeting every Monday at 2pm for the next month"), it skips conflict checking to avoid overwhelming you with dozens of warnings. The Update Events node modifies existing entries while preserving fields you didn't explicitly change. And everything uses a color-coding system with eleven options, defaulting to light blue if you don't specify.
Step 6: Add Task Management with the To-Do System
The to-do list works similarly to the grocery system but with additional context. Three more Airtable Tool nodes (To-Do Search, Create, and Delete) manage tasks, but each task includes not just the description but also a "Class" or "Project" field. This lets you organize tasks by category: personal errands, work projects, school assignments.
img_7.png
When you say "add finish homework for biology class," the AI extracts both the task and the category. When you ask "what's on my to-do list," it returns everything with context. And when you complete tasks selectively, it can clear some while keeping others, just like with groceries.
Why This Workflow Changes the Game
This isn't just about convenience, though that's certainly a benefit. This workflow represents a fundamental shift in how we interact with productivity tools. Instead of adapting to multiple apps with different interfaces, you have one conversational interface that adapts to you.
Real-World Use Cases
Students can manage assignments across multiple classes, quickly adding tasks via voice message between classes. The assistant remembers deadlines and can surface relevant to-dos when asked.
Families can maintain a shared grocery list, with anyone able to add items through simple text messages. No more "did you remember the milk?" because the list never forgets.
Professionals can schedule meetings, check availability, and update appointments without opening their calendar app. Voice messages work great for this: "Schedule a client call tomorrow at 2pm for one hour."
Anyone can benefit from having a system that learns their preferences over time. Tell it once that you prefer shorter responses, and it remembers forever. Mention your work schedule, and it considers that when suggesting meeting times.
The Bottom Line
Building a personal assistant used to require a team of developers and significant infrastructure. With n8n and this workflow, you can create something genuinely useful in a few hours. The workflow handles the complex orchestration, the AI provides natural conversation, and the integrated tools give it real capabilities.
What you end up with is something that feels less like using software and more like having an extremely organized friend who never sleeps. And in a world where we're constantly context-switching between apps, that's incredibly valuable.
The workflow is modular, too. Don't need grocery management? Remove those nodes. Want to add habit tracking or expense logging? The pattern is already there for you to follow. This isn't just a workflow, it's a template for building exactly the assistant you need.
So go ahead. Set it up. Start chatting. And watch as your digital life gets just a little bit easier to manage.
Share this article
Help others discover this content
Tap and hold the link button above to access your device's native sharing options
More in Communication & Messaging
Continue exploring workflows in this category

Communication & Messagingintermediate
1 min read
AI-Powered LinkedIn Engagement Automator with Human Review & Multilingual Support
Nayma Sultana
Nov 13
Est: 45 minutes

Communication & Messagingintermediate
1 min read
Stop Drowning in Support Tickets: How AI Automation Transforms Jira Ticket Management
Nayma Sultana
Nov 12
Est: 50 minutes

Communication & Messagingintermediate
1 min read
Build a Voice-Powered Email Assistant That Works Through WhatsApp
Mahedi Hasan Nadvee
Nov 11
Est: 45 minutes