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_exec -
file_read -
file_write -
file_list -
web_fetch -
web_search -
web_check -
web_screenshot -
get_time -
calc -
sysinfo
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.