How to build a real AI customer service agent with Hermes

28 Sep 2026 04:37 8,569 views
Learn how to turn Hermes into a real AI customer service agent, connect it to Telegram, secure it with HTTPS, load it with your business knowledge, and automate daily reports without wasting AI credits.

Chatting with AI is easy. Turning it into a reliable customer service agent that can safely interact with real customers is where things get serious. In this guide, you’ll see how to set up a full customer support system using Hermes agents, connect it to Telegram, feed it your business rules, and automate daily reports using Python so you don’t burn unnecessary AI credits.

What you’ll build: an AI agent that runs real support

The end result is a working customer service agent for a fictional courier company called Dragon Dash, which delivers packages using dragons. While the dragons are imaginary, the setup is completely real and can be adapted to any business.

Your Hermes agent will:

• Use a strong language model for conversations and a cheaper/free one for simple tasks
• Follow your real business rules, pricing, policies, and safety guidelines
• Talk with customers on Telegram (or other channels like Slack, Discord, WhatsApp, email, SMS)
• Run 24/7 on a virtual private server (VPS)
• Send daily summary reports to the business owner using a Python script

Setting up Hermes on a VPS

To keep your agent online 24/7, you’ll run Hermes on a VPS. The example uses Hostinger with an Ubuntu 22.04 (called 26 04 in the transcript, but the idea is a standard Ubuntu LTS) server, but any similar VPS with Docker support will work.

The basic steps are:

1. Create a VPS instance and install Ubuntu.
2. Open the hosting control panel and go to the Docker manager.
3. Install Docker support if it’s not already enabled.
4. Open the Docker catalog, search for “Hermes agent,” and deploy it.

When Hermes is deployed, the system generates an admin username and password. You’ll need those to log in to the Hermes dashboard, and you can find them later in the container’s environment configuration.

Securing your agent with HTTPS

Before you start chatting with customers, you should secure your Hermes dashboard and API with HTTPS. Without it, your traffic travels in plain text and can be intercepted on the network.

From the hosting panel:

1. Deploy a reverse proxy like Traefik from the Docker catalog.
2. Enter your email so it can request TLS certificates (usually via Let’s Encrypt).
3. Once deployed, open Hermes through the provided HTTPS URL.

Now your Hermes interface and chat traffic are encrypted, which is critical for any real customer support use case.

Logging into the Hermes dashboard

With HTTPS in place, open Hermes from the hosting panel and log in using the admin credentials stored in the container’s environment variables.

To find them:

1. In your hosting panel, locate the Hermes container and click “Manage.”
2. Open the YAML or environment editor.
3. Look for the admin username and password under the environment section.
4. Copy them and sign in to the Hermes dashboard.

Connecting Hermes to AI models

Hermes can work with multiple model providers. You’ll set at least one main model for conversations and optionally a cheaper model for background tasks.

In the VPS terminal, run:

hermes model

This command walks you through adding a model provider. For example:

• Connect to OpenAI / ChatGPT (or a compatible Codex subscription).
• Authenticate using a device code flow (you may need to enable device code authorization in your account security settings).
• Choose a model, such as a reasoning-focused model (e.g., a Luna variant in the example) and set a reasoning effort level.

You can repeat hermes model to add more providers. For instance, you might add OpenRouter and select a free model like “Memotron 3 Super” for non-critical tasks.

Optimizing costs with a main and a helper model

Once you have multiple models, open the “Models” section in Hermes:

• Set your strongest model (e.g., Luna) as the main model for conversation and reasoning.
• Assign a cheaper or free model (e.g., Memotron) as the “selector” or auxiliary model for background and simple tasks.

This setup lets your agent offload lightweight work (like routing, lookups, or small internal tasks) to a cheaper model while reserving the best model for complex, customer-facing reasoning. It’s a practical way to control costs while keeping quality high.

Giving your agent real business knowledge

Right now, your Hermes agent is just a generic chatbot. It doesn’t know your business rules, pricing, or policies. To turn it into a real customer service agent, you need to give it structured knowledge.

In Hermes, go to the “Files” section and:

1. Create a new folder called agent knowledge (the name matters, because you’ll reference it in the agent’s instructions).
2. Upload all the documents your agent needs: opening hours, pricing, delivery zones, terms of service, safety rules, and internal guidelines.

