Skip to content
EN
Add to Chrome

Connect Hermes through Riff Connect

How-toNew

For anyone who runs a Hermes agent and wants Riff to reach it from anywhere without setting up a tunnel. It takes a few minutes. The connector runs on your own Cloudflare account and its code is public, so nothing passes through Zima Media.

A code, a 1-click install on Cloudflare, one message for Hermes, and it connects with no tunnel.

Before you start

  • Hermes with its API server on. API_SERVER_ENABLED=true in ~/.hermes/.env on the agent's computer (Connect a Hermes agent has the line). The connector reaches it on that computer, so you don't need API_SERVER_HOST, a tunnel or the extension-ID line.
  • A Cloudflare account. The free plan is enough, and you can sign up on the way.
  • A GitHub account. Cloudflare puts a copy of the connector's code there, so you can update it later.

1. Make a pairing code

  1. In Riff Home › Models, click Add on Add a model app.
  2. Set App to Hermes agent, through Riff Connect. The form shows three steps, Open source · MIT and View the code on GitHub ↗.
  3. Click Make and copy a code. Riff makes a pairing code of 20 characters in groups of five, puts it in Pairing code and copies it: Pairing code copied. Paste it when Cloudflare asks for PAIRING_CODE.

2. Deploy it on Cloudflare

Click 1-click install on Cloudflare. Cloudflare's deploy page opens in a new tab:

  1. Sign in, or sign up.
  2. Keep the names it offers for the Worker and for your copy of the code, or type your own.
  3. When it asks for PAIRING_CODE, paste the code.
  4. Press Deploy. When it's done, Cloudflare shows the Worker's address, ending in workers.dev.

Lost your place on the way? See Riff Connect won't connect.

3. Pair Riff

Back in Riff, paste the address into Connector address and click Save and connect. The browser asks once to let Riff reach that address: allow it. Riff pairs with the connector and says Paired with your connector. Card requests from Hermes now come in through it too.

The pairing code is used once and isn't saved. Riff keeps its own key instead.

4. Connect Hermes

The card now reads Waiting for Hermes. and shows two things to do on the Hermes computer.

  1. In a terminal there, run the two commands. Copy commands copies both:
    • hermes plugins install zimamedia/riff-connect-hermes --enable
    • hermes gateway restart
  2. Click Copy for Hermes and paste the message into a chat with Hermes. It reads like Connect to my Riff: call riff_connect_pair with address https://… and code K7QM-3XRA.

The code in that message is a one-time code for Hermes, not your pairing code. It works once, for 15 minutes; New code makes another. Riff looks every few seconds and turns the card to Connected by itself.

Connected

The card reads Connected, with Riff Connect and the Worker's address under its name, and Through Riff Connect, with no tunnel. Card requests from Hermes come in through it too. Chat with this agent opens a chat with it Chat with your agent, the Board runs cards on it The Board: cards your agent works on, and Hermes can ask for cards of its own Cards your agent asks for.

How it's kept safe

  • The Worker and its data live on your Cloudflare account, and the plugin on your computer. The plugin opens one connection out to your Worker; nothing on your computer takes connections from outside.
  • Riff and Hermes each get their own key, and the Worker keeps only their hashes. After 8 wrong pairing codes, pairing locks for 15 minutes.
  • The Worker passes on only the parts of Hermes's API that Riff uses: chat, runs and sessions. Hermes's own key can leave card requests and ask what became of them; it can't read your board.
  • What you type in an agent chat, and a card's task, travel from your browser through your Worker to your computer.

Update or remove it

  • Update the plugin: hermes plugins update riff-connect-hermes, then hermes gateway restart. Update the Worker: push a change to your copy of the code and Cloudflare deploys it again.
  • Remove it: Edit on the card, then Remove and Remove?. Riff also unpairs from the connector, so card requests stop too. The Worker stays on your Cloudflare account until you delete it there.

Riff uses one Riff Connect at a time. Adding a second says Riff already reaches Hermes through Riff Connect (…). Edit that one instead.