Skip to main content
The Hermes plugin wires Spectral Memory into your Hermes3 agent automatically: injecting the [MEM] block at session start, calling /flush before compression, and exposing encode/decode as agent tools.

Requirements

  • Python 3.10+
  • A running Hermes3 agent
  • A Spectral Memory API key

Install

git clone https://github.com/jeannemtl/spectral-memory-plugin
cd spectral-memory-plugin
pip install -r requirements.txt

Configure

Set your API key and user ID:
export SPECTRAL_API_KEY="YOUR_API_KEY"
export SPECTRAL_USER_ID="your_user_id"
export SPECTRAL_BASE_URL="https://api.spectralmemory.com"  # default
Or create a .env file in the plugin directory:
SPECTRAL_API_KEY=YOUR_API_KEY
SPECTRAL_USER_ID=your_user_id

Wire into your agent

Session start

Call /context and inject the returned fdm_block into your system prompt:
from spectral_memory import SpectralMemoryClient

client = SpectralMemoryClient()

# At session start
ctx = client.get_context()
system_prompt = f"{base_system_prompt}\n\n{ctx['fdm_block']}"

Before compression

Call /flush before any context compression:
# Before compressing
client.flush()
# Now compress
agent.compress()

Encoding facts

client.encode("USER.gpu", "RTX5090")
client.encode("TASK.current", "training")
client.encode("PROJ.token_budget", "1024")

Decoding facts

result = client.decode("USER.gpu")
print(result["value"])  # RTX5090

Automatic wiring

If your agent framework supports hooks, the plugin can wire all of the above automatically. See the plugin README for framework-specific instructions.