Run a custom AI chatbot on Telegram with memory and image generation

A Telegram chatbot remembers your conversation, keeps a consistent persona, and can generate images on request.

How the work actually flows

It branches. Exactly one path is taken.

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

flowchart TD trig>"telegram message received"]:::trig s0["classify message type"]:::task s1["send reply to user"]:::task trig --> s0 gx{"× what kind of message"}:::gate s0 --> gx p00["reset or undo conversation"]:::task gx -->|"command message"| p00 p01["update persona setting"]:::task p00 --> p01 p10["generate AI reply using persona and history"]:::task gx -->|"normal message"| p10 p20["generate requested image"]:::task gx -->|"image request"| p20 jn{"○ send reply"}:::gate p01 --> jn p10 --> jn p20 --> jn jn --> s1 out[/"reply or image sent back"/]:::out pay{{"consistent branded bot without manual replies"}}:::pay s1 --> 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 stepOne path onlyPaths rejoinResultPayoff
Build size
Advanced

A larger build with multiple systems, AI reasoning, and custom rules.

Business functions
AI Agents & Autonomous SystemsMessaging & NotificationsImage & Media Processing
Connects
TelegramOllamaComfyUIRedis

The problem it solves

Building an engaging, on-brand chatbot usually means juggling separate tools for conversation, memory, and images, and starting over every time the chat resets. Keeping a consistent character or tone across conversations by hand is nearly impossible at any scale.

Who it fits

A business wanting a branded, always-available chatbot on Telegram that remembers context and can create custom images.

How it works

  1. A message arrives from a user in your Telegram bot
  2. Commands let you reset the conversation, undo the last message, or set the bot's persona and scene
  3. Any other message is answered using AI, based on the bot's persona and recent chat history
  4. On request, the automation generates a matching image and sends it back
What you get

A branded chatbot that never sleeps

Your Telegram bot chats in a consistent, on-brand voice, remembers the conversation, and can even generate custom images whenever someone asks.

What you get

A running Telegram bot that holds a consistent persona, remembers context, and can generate images.

What you need

A Telegram bot account, a self-hosted AI model, an image generation tool, and a memory 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