I Built a Telegram AI Agent That Can Actually Use Tools O.O
Hexzie (HexTelegram) is a Telegram-based AI assistant that goes beyond 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.
HexZoNetwork / HexTelegram
Hexzie HexTelegram (HTG) - AI Telegram bot by HexzoNetwork
⚠️ Project in active development, some features may still be in progress.
Hexzie is built with:
- ✅ Telegraf + Node.js (bot framework)
- 📌 OpenAI-compatible API for chat + function-calling tools (active development)
- ✅ Go tool runner (tools-go) - shell, files, web, screenshots, sysinfo
- ✅ Full filesystem control from
/- no workspace jail - ✅ ChatGPT-style streaming replies with live progress labels
Features
- 💬 Chat - streaming answers, auto-summary memory, per-chat history
- 💻 Shell + files -
shell_exec(any command),file_read/file_write/file_listfrom/ - 🌐 Web -
web_search(Bing),web_fetch,web_check(site recon),web_screenshot(chromium → PNG) - ✉️ Telegram tools - send message/photo/document, inline buttons, edit, delete, forward, pin, chat actions,
get_chat - 🖼️ Vision + files - send photo/document, reply-to-file summarization, PDF text extraction
- 🔐 Access … View on GitHub
What is Hexzie?
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.
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.
Why Node.js + Go?
The Telegram side is written in Node.js using Telegraf, making handling updates, messages, callbacks, photos, documents, and streaming straightforward. The Go runner handles lower-level tools:
shell_execfile_readfile_writefile_listweb_fetchweb_searchweb_checkweb_screenshotget_timecalcsysinfo
Separation of concerns:
- Node.js ─── AI + Telegram + agent orchestration
- Go ──────── System / filesystem / web tools
The Agent Loop
A simplified version:
User message
│
▼ Build context
│
▼ Send messages + tools to model
│
▼ Does the model request a tool?
┌─┴─┐
YES NO
│ │
▼ ▼
Run Final answer
tool
│
▼ Add tool result
▼ Ask model again
Hexzie allows up to 8 agent rounds. For example:
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 training data. It's interacting with the environment through structured tools.
Progress Updates
Instead of waiting for a huge response, Hexzie keeps a single progress message and edits it while the agent
Comments
No comments yet. Start the discussion.