Hermes WeChat Integration: Authentication, Configuration Fields, and Setup Flow

Hermes Agent has added a WeChat channel. This article covers the authentication mechanism, key configuration fields, setup flow, and main constraints of the WeChat integration.

Hermes Agent recently added WeChat channel integration. This article covers its authentication mechanism, configuration fields, setup flow, and main constraints, for users who need to connect Hermes to WeChat.

Authentication Mechanism

The WeChat integration uses iLink Bot API QR-code scan login. It requires no Webhook and receives messages via Long Polling. Authentication happens locally, and credentials are automatically saved to ~/.hermes/weixin/accounts/, so you don’t need to scan again later.

Configuration Fields

Field Required Description
WEIXIN_ACCOUNT_ID Yes iLink Bot account ID, obtained automatically after QR login
WEIXIN_TOKEN Yes iLink Bot authentication token
WEIXIN_BASE_URL No API endpoint; leave blank to use iLink’s default service address
WEIXIN_DM_POLICY No Direct-message policy, see below
WEIXIN_GROUP_POLICY No Group-message policy, see below

Access Policies

Direct-message (DM) policy (WEIXIN_DM_POLICY):

  • open: accepts DMs from anyone
  • allowlist: only accepts whitelisted users
  • disabled: turns off DMs
  • pairing: requires pairing confirmation

Group-message policy (WEIXIN_GROUP_POLICY):

  • open: accepts messages from all groups
  • allowlist: only accepts whitelisted groups
  • disabled: turns off group messages (default for personal accounts)

Setup Flow

Run it, choose Weixin, then follow the prompts to scan the QR code shown in the terminal with the WeChat mobile app and confirm the login on your phone. Credentials are saved automatically by hermes — no need to manually configure the token fields.

Media Capabilities

The adapter natively supports image, video, file, and voice messages. CDN transfers use AES-128-ECB encryption/decryption, handled internally by hermes and transparent to the user.

Main Constraints

  • Single-instance limit: the same token can only be used by one hermes instance at a time. Multiple instances require multiple separate accounts.
  • Group messages off by default: the default value of WEIXIN_GROUP_POLICY for personal WeChat accounts is disabled; you must set it explicitly to receive group messages.
  • Automatic message splitting: replies longer than 4,000 characters are split and sent automatically at semantic boundaries.
  • Dedup window: duplicate messages within 5 minutes are filtered to prevent duplicate processing.