Turn your Telegram bot into a smart support agent that remembers users. Incoming messages go to an AI assistant, and the chat history stays linked to each person. This fits teams that get many questions and want fast, consistent replies without losing context.
When a user sends a Telegram message, the flow checks Supabase for that user’s record. If the user is new, it creates an OpenAI thread and stores both the Telegram ID and the thread ID. Then the message is added to the same thread, the assistant runs, and the latest answer is fetched and sent back to Telegram. Memory lives in Supabase and the OpenAI thread, so future chats feel connected. This design reduces repeat questions and keeps conversations smooth.
You will need a Telegram bot token, a Supabase project with the provided table, and an OpenAI assistant ID. Expect faster response times, less manual typing, and the ability to handle more chats with the same team. It works well for FAQs, first line support, and basic onboarding. Set credentials in n8n, paste your assistant ID, and test by messaging your bot. Once you see the user record and thread ID in Supabase, you are ready to scale.