---
title: "Deploy Hermes Agent with Hindsight Memory"
description: "Hermes Agent with self-hosted Hindsight memory. One OpenRouter key for both"
category: "AI/ML"
url: https://railway.com/deploy/hermes-agent-with-hindsight-memory
---

# Deploy Hermes Agent with Hindsight Memory

Hermes Agent with self-hosted Hindsight memory. One OpenRouter key for both

**[Deploy Hermes Agent with Hindsight Memory on Railway](https://railway.com/template/hermes-agent-with-hindsight-memory)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/hermes-agent-with-hindsight-memory/manifest.json

- **Creator:** Dektion Studio
- **Category:** AI/ML
- **Total deploys:** 2

## Template content

### Postgres https://devicons.railway.com/i/postgresql.svg

- **Image:** pgvector/pgvector:pg17

### hermes-agent https://raw.githubusercontent.com/NousResearch/hermes-agent/5307e93252ac655cd13fadbd561c0995142138c6/apps/desktop/assets/icon.png

- **Image:** nousresearch/hermes-agent:latest
- **Start command:** `/opt/hermes/docker/entrypoint-dispatch.sh sh -c 'if [ -n "${HINDSIGHT_API_URL:-}" ]; then if [ ! -d "${HERMES_HOME:-/opt/data}/plugins/hindsight" ]; then hermes plugins install hindsight </dev/null >/tmp/hindsight-plugin.log 2>&1 || cat /tmp/hindsight-plugin.log; fi; hermes config set memory.provider hindsight; fi; if [ -n "${MODEL:-}" ]; then hermes config set model "$MODEL"; fi; exec hermes gateway run'`
- **Health check:** /health
- **Public domain:** Yes

### hindsight-api https://raw.githubusercontent.com/vectorize-io/hindsight/25b539ac99088b865931ce8b295b2b6ff9091795/hindsight-favicon.png

- **Image:** ghcr.io/vectorize-io/hindsight-api:0.10.1-slim
- **Health check:** /health

## Documentation

# Deploy and Host Hermes Agent with Hindsight Memory on Railway

This template runs [Hermes Agent](https://github.com/NousResearch/hermes-agent) by Nous Research with [Hindsight](https://github.com/vectorize-io/hindsight) by Vectorize as its long-term memory, both self-hosted in one Railway project. Hermes stores what you tell it in Hindsight, and Hindsight turns it into facts it can recall in later conversations. One OpenRouter key runs both.

Hermes supports Hindsight as a memory provider through a plugin that Vectorize maintains, but setting it up means installing the plugin, running Hindsight with Postgres and pgvector, and pointing one at the other. Here all of that is done on deploy. Hindsight has no public address at all; Hermes talks to it over Railway's private network with a generated key.

## About Hosting Hermes Agent with Hindsight Memory

The deploy form asks for an OpenRouter API key. Set `MODEL` on the hermes-agent service too if you don't want Hermes's default model. When the deploy is done, use `HERMES_API_URL` and `API_SERVER_KEY` from the Variables tab of hermes-agent with any OpenAI-compatible client (the model name is `hermes-agent`), or add a Telegram bot with `TELEGRAM_BOT_TOKEN` and your user ID in `TELEGRAM_ALLOWED_USERS`.

What I tested before publishing: I told Hermes a made-up code word in one chat. Hindsight's logs showed it storing the fact in the `hermes` bank. In a second chat with no shared history, Hermes answered with the code word, and Hindsight's logs showed the recall that supplied it (0.3 seconds). Then I restarted Hermes and asked again in a new chat: same answer, again served by Hindsight.

At idle the three services used about 0.94 GB of RAM together (Hermes 392 MB, Hindsight 388 MB, Postgres 160 MB), roughly $9 a month.

## Common Use Cases

- A personal assistant on Telegram that remembers people, projects and decisions across months of conversations
- An agent behind an OpenAI-compatible API, for Open WebUI or your own code, with memory that doesn't live in the chat history

## Dependencies for Hermes Agent with Hindsight Memory Hosting

An OpenRouter API key. Hermes uses it for its chat model, and Hindsight uses it to extract facts (`openai/gpt-4o-mini`) and to embed them (`openai/text-embedding-3-small`).

### Deployment Dependencies

- Hermes Agent: https://github.com/NousResearch/hermes-agent
- Hindsight: https://github.com/vectorize-io/hindsight
- The Hindsight plugin for Hermes: https://github.com/vectorize-io/hindsight/tree/main/hindsight-integrations/hermes
- Images: `nousresearch/hermes-agent:latest`, `ghcr.io/vectorize-io/hindsight-api:0.10.1-slim`, `pgvector/pgvector:pg17`

### Implementation Details

On first start Hermes installs the Hindsight plugin into its volume and sets `memory.provider` to `hindsight`. The plugin reads the Hindsight address, key and bank name from the `HINDSIGHT_*` variables on hermes-agent, so there's no config file to edit.

Pick Hermes's model with care. Every message carries about 11,500 tokens of Hermes's own instructions and tools before your text. That's a fraction of a cent on `openai/gpt-4o-mini`, and much more on Hermes's default, Claude Opus. `MODEL` is applied on every start.

Don't change the embedding model once memories exist. Vectors from one model can't be searched with another.

Hermes can run shell commands in its container, and so can anyone holding `API_SERVER_KEY`. Keep the key private and `TELEGRAM_ALLOWED_USERS` to people you trust.

## Why Deploy Hermes Agent with Hindsight Memory on Railway?

Memory only helps if the agent and its database are always on, and here they run next to each other on a private network. You pay a few dollars a month for the RAM, and the model bill depends on how much you use it.


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [stella](https://railway.com/deploy/stella) — Self-host stella with web, API, Postgres, Redis, and object storage.
- [Hermes Agent | OpenClaw Alternative with Dashboard](https://railway.com/deploy/hermes-agent-or-openclaw-alternative-wit) — Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

Open this page in a browser: https://railway.com/deploy/hermes-agent-with-hindsight-memory
