Every time we at AIS build a team of AI agents for a client, we start from the same building blocks. There’s no magic here. There’s a tool that holds everything together, a server that runs around the clock, and a brain that thinks. This guide takes you behind the scenes and shows how a system like this is actually built, from the perspective of the person assembling it in production.
The tool is Hermes Agent. Instead of a single chatbot that answers one question, Hermes lets you build an entire team of agents, each responsible for a different task, all working for you from within Telegram (and if you need phone calls too, not just Telegram, there’s a voice agent). This is exactly the idea behind the AI agent team deployment we set up for clients, only here you see the bare building blocks.
Glossary
Before we get to work, it’s worth getting familiar with a few terms that will come up throughout.
VPS (Virtual Private Server)
A computer that lives in the cloud and runs 24/7. You rent it for a few dollars a month. It's always on, always connected to the internet, and that's where your AI will live.
API Key / Token
A special password that lets one piece of software talk to another. When you give Hermes a Claude key, you're telling it: here's the password, use this brain.
LLM (Large Language Model)
The brain of the AI. It's what stands behind ChatGPT, Claude, and every AI tool. Hermes is the body, and the LLM is the brain that thinks.
Token
A unit of measure for text used by AI. About 4 English letters equal one token. The more text you send, the higher the cost.
Telegram Bot
An automated account on Telegram that responds to messages. You create a bot, connect it to Hermes, and talk to it like a friend, only it's an AI.
Gateway
The service that connects Hermes to messaging platforms like Telegram. When the Gateway is running, your bot is alive and answering.
Before You Start
Before jumping into the steps, it helps to have everything ready in advance. The whole thing takes about 15 minutes once you begin.
- A credit card (for buying the server)
- Telegram installed on your phone
- An active ChatGPT Plus account
- About 15 free minutes
Step 1: Buying a Server (3 minutes)
The part that sounds the most technical is actually the simplest. Instead of setting up a server and installing software on it, you buy a VPS that already comes with Hermes installed.
The link goes to Hostinger’s VPS KVM 2 plan on an annual term. At the time of writing, it costs about $9 per month at the promotional rate, and renews higher, around $15 per month. The exact figure depends on the term length and active promotions, so it’s worth checking the link itself. It’s a good starting point for most businesses. The link is an affiliate link, meaning we earn a commission if you buy through it, and it does not raise your price.
- Go to hostinger.com
- Choose VPS Hosting
- Under the operating system section, look for the Hermes Agent template and select it
- Set a strong password and save it
- Wait for the server to come up (1-2 minutes)
That’s it. Hermes is already installed and waiting for you.
Step 2: Configuring Hermes (5 minutes)
Opening the Terminal
In the Hostinger dashboard, click Terminal in the top-right corner of the machine. A terminal window opens, and from here on you work in it.
Choosing the Brain (Language Model)
Hermes needs a brain, that is, a language model. The default we recommend is OpenAI Codex through a ChatGPT Plus account. If you already have a Plus subscription, this is usually the most cost-effective way to start: you use your existing account without signing up for a separate service and without creating an API key. Note that this route is subject to the usage limits of the Plus plan, so under heavy load you may hit a ceiling and need to wait. What’s included in the plan and its terms change from time to time, so it’s worth checking the current situation with OpenAI.
Running the Setup Wizard
In the terminal window, type:
hermes setup
Follow the table and choose what’s written:
| Setting | What to do |
|---|---|
| Model selection | Choose openai-codex, then the current Codex model on offer (at the time of writing that’s gpt-5.5) |
| Max iterations | Enter 60 |
| Compression threshold | Enter 0.5 |
| Everything else | Press Enter (defaults) |
Step 3: Connecting to Telegram (3 minutes)
Creating a Bot
- Open Telegram on your phone
- Search for
@userinfobotand send it any message, it returns your ID. Save the number - Search for
@BotFatherand open a chat - Send:
/newbot - Choose a name for the bot (for example: My AI Team)
- Choose a username ending in bot (for example:
my_ai_team_bot) - BotFather sends you a token, copy and save it
Configuring the Files
In the terminal window, type the following, replacing the values with your own:
echo "TELEGRAM_BOT_TOKEN=YOUR_TOKEN_FROM_BOTFATHER" >> /root/.hermes/.env
echo "GATEWAY_ALLOWED_USERS=YOUR_TELEGRAM_ID" >> /root/.hermes/.env
Check that the values went in correctly:
cat /root/.hermes/.env
The output should look roughly like this, one line of each kind:
TELEGRAM_BOT_TOKEN=7123456789:AAExample-your-token-here
GATEWAY_ALLOWED_USERS=123456789
Important: every time you run an echo command it appends a new line to the file. If you ran them twice by mistake, you’ll get duplicate lines and the bot can get confused. In that case, delete the file and run the two echo commands above again:
rm /root/.hermes/.env
Starting the Service
So the bot stays alive even after the server restarts, you set it up as a systemd service. That way the operating system starts it automatically on every boot, instead of you having to run it manually each time (and the bot won’t quietly disappear after a restart).
Paste the entire block below into the terminal at once. It creates the service file:
cat > /etc/systemd/system/hermes.service <<EOF
[Unit]
Description=Hermes Gateway
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
Environment=HOME=/root
EnvironmentFile=/root/.hermes/.env
WorkingDirectory=/root/.hermes
ExecStart=$(which hermes) gateway
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
Now reload systemd, set the service to start on every boot, and start it:
systemctl daemon-reload
systemctl enable hermes
systemctl start hermes
Check that the service is running:
systemctl status hermes
If you see active (running) in green, everything is fine. Leave the screen with the q key.
That’s it. The bot is alive. Open the bot in Telegram and send it a message to confirm it answers.
Troubleshooting
| Problem | Likely cause | What to run |
|---|---|---|
| The bot doesn’t answer at all | The service isn’t running | systemctl status hermes, and if needed systemctl restart hermes |
| The bot says you’re not allowed, or ignores you | Your Telegram ID doesn’t match GATEWAY_ALLOWED_USERS | cat /root/.hermes/.env and compare with the ID from @userinfobot |
| Model authentication error | The ChatGPT Plus account isn’t connected or the connection expired | Run hermes setup again and reconnect the account |
| The bot dies after the server restarts | The service wasn’t set to start automatically | systemctl enable hermes then systemctl start hermes |
| The bot is slow or stops midway | You hit the model’s usage limit | Wait and continue later, or set up a fallback (see below) |
To view the bot’s full logs: journalctl -u hermes -n 50.
Step 4: First Use (1 minute)
Introducing Hermes to Your Business
Open the bot in Telegram and send it the following message, after editing the details:
I want to connect you to my business.
Business name: [name]
Industry: [industry]
Services I offer: [list]
Target audience: [who]
My website: [address]
Output language: English
The First Task
Research my top 5 competitors and give me a summary with actionable insights on how I can differentiate myself from them.
Hermes takes it from here. It searches the web, analyzes the results, and returns an organized report within 2-5 minutes.
A Recurring Task
Every Sunday at 9:00 AM, send me a summary of:
- What my competitors published this week on social media
- New trends in my industry
- 3 content ideas I can publish this week
Hermes saves the task and runs it automatically every week.
Useful Commands
| Command | What it does |
|---|---|
/tasks | List active tasks |
/reset | Reset the conversation |
/status | Check system status |
Advanced: Adding Claude as Fallback
If you like, you can add Claude as a backup engine alongside Codex:
- Go to console.anthropic.com, sign up, add a payment method, and create an API Key
- Add the line
ANTHROPIC_API_KEY=sk-ant-xxxto your .env file - Configure Claude as a fallback in Hermes settings
- Useful when Codex hits rate limits or for especially complex tasks
Claude is billed by actual usage, driven mainly by how much text is sent and how complex the task is. A single task usually costs anywhere from a few cents to a few tens of cents, so your monthly bill depends entirely on how much you run. This is entirely optional, and Codex handles most cases just fine on its own.
The Architect’s Perspective
The hard part of this guide isn’t the installation, it’s the gap between running Hermes yourself and a production system that manages a real business process end to end and is connected to the tools you already use. Three things break exactly when the agent moves from a solo Telegram bot to a system running a real business process:
- Reliability and continuity. A solo bot going down is an inconvenience. An agent handling customer inquiries that drops midway is a lost customer. [TODO: Shai: a short example of a real-time failure that happened in production and what it cost, with no identifying details]
- Permissions and separation of duties. The moment the agent touches money, contracts, or customer data, root access to everything is a risk, not a convenience. You need clear boundaries and human approval at the right points. [TODO: Shai: an example of a process where you added a human checkpoint before a sensitive action]
- Connecting to existing systems. The real value starts when the agent talks to the CRM, inventory, or billing system, and that’s where the clashes between data, formats, and processes begin. [TODO: Shai: an example of an integration with an existing system that required architecture work]
That’s where, somewhere between the first agent in Telegram and an AI agent for real estate that filters leads by area and budget or an AI agent for insurance that handles policy renewals, DIY ends and the architecture work begins.
Want the full guide as a file? Download the Hermes guide for free
The guide is on its way to your inbox
