Blog

Build an AI Support Bot for Telegram (That Knows When to Hand Off)

Most "AI support bots" either follow a rigid button tree or hallucinate confidently and never escalate. The useful version answers from your own knowledge, knows when to bring in a human, and tells you how to make it better.

FlowCastle AI Chat Agent routing customer intents to flow blocks with a knowledge base attached

"AI support" has two failure modes. The first is a glorified button tree that calls itself AI. The second is a raw language model bolted onto your inbox that answers confidently, gets things wrong, and never admits it should fetch a human. A support bot people actually trust does neither: it answers from your own knowledge, and it knows when to step aside.

Here is how to build one in FlowCastle that runs on Telegram today — and on your website with the same flow.

What you will build

An AI Chat Agent that greets a customer, recognizes the requests you already know about, answers everything else from your knowledge base, and hands off to a human when it is out of its depth. Add it to a flow, connect each intent to a block, and you have the support bot below.

FlowCastle AI Chat Agent matching intents like "Make an order", "Track order" and "Return or refund" and routing each to a flow block, with FAQ Knowledge Base and Intents + Chat enabled

Step 1: Attach a knowledge base

Upload your docs, FAQ, and policies as a Knowledge base (TXT, Markdown, PDF, DOC, DOCX, XLSX and more) and attach it to the agent. The AI answers from that — not the open internet — so it stays on-topic and stops inventing features you do not have. This one step is the difference between "helpful" and "liability."

Step 2: Define your intents

Run the agent in Intents + Chat mode. Add an intent for each request you already know — Track order, Return or refund, Talk to a human — and connect it to a block on the canvas that gives the exact answer or runs an action. Everything you did not script falls through to a knowledge-base answer instead of a dead end.

An AI Chat Agent inside a full support flow in the FlowCastle editor

Step 3: Hand off to a human

This is the step most "AI bots" skip, and it is the whole game. Add a Talk to a human intent, and set the agent so that when no intent matches it hands off — then route that to Live Chat, where an operator is notified and picks up the conversation with the full history in front of them. The bot covers the routine; people handle the exceptions.

Step 4: Let it suggest its own improvements

This is where FlowCastle pulls ahead. Open the Suggestions tab and run Analyze conversations: it reviews the agent history and your live-chat transcripts, then proposes concrete fixes — a new intent for a question users keep asking, or a knowledge gap to add to your knowledge base. You approve the good ones, and the bot measurably improves every week instead of going stale.

One flow, every channel

Build it once and the same agent runs on Telegram and on your website web chat, no rebuild. That is not a slogan; it is the exact pattern behind the chat widget on flowcastle.ai.

Where to go next

Clone the AI FAQ + Human Handoff template below, attach your knowledge base, add your intents, and run an analysis after the first week. You will have a support bot that answers the easy 80% instantly and routes the hard 20% to a person — which is all anyone really wants from "AI support."