I Built a Telegram AI Agent That Can Actually Use Tools O.O A developer has built Hexzie (HexTelegram), a Telegram-based AI assistant that combines a Node.js/Telegraf front end with a Go tool runner so an OpenAI-compatible model can call tools such as shell execution, file read/write, web search, web fetch, site reconnaissance and screenshots. The agent loop allows up to eight rounds of tool calls, and the bot edits a single live progress message to show streamed reasoning and tool status before replacing it with the final answer. I've been building Hexzie HexTelegram a Telegram-based AI assistant that goes beyond just sending text back and forth. The idea was simple: What if an AI assistant inside Telegram could actually use tools, inspect files, execute commands, search the web, and interact with Telegram itself? So I built it. HexTelegram HTG — AI Telegram bot by HexzoNetwork ⚠️ Project in active development , some features may still be in progress. Hexzie is a powerful and modern Telegram AI assistant built with: tools-go — shell, files, web, screenshots, sysinfo / — no workspace jail shell exec any command , file read / file write / file list from web search Bing , web fetch , web check site recon , web screenshot chromium → PNG get chat Hexzie is an AI Telegram assistant built with Node.js + Telegraf , with a Go-based tool runner underneath. The AI communicates through an OpenAI compatible API , allowing the model to decide when it needs to call a tool. The architecture roughly looks like this: Telegram │ ▼ Telegraf │ ▼ Authentication │ ▼ Prompt / Context Builder │ ▼ Agent Loop │ ├──► AI API │ │ │ └── tool calls │ ├──► Go Tool Runner │ ├── shell │ ├── files │ ├── web │ ├── screenshots │ ├── calculator │ └── system info │ └──► Telegram Tools ├── send / edit / delete ├── photo / document / buttons ├── forward / pin └── get chat The important part is that the AI isn't limited to generating text. It can act . The Telegram side is written in Node.js using Telegraf . That makes handling Telegram updates, messages, callbacks, photos, documents, and streaming relatively straightforward. For the lower level tools, I used Go. The Go runner handles things like: shell exec file read file write file list web fetch web search web check web screenshot get time calc sysinfo This gives the project a nice separation: Node.js └── AI + Telegram + agent orchestration Go └── System / filesystem / web tools One of the most interesting parts is the agentic loop. A simplified version looks like: User message │ ▼ Build context │ ▼ Send messages + tools to model │ ▼ Does the model request a tool? │ ┌─┴─┐ YES NO │ │ ▼ ▼ Run Final tool answer │ ▼ Add tool result │ ▼ Ask model again Hexzie currently allows up to 8 agent rounds . For example, a request could theoretically become: User: "Check this website and tell me what server it's running on." AI: → web check Tool: → returns HTTP/server/technology information AI: → analyzes result Telegram: → final response The model isn't just answering from its training data. It's interacting with the environment through structured tools. I also wanted the bot to feel less like a traditional Telegram bot. Instead of: User → wait → huge response Hexzie keeps a single progress message and edits it while the agent works. While the model streams its reasoning, the message shows the action, a status, and a live custom line plus rotating tips: php - 💭 Thinking |- Reading request. | |- - I should inspect the site's headers before summarizing. Tips: SSE: Super Speedy Edits. then, while a tool runs: php - 🔍 Checking site https://example.com |- Running tool. | |- - Comparing server headers to identify the stack. Tips: Punch trees, hug servers and when it finishes, the same message is replaced with the actual answer. Tips rotate every ~5 seconds, and the custom line is based on the model's own streamed reasoning when available falling back to themed statuses when it isn't. This makes tool execution feel much more transparent. There's another problem with AI bots: What happens if a user sends another message while the previous request is still running? Instead of letting requests pile up indefinitely, Hexzie keeps track of the newest request per chat. Conceptually: Request A ────────────────X \ Request B ──────────────────► active If request A becomes stale, it is aborted and its progress message is marked as skipped instead of eventually producing an outdated response. This matters quite a lot once an agent can perform slow operations like web requests or multiple tool calls. Hexzie also supports an API pool. Instead of depending on a single endpoint: API 1 API 2 API 3 API 4 The bot can rotate endpoints when network errors or server-side failures occur. For certain HTTP failures like 502/503/504 , it also retries with backoff before falling back to a non-streaming request. APIs can be added and live-tested from Telegram itself with /addapi