WhatsApp Integration and Group Policy

Summary

The Hermes agent integrates with WhatsApp by functioning as a linked device, allowing it to monitor and respond to messages across all chats associated with a specific phone number. This integration supports both direct messages and group chats, governed by a configurable groupPolicy that determines which messages the agent processes.

Details

The WhatsApp integration for the Hermes agent operates by linking the agent to a WhatsApp account as a companion device. This process involves a standard linking procedure, after which the agent is “live and listening.” Once connected, the agent has visibility into every conversation the primary account can see, including all existing direct messages and group chats.

Connectivity and Testing

Verification of the WhatsApp link is typically performed by sending a test message to the linked phone number (e.g., +3546609570) from a separate device or by interacting with the bot within a group chat. Successful integration is indicated by the agent’s status showing as “Configured,” “Linked,” “Running,” and “Connected.” Incoming and outgoing messages are reflected in the Chat tab of the Sokrates dashboard, providing a real-time view of the agent’s communication flow.

Group Chat Behavior

The agent’s interaction with group chats is controlled by the groupPolicy configuration. When this policy is set to "open", the agent processes all messages within any group it is a member of. Because the agent acts as a linked device, it is automatically “in” every group that the host WhatsApp account belongs to. There is no requirement to manually add the bot to a group if the host account is already a participant.

Security and Privacy Considerations

A significant architectural detail of this integration is that the agent sees everything the host account sees. In development environments (such as sokrates-dev), using a personal number is often sufficient for testing. However, for production deployments, the project documentation strongly recommends using a dedicated phone number. This separation is a critical privacy measure to prevent the AI assistant from accessing sensitive or personal conversations, such as private family group chats, that might be present on a developer’s or administrator’s personal account.