In the Dragon Dash example, the following markdown files are used:

• Company overview (what Dragon Dash is and what it does)
• Delivery locations and zones
• Dragon safety guidelines
• Pricing and fees
• Customer support policies and escalation rules

These files act as the agent’s knowledge base. Hermes can read them to answer questions and apply business rules.

Designing your agent’s “soul” and personality

Hermes uses a special file called soul.md to define the agent’s role, behavior, and core instructions. This is where you decide who your agent is and how it should act.

To customize it:

1. In the Files section, go back to the root folder and find soul.md.
2. Download it to see the default instructions.
3. Replace the defaults with your own specification. For example:
• Give the agent a name (e.g., Amber).
• Define its role (e.g., “You are a customer service representative for Dragon Dash, a dragon-based delivery company.”).
• Describe its tone and style (friendly, calm, efficient, concise).
• Explicitly instruct it to use documents from the agent knowledge folder when answering questions.

4. Save your customized soul.md locally.
5. In Hermes, delete the original soul.md and upload your new version.

After this, start a new chat and ask a realistic customer question (for example, reporting a dragon damaging a garden). The agent should now:

• Recognize that it’s a Dragon Dash support agent.
• Refer to relevant safety or damage policies from your documents.
• Ask appropriate follow-up questions and respond professionally.

At this point, you’ve moved from a generic LLM to a business-aware AI agent, similar in spirit to more advanced agentic systems you might see in guides like how to build your own personal agentic operating system.

Connecting your agent to Telegram

To make your agent easily accessible to customers, you can connect it to Telegram (or other channels like Discord, Slack, WhatsApp, email, or SMS). The example focuses on Telegram.

In Hermes:

1. Go to the “Channels” section.
2. Enable the Telegram channel.
3. Choose “Quick setup” and select “Create with QR.”
4. Scan the QR code with your phone’s camera (or Telegram app).
5. In the Telegram conversation that opens, tap “Create bot.”
6. Give your bot a clear name (e.g., “Dragon Dash AI Support Agent”) and a unique handle (no spaces).
7. When Telegram sends a confirmation, tap “Connect this bot.”

Back in Hermes, you should now see:

• The bot’s Telegram handle.
• Your Telegram user ID (copy or note this; you’ll need it for admin permissions).

Click “Save and restart” in the Channels section, and if you see a “gateway is not running” error, use the “Restart gateway” button. Refresh the page and confirm that Telegram is marked as connected.

Making the bot public but safe

Initially, only you can talk to the bot. To let all Telegram users interact with it, you’ll adjust an environment variable—but you also need to lock down admin commands so customers can’t control Hermes.

In your hosting panel:

1. Manage the Hermes container and scroll to the environment section.
2. Add a new environment variable:
• Name: TELEGRAM_ALLOW_ALL_USERS
• Value: true
3. Save and redeploy the container.

This makes the bot available to everyone on Telegram. Next, you restrict admin commands using the Hermes config.

Locking admin commands to your Telegram account

In the VPS terminal, edit the Hermes configuration:

hermes config edit

Scroll to the platforms section for Telegram and, under enabled: true, add a configuration block that:

• Sets admin access to your specific Telegram user ID (the one you copied earlier).
• Allows user commands but sets the user commands list to empty, meaning regular users can’t run Telegram-level commands.

Be careful with indentation—use two spaces per level and align enabled and extra correctly.

Save with Ctrl+O and exit with Ctrl+X, then restart the gateway:

hermes gateway restart

Now:

• Customers can chat with the bot and use Hermes tools.
• Only your Telegram account can use admin commands.

Setting the home channel for owner communication

Your agent needs a “home” channel where it can send reports and talk to the business owner. In your personal Telegram chat with the bot (as the owner):

1. Type /set_home (or the equivalent command used by Hermes in your version).
2. Then type /who_am_i to confirm that you’re recognized as an administrator.

This home channel will be used later as the destination for daily reports and other owner-focused messages.

On another device (or another Telegram account), start the bot and type who am I? in natural language to verify that regular users are not admins and are treated as normal customers.

Why you need daily reports (and why Python helps)

Once your agent is public, it may handle dozens or hundreds of customer interactions per day. As a business owner, you’ll want to know:

