A Telegram chatbot that remembers every customer conversation

A Telegram bot answers customer questions with OpenAI and remembers past conversations using a Supabase database.

How the work actually flows

It branches. Exactly one path is taken.

Pattern: Exclusive Choice (4) · Simple Merge (5)

flowchart TD trig>"customer sends telegram message"]:::trig s0[("check customer database")]:::store s1["continue conversation with AI"]:::svc s2["send reply to customer"]:::task trig --> s0 s1 --> s2 gx{"× customer already exists"}:::gate s0 --> gx p00["create customer record"]:::task gx -->|"new customer"| p00 p10["load conversation history"]:::task gx -->|"existing customer"| p10 jn{"○ continue conversation"}:::gate p00 --> jn p10 --> jn jn --> s1 out[/"context aware reply sent to customer"/]:::out pay{{"customers do not repeat themselves"}}:::pay s2 --> out out --> pay classDef task fill:#e7f6fe,stroke:#34b8f0,color:#2c2a29 classDef svc fill:#f6f8fa,stroke:#7c8795,color:#2c2a29 classDef mi fill:#e7f6fe,stroke:#0079a8,color:#2c2a29,stroke-width:2px classDef human fill:#fff,stroke:#0079a8,color:#0079a8 classDef store fill:#f6f8fa,stroke:#0079a8,color:#2c2a29 classDef trig fill:#00a4eb,stroke:#0079a8,color:#fff,font-weight:bold classDef trigtime fill:#00a4eb,stroke:#0079a8,color:#fff,font-weight:bold classDef trigdata fill:#8ad4f5,stroke:#0079a8,color:#06314c,font-weight:bold classDef gate fill:#fff,stroke:#e8a23d,color:#6b4708,font-weight:bold classDef out fill:#1f9d6b,stroke:#167a53,color:#fff,font-weight:bold classDef pay fill:#06314c,stroke:#021f33,color:#fff
Starts itA stepAn outside serviceA record or sheetOne path onlyPaths rejoinResultPayoff
Build size
Standard

A mid-size build with several tools working together.

Business functions
AI Chatbots & AssistantsKnowledge Base & RAGMessaging & NotificationsSpreadsheet & Database Ops
Connects
TelegramOpenAISupabase

The problem it solves

Generic chatbots forget everything the moment a conversation ends, forcing customers to repeat themselves every time they message you. That makes support feel robotic and wastes everyone's time. This bot keeps track of who it's talking to, so conversations pick up where they left off.

Who it fits

Businesses running customer support or virtual assistants over Telegram.

How it works

  1. A new Telegram message triggers the bot
  2. The system checks whether the sender already exists in the customer database
  3. A new customer record is created if it's their first message
  4. The bot continues or starts a conversation thread with OpenAI using that customer's history
  5. The AI's reply is sent back to the customer in Telegram
What you get

Customers who never repeat themselves

Customers chatting with you on Telegram get answered by AI that remembers their previous conversations automatically.

What you get

An ongoing, context-aware conversation with each customer, with their history stored for next time.

What you need

A Telegram bot, an OpenAI account, and a Supabase database.

We can build this. But should you?

The hard question is not how to build it. It is whether this is the right thing to build first.

That is what a Fractional Chief AI Officer figures out with you, before anyone writes a line of code.

Let's Talk Strategy

Related automations

Back to the AI Playbook