AutomationMart
Home/Browse/Create a Telegram bot with Mistral Nemotron AI and conversation memory
n8n

Create a Telegram bot with Mistral Nemotron AI and conversation memory

n8nn8n14 modulesv1.0
OpenAITelegramGeminiHugging Face

Create a Telegram Bot with Mistral AI and Conversation Memory A sophisticated Telegram bot that provides AI-powered responses with conversation memory. This template demonstrates how to integrate any AI API service with Telegram, making it easy to swap between different AI providers like OpenAI, Anthropic, Google AI, or any other API-based AI model. πŸ”§ How it works The workflow creates an intelligent Telegram bot that: - πŸ’¬ Maintains conversation history for each user - 🧠 Provides contextual AI re

At a glance

Create a Telegram bot with Mistral Nemotron AI and conversation memory is a ready-made n8n workflow you import as a workflow JSON file β€” no build required. It connects OpenAI, Telegram, Gemini, Hugging Face. It's free to download. Follow the 5-step import below to go live in minutes.

Platform
n8n
Connects
OpenAI, Telegram, Gemini, Hugging Face
Modules
14
Price
Free
Version
v1.0
Create a Telegram bot with Mistral Nemotron AI and conversation memory workflow diagram

About this workflow

Create a Telegram Bot with Mistral AI and Conversation Memory A sophisticated Telegram bot that provides AI-powered responses with conversation memory. This template demonstrates how to integrate any AI API service with Telegram, making it easy to swap between different AI providers like OpenAI, Anthropic, Google AI, or any other API-based AI model. πŸ”§ How it works The workflow creates an intelligent Telegram bot that: - πŸ’¬ Maintains conversation history for each user - 🧠 Provides contextual AI responses using any AI API service - πŸ“± Handles different message types and commands - πŸ”„ Manages chat sessions with clear functionality - πŸ”Œ Easily adaptable to any AI provider (OpenAI, Anthropic, Google AI, etc.) βš™οΈ Set up steps πŸ“‹ Prerequisites - πŸ€– Telegram Bot Token (from @BotFather) - πŸ”‘ AI API Key (from any AI service provider) - πŸš€ n8n instance with webhook capability πŸ› οΈ Configuration Steps 1. πŸ€– Create Telegram Bot - Message @BotFather on Telegram - Create new bot with /newbot command - Save the bot token for credentials setup 2. 🧠 Choose Your AI Provider - OpenAI: Get API key from OpenAI platform - Anthropic: Sign up for Claude API access - Google AI: Get Gemini API key - NVIDIA: Access LLaMA models - Hugging Face: Use inference API - Any other AI API service 3. πŸ” Set up Credentials in n8n - Add Telegram API credentials with your bot token - Add Bearer Auth/API Key credentials for your chosen AI service - Test both connections 4. πŸš€ Deploy Workflow - Import the workflow JSON - Customize the AI API call (see customization section) - Activate the workflow - Set webhook URL in Telegram bot settings ✨ Features πŸš€ Core Functionality - πŸ“¨ Smart Message Routing: Automatically categorizes incoming messages (commands, text, non-text) - 🧠 Conversation Memory: Maintains chat history for each user (last 10 messages) - πŸ€– AI-Powered Responses: Integrates with any AI API service for intelligent replies - ⚑ Command Support: Built-in /start and /clear commands πŸ“± Message Types Handled - πŸ’¬ Text Messages: Processed through AI model with context - πŸ”§ Commands: Special handling for bot commands - ❌ Non-text Messages: Polite error message for unsupported content πŸ’Ύ Memory Management - πŸ‘€ User-specific chat history storage - πŸ”„ Automatic history trimming (keeps last 10 messages) - 🌐 Global state management across workflow executions πŸ€– Bot Commands - /start 🎯 - Welcome message with bot introduction - /clear πŸ—‘οΈ - Clears conversation history for fresh start - Regular text πŸ’¬ - Processed by AI with conversation context πŸ”§ Technical Details πŸ—οΈ Workflow Structure 1. πŸ“‘ Telegram Trigger - Receives all incoming messages 2. πŸ”€ Message Filtering - Routes messages based on type/content 3. πŸ’Ύ History Management - Maintains conversation context 4. 🧠 AI Processing - Generates intelligent responses 5. πŸ“€ Response Delivery - Sends formatted replies back to user πŸ€– AI API Integration (Customizable) Current Example (NVIDIA): - Model: mistralai/mistral-nemotron - Temperature: 0.6 (balanced creativity) - Max tokens: 4096 - Response limit: Under 200 words πŸ”„ Easy to Replace with Any AI Service: OpenAI Example: Anthropic Claude Example: Google Gemini Example: πŸ›‘οΈ Error Handling - ❌ Non-text message detection and appropriate responses - πŸ”§ API failure handling - ⚠️ Invalid command processing 🎨 Customization Options πŸ€– AI Provider Switching To use a different AI service, modify the "NVIDIA LLaMA Chat Model" node: 1. πŸ“ Change the URL in HTTP Request node 2. πŸ”§ Update the request body format in "Prepare API Request" node 3. πŸ” Update authentication method if needed 4. πŸ“Š Adjust response parsing in "Save AI Response to History" node 🧠 AI Behavior - πŸ“ Modify system prompt in "Prepare API Request" node - 🌑️ Adjust temperature and response parameters - πŸ“ Change response length limits - 🎯 Customize model-specific parameters πŸ’Ύ Memory Settings - πŸ“Š Adjust history length (currently 10 messages) - πŸ‘€ Modify user identification logic - πŸ—„οΈ Customize data persistence approach 🎭 Bot Personality - πŸŽ‰ Update welcome message content - ⚠️ Customize error messages and responses - βž• Add new command handlers πŸ’‘ Use Cases - 🎧 Customer Support: Automated first-line support with context awareness - πŸ“š Educational Assistant: Homework help and learning support - πŸ‘₯ Personal AI Companion: General conversation and assistance - πŸ’Ό Business Assistant: FAQ handling and information retrieval - πŸ”¬ AI API Testing: Perfect template for testing different AI services - πŸš€ Prototype Development: Quick AI chatbot prototyping πŸ“ Notes - 🌐 Requires active n8n instance for webhook handling - πŸ’° AI API usage may have rate limits and costs (varies by provider) - πŸ’Ύ Bot memory persists across workflow restarts - πŸ‘₯ Supports multiple concurrent users with separate histories - πŸ”„ Template is provider-agnostic - easily switch between AI services - πŸ› οΈ Perfect starting point for any AI-powered Telegram bot project πŸ”§ Popular AI Services You Can Use | Provider | Model Examples | API Endpoint Style | |----------|---------------|-------------------| | 🟒 OpenAI | GPT-4, GPT-3.5 | | | πŸ”΅ Anthropic | Claude 3 Opus, Sonnet | | | πŸ”΄ Google | Gemini Pro, Gemini Flash | | | 🟑 NVIDIA | LLaMA, Mistral | | | 🟠 Hugging Face | Various OSS models | | | 🟣 Cohere | Command, Generate | | Simply replace the HTTP Request node configuration to switch providers!

