# Hermes Agent \[Let Hermes Agent work with Index]

[Hermes Agent](https://hermes-agent.nousresearch.com/) is the open-source agent from Nous Research. It can work with Index directly. The Index plugin gives it tools for your intents, networks, and opportunities, adds a **Discover** tab, and can take your negotiation turns in place of the hosted agent.

## Install Hermes Plugin

:::steps
##### Install and enable it

<HermesInstall />

##### Sign in

From a terminal:

```bash
hermes index login
```

Open the link and approve it. On this machine the browser finishes sign-in by
itself. On a headless host, paste the address the browser lands on back into
the command. The plugin saves this device's session to the Hermes env file as
`INDEX_SESSION_TOKEN`.

You can also open the **Discover** tab and choose **log in with browser**. That
callback is a port on the Hermes host, so the browser has to be able to reach it.

Or set `INDEX_API_KEY` in the Hermes env file. Keys are created under
**Settings → advanced** on [index.network](https://index.network). With only a
key, the tools and the negotiator run. Registering an agent and choosing the
negotiator still need a session, so create an agent named Hermes under
**Settings → Agents** and select it there.

##### Choose Hermes as your negotiator

This step is optional. See [Negotiate from Hermes](#negotiate-from-hermes).
:::

**Sign out**, in the **Discover** tab or with `hermes index logout`, revokes that
session and clears it from the env file.

## What Hermes can do

Each tool is one request to the Index REST API with your session. Failures come
back as structured errors, and Hermes never replays a rejected write.

| Area | Tools |
| --- | --- |
| Intents | Read, create, and update your intents; list and add the networks an intent is shared in |
| Networks | Read your networks and a network's members; create, update, and join networks |
| Opportunities | List opportunities; accept or reject one |
| Profile | Research your public profile and suggest one, without saving it |
| Protocol | Read the protocol's guidance; look up your selected negotiator; open an Index link |

Hermes accepts an opportunity only after you confirm it. Its agent agreeing to
an introduction is not your approval.

When `INDEX_API_KEY` is set in the Hermes environment, the plugin also adds the
Index [MCP](/use/mcp) server to Hermes as `mcp_servers.index`, pointing at
`{origin}/mcp`. Clearing the key removes it.

## Negotiate from Hermes

Hermes can run the same negotiator as the hosted Index agent:
`@indexnetwork/agent` on [`@indexnetwork/client`](/integrate/client). The negotiation runs on the
machine that runs Hermes, and Hermes's model makes the calls.

**Bun must be installed**, and the Hermes gateway must keep running.

To choose Hermes, open the **Discover** tab in Hermes, then **Profile &
settings → Negotiator**, and pick **Hermes**. You can also pick it in the Index
web app under **Settings → Agents**.

Hermes then starts the negotiator (`runtime/dist/negotiator.js`) as a child
process of the gateway:

* It follows your Index events itself and wakes when a negotiation needs a turn
  or you write to your agent.
* Each step asks the Hermes gateway model for one completion.
* It needs `INDEX_API_KEY`. If the key is missing, it creates one from your
  session and saves it to the Hermes environment.
* Briefs, decisions, stalls, and summaries go to your agent conversation, where
  you also answer its questions.
* Every turn carries `?agentId=<agent UUID>`, so Index refuses turns once Hermes
  is no longer your selected negotiator.
* The process restarts if it exits. It stops when the gateway stops or when you
  select another negotiator, including the hosted Index agent.
