Building an AI Assistant with Hermes Agent and WhatsApp Business Cloud

Hello there! If you’re interested in AI agents and automation, I have some exciting news for you today. We’re going to talk about the new integration between Hermes Agent and WhatsApp Business Cloud. Watching this video, I immediately thought about how I could apply this to my VivaSport project! Imagine having your WhatsApp thinking for you and an AI agent messaging you directly—how convenient would that be?

##

Hermes Agent is an open-source AI agent developed by Nuse Research. It runs in the background on your computer, learning about your projects and remembering how you’ve solved problems in the past. It can perform scheduled tasks, build new skills on its own, and most importantly, it can connect with various messaging apps like Telegram, Discord, Slack, Signal, email, and now WhatsApp.

This means you can get help from AI without having to open a separate app—just send a message, and the agent will reply right in your chat window!

✨ The Key Updates in the New WhatsApp Business Cloud Integration

The most significant update is that Hermes Agent now supports production-level WhatsApp Business Cloud integration. This means you can use it as a private WhatsApp bot for yourself or your team, or as a customer-facing support bot.

Key Features and Capabilities

  • Official Meta Support: Unlike the previous unofficial integration (Bailey’s bridge), this new integration uses Meta’s official support path, allowing you to operate without any ban risks.
  • Easy Setup: You can set it up step-by-step using the Hermes WhatsApp Cloud command.
  • Rich User Experience:
    • Secure Webhooks: Enhances message security.
    • Media and Voice Support: With FFmpeg installed, voice messages are sent as WhatsApp voice notes.
    • Read Receipts: A blue double checkmark appears when messages are read.
    • Typing Indicators: Shows “typing” when the agent is thinking.
    • Interactive Approval Buttons: Provides tappable buttons when the agent needs confirmation, giving a more polished feel.

🛠️ Prerequisites for Integration

To use this amazing feature, you’ll need a few things ready.

  1. Meta Business Account: You need to create a business account on business.facebook.com, not a personal WhatsApp account.
  2. Meta App with WhatsApp Enabled: Create an app on developers.facebook.com/apps and enable the WhatsApp feature.
  3. A Way to Expose Your Computer to the Internet: Use a free tool like Cloudflare Tunnel to expose your local Hermes port to the internet. No need for port forwarding or a domain.
  4. (Optional) FFmpeg Installation: Install FFmpeg if you want to receive voice responses as WhatsApp voice notes.

##

While the video by Julian Goldie goes into detail about the setup process, I’ve summarized the key points I think are most important.

1. Create and Set Up a Meta App

  • Go to developers.facebook.com/apps and create an app, selecting the ‘Connect with customers through WhatsApp’ use case.
  • On the API settings page, ensure your WhatsApp business account is connected.

2. Collect Essential Values (Common Mistakes to Avoid!)

  • Phone Number ID: This is not your actual phone number! Copy the 15~17-digit internal ID found under the ‘From’ dropdown. Many people make a mistake here.
  • Access Token: A token starting with EAA that is at least 100 characters long. Test tokens are only valid for 24 hours, so for a production bot, create a permanent system user token.
  • App Secret: A 32-character code found in Settings > Basic. Treat this like a password and keep it secure.

3. Expose Your Local Port Using Cloudflare Tunnel

  • Install Cloudflare Tunnel and set it up to point to your Hermes port (localhost:3000, etc.). You’ll receive a public link ending with trycloudflare.com.
  • This link will be your callback URL for Meta to send messages. For a stable link, consider using a free ‘Named Tunnel’.

4. Set Up Meta Webhook

  • Start your Hermes gateway, then go to the Webhook section in the Meta dashboard. Enter your callback URL (Cloudflare Tunnel link + /whatsapp/webhook) and Verify Token, then save.
  • Important: Make sure to subscribe to the messages field in the Webhook settings. If you miss this, Meta won’t start sending messages to Hermes.

5. Install and Integrate Hermes Agent

  • Run the Hermes desktop installer or use the curl command to install it via the command line. It will automatically handle all necessary dependencies like Python, Node, and FFmpeg.
  • After installation, run the Hermes WhatsApp Cloud Wizard and enter the values you collected earlier to complete the integration.

💡 Pro Tips and Things to Watch Out For

  • Use a Dedicated Phone Number: It’s best to use a bot-specific number, not your personal one.
  • Development Mode Limitations: In development mode, you can only send messages to a maximum of 5 approved numbers. Add your own number first for testing.
  • 24-Hour Message Rule: Meta restricts sending free messages only to users who have messaged the bot within the last 24 hours. This shouldn’t be an issue for regular chats.
  • Troubleshooting: Most issues are usually due to outdated tunnel links or mismatched Verify Tokens.

✨ How This Could Work for VivaSport?

I’m thinking about using Hermes Agent to push important tournament information and mileage benefits to VivaSport users via WhatsApp. For example, when a user registers for an event, Hermes Agent could send a message like “Your event registration is complete!” and also send reminders before the tournament starts. Additionally, an AI chatbot could respond to user inquiries immediately, improving customer service efficiency.

In summary, the integration of Hermes Agent and WhatsApp Business Cloud is a powerful feature that can significantly expand the possibilities of AI agents. Why not give this guide a try and build your own AI assistant?