• How many conversations happened today?
• What were people asking about?
• Did the agent give any bad or incorrect answers?
• Are there issues that require human follow-up?

You could send the entire chat log to the language model every day, but that would be expensive and unnecessary. Instead, you can:

• Use a Python script to pull only relevant data from the Hermes database (for example, today’s Telegram conversations).
• Let Python count and format the data (number of conversations, unique customers, questions, answers).
• Only then send the compact output to the model for analysis and summarization.

This hybrid approach—Python for heavy lifting, AI for interpretation—is similar to how many modern agentic systems are built in production and aligns well with strategies you’ll see in resources like step-by-step guides to selling AI-powered services.

Adding the daily report script to Hermes

Hermes can run scripts on a schedule using its built-in cron system. To prepare your Python script:

1. In the Hermes Files section, create a new folder named scripts (this name is important; Hermes expects scripts there).
2. Upload your daily_report.py file into the scripts folder.

The example script:

• Selects only today’s conversations.
• Filters for Telegram as the channel.
• Prints each customer question and the agent’s response.
• Outputs totals: number of conversations, unique users, questions, and answers.

Test it from the VPS terminal:

python /opt/data/scripts/daily_report.py

You should see the same messages you exchanged earlier with the bot, along with a small summary. If that works, you’re ready to automate.

Scheduling daily reports with Hermes cron

Now you’ll tell Hermes to run the script once per day and send the results to your Telegram home channel.

In the Hermes dashboard:

1. Open the “Cron” section and create a new cron job.
2. Name it something like dragon-daily-report.
3. Choose a daily schedule.

You need to align the schedule with your time zone:

• In the VPS terminal, run date to see the server’s time and time zone (usually UTC).
• Compare that to your local time. For example, if you’re in UTC+3 and want the report at local midnight, schedule the cron job for 21:00 UTC.

In the cron job configuration:

• Set the time (e.g., 21:00 server time for a midnight local report).
• Set the destination to your Telegram home channel (the one you marked with /set_home).
• In the script name field, enter daily_report.py (no path necessary; Hermes knows to look in the scripts folder).

Using AI to interpret the report output

Hermes cron gives you a choice:

• No agent: run the script and send raw output, no AI involved (no model credits used).
• With agent: run the script, then let the model read and summarize the output.

For a real customer service system, the second option is more useful. Python collects the facts; the AI agent interprets them.

To enable this:

1. Leave “No agent” unchecked.
2. Provide a clear prompt for the agent. For example, instruct it to:
• Read the output from today’s reporting script.
• Summarize the number of conversations and key topics.
• Flag any unresolved issues or complaints that require human follow-up.
• Highlight repeated questions (which may indicate unclear documentation or UX problems).
• Point out any responses where the agent might have been incorrect, vague, or unhelpful.

Save the cron job. At the scheduled time, Hermes will run the script, give its output to the language model along with your prompt, and send the final report into your Telegram home channel.

Seeing your first automated report

Once the cron job is active, all you have to do is wait for the scheduled time. Just before that, you can send a few test messages as different users to generate some activity for the report.

When the time hits:

• Hermes runs daily_report.py and collects today’s Telegram conversations.
• The output goes to your main model with your analysis prompt.
• You receive a concise, human-readable report in Telegram summarizing the day.

In the Dragon Dash example, the report flags a notable unresolved request: an out-of-zone delivery attempt to Mordor involving a “small ring.” That’s exactly the kind of quirky but important detail a business owner would want to see.

From toy chatbot to real customer service system

By following these steps, you’ve transformed a generic language model into a real, production-ready customer service agent:

• Hosted on a secure VPS with HTTPS.
• Connected to one or more AI models, optimized for cost.
• Grounded in your own business knowledge via the agent knowledge folder.
• Given a clear role and personality through soul.md.
• Available to customers on Telegram, with proper admin protections.
• Monitored daily through Python-powered reports and AI analysis.

You can extend this setup to other channels (Slack, Discord, WhatsApp), add more tools and automations, or integrate it with your internal systems. The key is the pattern: let code handle structure and data, and let AI handle language, judgment, and summarization.

With this foundation in place, you’re ready to evolve your AI support agent into a broader agentic system that can assist across operations, sales, and more.

Share:

Comments

No comments yet. Be the first to share your thoughts!

More in AI Agents