Integrating with Hermes Agent and OpenClaw

Field-tested recipes. The Hermes path below ran a production iMessage/WhatsApp gateway; the OpenClaw path follows its documented provider contract.

Both integrations share one idea: Engram is a transparent proxy, so the agent never knows it exists. You change one base URL, and every conversation the agent has, on any channel, reads and writes one shared memory store. Prerequisites for everything below:

pip install engram-proxy
ollama pull qwen3:1.7b qwen3-embedding:0.6b
engram up          # proxy on :11435, Ollama on :11434 behind it

Hermes Agent

Local model as the agent brain

Edit ~/.hermes/config.yaml and point the model block at Engram instead of Ollama:

model:
  default: your-model          # any Ollama model tag
  provider: ollama
  base_url: http://localhost:11435/v1     # was 11434
  ollama_num_ctx: 65536
  context_length: 65536
fallback_providers:
  - provider: ollama
    model: qwen3:1.7b
    base_url: http://localhost:11435/v1

Then restart the gateway (hermes gateway restart) or just start a new hermes chat. That is the whole integration: every turn now gets memory recall before the model answers, and every exchange forms memories afterward.

Hermes requires a 64k context window and verifies the real allocation, not just your config. Two practical consequences on consumer hardware:
  • Ollama's /v1 endpoint ignores per-request num_ctx, so bake it into a model variant: printf 'FROM qwen3:1.7b\nPARAMETER num_ctx 65536\n' > Modelfile && ollama create my-agent -f Modelfile
  • A 64k KV cache is ~6GB at f16 for qwen3-class models. Halve it with KV quantization before blaming anything else: launchctl setenv OLLAMA_FLASH_ATTENTION 1 and launchctl setenv OLLAMA_KV_CACHE_TYPE q8_0, then restart the Ollama app (measured: 7.5GB resident became 3.9GB with no visible quality change).

Cloud model as the agent brain, local memory

Hermes talks to several clouds over the Anthropic Messages protocol. Engram can sit in that path too, so a frontier model gets your local memory while embeddings and summarization stay on your machine:

# 1. run Engram with a cloud route for Anthropic-protocol traffic
ENGRAM_ANTHROPIC_UPSTREAM=https://api.minimax.io engram up

# 2. point Hermes's provider base URL at Engram's anthropic path
#    (env var name depends on the provider; MiniMax shown)
echo 'MINIMAX_BASE_URL=http://127.0.0.1:11435/anthropic' >> ~/.hermes/.env
hermes gateway restart

Auth headers pass through untouched. The whole Messages surface follows the cloud upstream (count_tokens and batches included), so the SDK never goes split-brained. Added cloud cost is the injected block only, and big-prompt injection rides the newest message so the provider's prompt-cache discount survives.

Give the agent explicit memory verbs

Transparent injection works with any model. On top of that, Hermes agents can call Engram's memory tools directly (search, save, correct, pin, forget, profile), over the same store:

hermes mcp add engram-memory --command engram --args mcp
hermes gateway restart

Use the full path to the engram binary if it is not on the PATH Hermes launches with (which engram). Tool-calling reliability depends on the agent model; small local models see the tools but fumble the calls, while frontier-class models use them cleanly.

Performance notes from production

OpenClaw

OpenClaw mandates Ollama's native API for local models (its docs warn that /v1 breaks tool calling). Engram speaks that NDJSON protocol byte-faithfully, so the integration is one provider entry, keeping api: "ollama":

// openclaw.json (or your models config)
{
  "models": {
    "mode": "merge",
    "providers": {
      "engram": {
        "baseUrl": "http://127.0.0.1:11435",
        "api": "ollama",
        "apiKey": "ollama-local"
      }
    }
  }
}

Running alongside the agent's own memory

Both Hermes (MEMORY.md, USER.md) and OpenClaw (MEMORY.md, daily notes, its memory plugin slot) ship built-in memory. You do not have to choose:

Verifying it works

engram why        # the exact block injected into the last turn, score by score
engram list       # watch traces form a few seconds after each exchange
engram stats      # queue depth and degraded-recall counters

Open the observatory at 127.0.0.1:11435/engram/ui and leave it on a side screen: agent turns flare the memories they touch, and reinforced ones visibly migrate toward the core. The decisive test is always the same: tell the agent a fact on one channel, then ask about it obliquely from another. The answer can only come from Engram.

Full documentation · Home · GitHub