Building a Personal AI Assistant with Hermes Agent (Telegram)
Scenarios
Hermes Agent is an open-source autonomous AI agent developed by Nous Research and is available under the MIT license. It remembers across sessions, extracts and reuses skills on its own, and switches seamlessly across platforms and models. More than that, it adapts continuously to your habits and iterates its own capabilities.
This section describes how to deploy the Hermes Agent application image on a FlexusL instance and integrate it with Telegram to quickly build a personal AI assistant.
Step 1: Deploy a FlexusL Instance with the Hermes Agent Application Image
You can deploy the Hermes Agent application image on a new or an existing FlexusL instance.
- Go to the FlexusL instance purchase page.
- Specify required parameters for the FlexusL instance.
Parameter
Example
Description
Region
CN-Hong Kong
For low network latency and quick resource access, select the region nearest to your target users. After a FlexusL instance is created, the region cannot be changed. Exercise caution when selecting a region.
Application Images
Hermes Agent
Select the Hermes Agent application image.
Instance Specifications
2 vCPUs | 2 GiB of memory and 60 GiB system disk
Select appropriate instance specifications based on your service requirements.
Instance Name
Hermes-Example
Enter a custom instance name that is easy to identify, for example, Hermes-Example.
Associated Services (Optional)
- Data Disk: 10 GiB
- Host Security
- Cloud Backup Vault: 70 GB
You can associate EVS data disks, HSS (basic edition), and cloud backup vaults with your FlexusL instances as needed and set specifications as needed.
Required Duration
1 month
Set the duration of your subscription in the range of 1 month to 3 years.
Auto-renew is enabled by default, which means the purchased FlexusL instances will be automatically renewed before they expire. If you do not enable auto-renew during the purchase process, you can still enable it later after the instances are created. For more information about auto-renewal rules, see Auto-Renewal Rules.
Quantity
1
Set the number of FlexusL instances to be purchased.
- Click Next: Confirm.
On the displayed page, confirm the order details, read and select the agreement, and click Submit.
- Select a payment method and complete the payment.
- Go back to the FlexusL console and view the purchased FlexusL instance.
- Log in to the FlexusL console and check whether the target FlexusL instance is running the Hermes Agent application image.
- If yes, go to Step 2: Create a Telegram Bot.
- If no, go to 2.

- Choose
> Change OS on the target resource card. Select the Hermes Agent application image and complete the OS change as instructed. After the change is complete and the FlexusL instance status is running, go to the next step.
Changing the OS clears the data in all partitions of the system disk, including the system partition. Back up data in advance.
Step 2: Create a Telegram Bot
- Sign in to Telegram, enter @BotFather in the search box, and click the displayed contact.

- In the dialog box, enter /newbot.
- Enter the bot name and username as prompted. The username must end with _bot.
- After entering the information, you will receive a token. Keep it secure for subsequent Hermes Agent configurations.
- Access @userinfobot, enter the bot name in the dialog box or directly chat with the bot to obtain the user info ID, which will be used for subsequent Hermes Agent configurations.

(Optional) Step 3: Configure Security Groups
When you create a FlexusL instance, the system automatically creates a default security group (sg-default-smb) and associates it with the instance. The default security group only allows instances in the security group to communicate with each other but denies all external requests by default. In this example, use the default security group and default security group rules. You can perform the following operations to view and configure the security group rules.
- In the navigation pane on the left, choose Cloud Servers and click the target server name to view its details.

- Click the Security Groups tab and check that the default inbound rules below have been used.
You can also add more rules as needed. For details, see Configuring Security Group Rules for a FlexusL Instance.
If the source of an inbound rule is set to 0.0.0.0/0 or ::/0, then all external IP addresses are either allowed or denied to access your instances, depending on if the action is Allow or Deny. If the access is allowed, exposing high-risk ports, such as port 22, 3389, or 8848, to the public network will leave your instances vulnerable to network intrusions, service interruptions, data leaks, or ransomware attacks. You should only configure trusted IP addresses for the source in security group rules.

Table 1 Inbound security group rules Priority
Action
Type
Protocol & Port
Source
Description
1
Allow
IPv4
TCP: All
sg-default-smb
Allows instances in the security group to communicate with each other over IPv4 protocols.
1
Allow
IPv6
TCP: All
sg-default-smb
Allows instances in the security group to communicate with each other over IPv6 protocols.
Step 4: Reset the Password and Log In to the FlexusL Instance
A FlexusL instance does not have an initial password. After creating a FlexusL instance, you need to set a password before logging in to it. For details, see Resetting the Password for a FlexusL Instance.
- Locate the resource card and choose
> Reset Password. Alternatively, in the list view, click Reset Password in the Operation column to reset the password for the FlexusL instance. 
- You are advised to reset the password online. Ensure that the instance is operable (the UniAgent has been installed).
Online password reset and subsequent manual configurations for Hermes Agent depend on the unified data collection agent (UniAgent) provided by Application Operations Management (AOM). UniAgent supports script delivery and execution. It is automatically installed after you purchase a FlexusL instance. If the system displays a message indicating that the instance is not operable, wait for 5 to 10 minutes and refresh the UniAgent status. If the fault persists, manually install the UniAgent as instructed.

- Locate the resource card and click Remote Login. Alternatively, in the list view, click Remote Login in the Operation column. In the displayed dialog box, click VNC Login and enter the username and password as prompted to log in to the FlexusL instance. For more login methods, see Login Modes.
The username is root, and the password is the one you set in the previous step.

Step 5: Configure Hermes Agent
- Log in to the server and configure Hermes Agent.
su - hermes hermes setup
After running this command, use the keyboard to complete the subsequent configurations: use Arrow keys to navigate, Space to select, and Enter to confirm.
- Select Quick setup.

- Under Select provider, select Custom endpoint (enter URL manually).

- Set parameters of the AI model to be configured and press Enter to confirm the settings.
- API base URL: The API address of the model. Obtain it from the model provider, for example, https://api.openai.com/v1.
- API key: Used for API authentication. The API key is not displayed after you enter it. Press Enter to go to the next configuration item.
- Selecting a model: Enter the number or name of the model.
- Setting the context length. Press Enter to retain the default setting. You can also set the context length as required.
- Select Set up messaging now (recommended).

- Enter 1 to select the Telegram platform and press Enter.

Press Enter again to confirm.

- Select Enter existing App ID and App Secret manually.

- Enter the token obtained in 4. The secret is not displayed after you enter it. Press Enter to go to the next configuration item.

- Enter the user info ID obtained in 5.

- Enter y to confirm the service restart.

- Enter y to confirm the session start.

- In the session window, if the configured model is returned and the reply is normal after you enter hello, the configuration is complete.
- Enter /exit to exit the session.
Step 6: Verify the Bot Conversation
- Return to the chat box of BotFather in step 2 and click the provided link to start a conversation with your bot.
- Click START.

- Chat with the bot for the first time. You will get a pairing code.
- Return to the server CLI and replace the pairing code with the one sent by the bot. Run the following command as the hermes user. If not, use su - hermes to switch to the hermes user.
hermes pairing approve telegram pairing-code

- After the pairing is successful, check whether the bot can have a conversation with you. If yes, the integration with Telegram is successful.
If the bot replies with "No home channel is set for Telegram", send /sethome in the chat box.

FAQs
- What can I do if Hermes Agent is incorrectly configured?
Perform Step 5: Configure Hermes Agent again.
- How do I modify configurations such as models and channels?
Perform Step 5: Configure Hermes Agent again.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot



