100's of workflows

Telegram Bot with Supabase memory and OpenAI integration

Integrations
HTTP Request
Telegram
Supabase
If
Merge
Telegram Trigger
Sticky Note

Who is this for?

This workflow is perfect for developers, chatbot enthusiasts, and businesses interested in building a dynamic Telegram bot with memory capabilities. The bot uses OpenAI's assistant for interactions and integrates with Supabase to store user data, enabling personalized conversations.

What problem does this workflow solve?

Many basic chatbots lack memory and context awareness. This workflow solves that issue by integrating Supabase to track user sessions (using telegram_id and openai_thread_id), allowing the bot to remember past interactions, creating a more engaging and human-like experience.

What this workflow does

This Telegram bot template connects with OpenAI to respond to user queries while storing and retrieving user information from Supabase. The memory component allows the bot to reference previous interactions, making it suitable for customer support, virtual assistants, or any application where context retention is valuable.

     
  • Receive New Message: The bot listens for incoming messages from users on Telegram.
  •  
  • Check User in Database: Checks if the user exists in Supabase using telegram_id.
  •  
  • Create New User (if necessary): Adds a new user record in Supabase with telegram_id and openai_thread_id if the user is new.
  •  
  • Start or Continue Conversation with OpenAI: Initiates a new thread or continues an existing one using the stored openai_thread_id.
  •  
  • Merge Data: Combines user-specific data and conversation context.
  •  
  • Send and Receive Messages: Sends the message to OpenAI and processes the response.
  •  
  • Reply to User: Sends OpenAI's response back to the user on Telegram.

Setup

     
  1. Create a Telegram Bot using Botfather and get the bot token.
  2.  
  3. Set up Supabase:    
           
    1. Create a new project and obtain SUPABASE_URL and SUPABASE_KEY.
    2.      
    3. Create a new table named telegram_users with the following SQL query:
    4.    
       CREATE TABLE public.telegram_users (id UUID NOT NULL DEFAULT gen_random_uuid(), date_created TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT (now() at time zone 'utc'::text), telegram_id BIGINT NULL, openai_thread_id TEXT NULL, CONSTRAINT telegram_users_pkey PRIMARY KEY (id)) TABLESPACE pg_default;  
  4.  
  5. OpenAI Setup:    
           
    1. Create an OpenAI assistant and obtain the OPENAI_API_KEY.
    2.      
    3. Customize the assistant’s personality or use case as needed.
    4.    
     
  6.  
  7. Environment Configuration in rantir:    
           
    1. Configure Telegram, Supabase, and OpenAI nodes with the required credentials.
    2.      
    3. Set up triggers to receive messages and handle conversation logic.
    4.      
    5. Input the OpenAI assistant ID in the "++OPENAI - Run assistant++" node.
    6.    
     

Other Workflows like this one

Your connected stack awaits to automate AI workflows with 24-7 uptime performance and engagement

AI-Powered Children's Books on Telegram or Whatsapp with OpenAI
Telegram
Summarization Chain
OpenAI Chat Model
Recursive Character Text Splitter
OpenAI
Rantir & Flux AI Image Generator
HTTP Request
S3
Edit Fields (Set)
Switch
Respond to Webhook
Transcribing Bank Statements To Markdown Using Vision AI
Edit Image
HTTP Request
Google Drive
Compression
Sticky Note
Voice Activated Multi-Agent Demo for Vagent.io using Notion and Google Calendar
AI Agent
OpenAI Chat Model
Window Buffer Memory (easiest)
Call rantir Workflow Tool
HTTP Request Tool
Automated Email Marketing Campaign Workflow
Send Email
Google Sheets
Code
OpenAI
Loop Over Items (Split in Batches)
AI - Telegram Chatbot
Telegram
OpenAI
Merge
Edit Fields (Set)
Telegram Trigger

Compare features across plans

Computir Cloud Suite All Access

$99/m

Per team/per month, with 10 GB of data and storage
Everything in Free, and:
Icon
Host up to around 4-5 Applications
Icon
Advanced user roles
Icon
Unlimited AI applications & workflows
Icon
Custom onboarding & Customer management
Icon
Advanced integrations
Icon
International capabilities
Unlimited Team Plan & Custom Integration

$299/m

Per $1K Tokens or 1 TB added, custom integration (per month)
Everything in Professional, and:
Icon
Host up to around 20+ Applications
Icon
Tailored implementation services
Icon
Advanced ERP integration capabilities
Icon
Extra bandwidth and open-source AI models
Icon
Fine-tuning & data logic
Icon
SOX or integration customization
Icon
Dedicated premium support
Cloud Suite

$99/mo

Team Plan

$299

Computir Cloud

AI Application & Automation platform suite
Get access to generate dashboards, websites or content
Chat to Explore Data
Icon

Custom Develop  integrations

Chat to Transform Data
Icon
Direct or Enterprise application connections
Webflow, Wix or Wordpress
+ Acumatica, Microsoft, Netsuite & Sage
+ Oracle & Workday
Rules to automate AI
Basic
Advanced
Advanced

Custom Integrations

Build & Share Live Reports
Icon
Generated
Human-Led
Train Classification Models
Icon
Human-Led
Train Time Series Forecasts
Icon

"I highly recommend Computir, they are a great dev team with quick turn around on all projects and requests. We recently worked with them on updating our website and any changes, updates or modifications I needed were always taken care of quickly!"

Paige J, VP of Marketing, Heavy AI