n8n

How to import this n8n workflow

  1. 1

    Download the workflow JSON file after purchase.

  2. 2

    Open n8n β†’ click the menu β†’ Import from File.

  3. 3

    Select the downloaded JSON and import.

  4. 4

    Set up credentials for each node that requires them.

  5. 5

    Click Execute Workflow to test, then activate.

Setup guide

Setup guide included

Purchase to unlock the full step-by-step guide

Related N8n workflows

Monitor Facebook posts and send email notifications with ChatGPT integration

Monitor Facebook posts and send email alerts using OpenAI GPT-3. Automatically track updates and receive insights directly in your inbox.

Free

Update Airtable records using ChatGPT, HTTP and custom webhooks

Update Airtable records using ChatGPT completions triggered by custom webhooks. Enhance data accuracy with HTTP file retrieval and record updates.

Free

Automate ASMR glass fruit video creation & publishing with Veo, Shotstack & Postiz

Veo Machine Reels Factory β€” Full User Guide 🧭 Introduction The Veo Machine Reels Factory is an automated content creation system built in n8n that turns creative ideas into fully rendered ASMR-style glass fruit reels, ready to post on TikTok, YouTube Shorts, and Instagram Reels. This template connects multiple AI and automation services into a single, repeatable pipeline. It eliminates manual steps β€” from concept brainstorming to posting β€” allowing creators or marketing teams to produce viral sh

Free

Create barcodes from links posted in Telegram

Every time there is a new link posted in Telegram, Make will create a Barcode for the link and send it to a specified Telegram chat.

Free

Secure AI agent webhook with HMAC, replay protection, and OpenAI GPT-5

Disclaimer: > I am not a cybersecurity expert. This workflow was built through research and with the assistance of an LLM (Claude Opus 4.6). While it implements well-established security patterns (HMAC-SHA256, timing-safe comparison, replay protection, strict payload validation), please review the logic carefully and ensure it meets your own security requirements before deploying it in production. Who is this for? This template is for anyone exposing an n8n workflow via webhook and wanting

Free

Receive incoming ClickSend SMS messages in Telegram

Receive incoming ClickSend SMS messages in Telegram

Free

Auto-tag blog posts in WordPress with AI

How it works: This workflow automates tagging for WordPress posts using AI: 1. Fetch blog post content and metadata. 2. Generate contextually relevant tags using AI. 3. Verify existing tags in WordPress and create new ones if necessary. 4. Automatically update posts with accurate and optimized tags. Set up steps: Estimated time: 15 minutes. 1. Configure the workflow with your WordPress API credentials. 2. Connect your content source (e.g., RSS feed or manual input). 3. Adjust tag formatting pref

Free

Extract trends, auto-generate social content with AI, Reddit, Google & post

Extract Trends and Auto-Generate Social Media Content with OpenAI, Reddit, and Google Trends: Approve and Post to Instagram, TikTok, and More --- Description What Problem Does This Solve? πŸ› οΈ This workflow automates trend extraction and social media content creation for businesses and marketers. It eliminates manual trend research and content generation by fetching trends, scoring them with AI, and posting tailored content to multiple platforms. Target audience: Social media

Free

Reviews

No reviews yet

Be the first to buy and share your experience.

Leave a review

Sign in to share your experience with this workflow.

Log in to review
Free
No ratings yet

Create a free account to purchase workflows.

  • JSON blueprint β€” instant download
  • Setup guide PDF included
  • 5 downloads Β· valid 30 days
  • Works with n8n

Need help setting this up?

Book a 3-hour live setup session with an Agility consultant.

β‚Ή2,499/ session
3 hrs Β· video call
  • Configure live on Google Meet / Zoom
  • Free follow-up if workflow has defects
  • Platform expert assigned to you
Book installation session
Free