Help Center/ Huawei Cloud Flexus_Huawei Cloud Flexus L Instance/ Best Practices/ Deploying Hermes Agent/ Building a Personal AI Assistant with Hermes Agent (Discord)
Updated on 2026-07-01 GMT+08:00

Building a Personal AI Assistant with Hermes Agent (Discord)

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.

  1. Go to the FlexusL instance purchase page.
  2. 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.

  3. Click Next: Confirm.

    On the displayed page, confirm the order details, read and select the agreement, and click Submit.

  4. Select a payment method and complete the payment.
  5. Go back to the FlexusL console and view the purchased FlexusL instance.
  1. Log in to the FlexusL console and check whether the target FlexusL instance is running the Hermes Agent application image.

  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 Discord Bot

  1. Sign in to the Discord development portal and click New Application.

  2. Enter the custom bot name, read and agree to the terms, and click Create.

  3. On the Applications page, choose Bot from the left navigation pane and click Reset Token to generate a new token.

    If authentication is required, enter the password of your Discord account.

    Copy and keep the token secure for subsequent Hermes Agent configurations.

  4. On the bot configuration page, scroll down to Privileged Gateway Intents and enable the following intents as needed:
    • Message Content Intent: Mandatory. This is required for your bot to read messages. If disabled, the bot cannot read or reply to messages.
    • Server Members Intent: Recommended.
    • Presence Intent: Recommended.

    Enable the required intents and click Save Changes.

  5. In the left navigation pane, choose OAuth2. In the OAuth2 URL Generator module, configure the permissions under Scopes. You are advised to select bot and applications.commands based on the principle of least privilege (PoLP).

  6. Configure the permissions under Bot Permissions. Select View Channels, Send Messages, Embed Links, Attach Files, Read Message History, and Add Reactions (optional).

  7. Copy the generated URL at the bottom of the page and open it in a browser.

  8. In the displayed dialog box, select the Discord server to be added. This requires you to have the administrator permissions of the server.

  9. (Optional) If you have not created a server, you can create one on the Discord home page.

  10. After selecting a server, click Continue to perform authorization.

  11. Check that the server is added successfully. Information shown in the following figure is displayed.

  12. Click the setting button in the lower left corner.

  13. Scroll down to the bottom of the navigation pane on the left and click Developer. Enable Developer Mode and close the dialog box.

  14. Click the user avatar in the lower left corner.

  15. Copy and save the user 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.

  1. In the navigation pane on the left, choose Cloud Servers and click the target server name to view its details.

  2. 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.

  1. 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.

  2. 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.

  3. 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

  1. 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.

  2. Select Quick setup.

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

  4. 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.
  5. Select to configure the platform later.

  6. Enter y to confirm the session start.

  7. In the session window, if the configured model is returned and the reply is normal after you enter hello, the configuration is complete.

  8. Enter /exit to exit the session.
  9. Configure the platform.
    hermes gateway setup
  10. Select the Discord platform.

  11. Enter the token obtained in 3. The entered information is not displayed. Press Enter to go to the next configuration item.

  12. Enter the user ID obtained in 15.

  13. Enter /set-home.

  14. Press Enter to retain the default value Done.

  15. Enter y to confirm the gateway restart.

Step 6: Verify the Bot Conversation

  1. Return to the Discord platform. In the contact list of the Discord server, click the bot added in step 2.

    Type your message in the direct message chat box to start a conversation.

  2. Chat with the bot. Your first conversation with the bot automatically gives you a pairing code.

  3. 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 discord pairing-code
  4. After the pairing is successful, check whether the bot can have a conversation with you. If yes, the integration with Discord is successful.

FAQs