n8n

How to Automate Telegram AI Support with Memory?

Chat with users on Telegram using AI in real time. Users can type or send a voice note. Key details are saved in Airtable so replies get smarter over time.

When a message arrives, Telegram collects the update. Text goes straight into a text field, and voice notes go to OpenAI for transcription. Past notes are pulled from Airtable and combined with the new input. An AI Agent powered by an OpenAI chat model writes the answer. The agent can use a calculator for quick math and Wikipedia for quick facts. It can also save a short 140 character memory back into Airtable for future context. The reply is sent back to Telegram right away.

You need a Telegram bot, an OpenAI API key, and an Airtable base with a Memory table. The setup uses the Telegram chat id to keep separate memory per user, which helps with many concurrent chats. Expect faster replies, less manual typing, and clean records of user needs. Good for student help, internal knowledge help, or pre sales Q and A on Telegram.

What are the key features?

  • Telegram trigger captures text and voice updates from users
  • OpenAI audio transcription converts voice notes into clean text
  • Switch logic routes text and voice paths for proper handling
  • Merge combines user input, transcript and Airtable memory into one context
  • Airtable search and aggregate provide past notes for better answers
  • AI Agent uses an OpenAI chat model and short term memory per chat id
  • Built in tools let the agent use a calculator and Wikipedia when needed
  • Airtable tool writes a 140 character memory after each chat
  • Telegram sender posts the AI reply back to the user in the same chat
  • A Google Gemini model node is available for future use if needed

What are the benefits?

  • Reduce response time per question from 5 minutes to under 30 seconds
  • Automate up to 80% of repeated Q and A tasks
  • Handle 10 times more chats with the same team size
  • Connect Telegram, OpenAI and Airtable in one flow
  • Improve answer accuracy over time with saved context

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n, click the three dots menu, select 'Import from File', then choose the downloaded JSON file
  2. You'll need accounts with Telegram, OpenAI, Airtable, Wikipedia and Google Gemini. See the Tools Required section above for links to create accounts with these services.
  3. Create a Telegram bot with BotFather and copy the bot token. In the n8n credentials manager, create a Telegram credential and paste the token. Assign this credential to both the Telegram Trigger and Telegram send nodes.
  4. In your OpenAI account, create an API key. In n8n, create an OpenAI credential and paste the key. Attach it to the OpenAI audio transcribe node and the OpenAI Chat Model node.
  5. In Airtable, make a base and a table named Memory with a single line text field named Memory. Create a Personal Access Token with read and write access. In n8n, create an Airtable Personal Access Token credential and link it to the Airtable search node and the Airtable tool node.
  6. Open the Airtable nodes and select the base and the Memory table from the dropdowns. Keep the limit near 50 to load recent notes.
  7. Check the AI Agent node. Confirm it is connected to the OpenAI Chat Model, Simple Memory, calculator tool, Wikipedia tool, and the Airtable memory tool.
  8. In the Simple Memory node, keep the custom session key set to the Telegram chat id expression so each user has a separate conversation state.
  9. If you do not have the content creation and email sub workflows, disable or remove those tool workflow nodes to avoid tool not found errors.
  10. Optional: If you plan to use Google Gemini, get an API key in Google AI Studio. In n8n, create Google Gemini credentials and then connect the Gemini node to the AI Agent as an alternative model.
  11. Save the workflow and confirm that all credential fields show a green connected state in n8n.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Airtable

Sign up

Free (1,000 API calls / mo)

Google Gemini

Sign up

Free tier: $0 via Gemini API; e.g., Gemini 2.5 Flash-Lite free limits 1,000 requests/day (15 RPM, 250k TPM). Paid from $0.10/1M input tokens and $0.40/1M output tokens.

OpenAI

Sign up

Pay-as-you-go: GPT-5 at $1.25 per 1M input tokens and $10 per 1M output tokens

Telegram

Sign up

Free: $0, Telegram Bot API usage is free for developers

Wikipedia

Sign up

Free: $0 (public Wikimedia APIs). Enterprise Free: $0 with 5,000 on‑demand requests / mo and twice‑monthly snapshots

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.