---
name: configure-hermes-memory-limits
description: Find, inspect, and increase Hermes agent memory limits (memory_char_limit / user_char_limit) when persistent memory runs out of space. Covers global config, profile overrides, and default values.
---

# Configure Hermes Memory Limits

When Hermes says "Memory at X/Y chars" and won't save new entries, the memory cap needs increasing.

## Why This Matters

Memory is **injected into the system prompt every turn** — bigger limit = more tokens consumed per request.
Too much memory (10k+) dilutes model focus and **increases hallucination risk**.
Default 2200 is conservative; 3000–4000 is a good balance.

## Where the Limits Live

### Default values (in code)

| File | Setting | Default |
|------|---------|---------|
| `/opt/hermes/hermes_cli/config.py` ~697 | `memory_char_limit` | 2200 |
| memory_tool.py (via run_agent.py param) | `user_char_limit` | 1375 |

Two stores:
- **memory** (memory_char_limit=2200) — agent's notes about projects, preferences, env details
- **user** (user_char_limit=1375) — user profile (who the user is)

### Config loading chain

DEFAULT_CONFIG → user config.yaml (deep-merge) → profile config (deep-merge)

Each level deep-merges, so you can override just the keys you need.

## How to Increase

### Option A: Global config (RECOMMENDED)

Create or edit `HERMES_HOME/config.yaml` (usually `~/.hermes/config.yaml`):

```yaml
memory:
  memory_char_limit: 3000    # default: 2200
  user_char_limit: 3000      # default: 1375
```

### Option B: Per-profile config

```yaml
# HERMES_HOME/profiles/<profile-name>/config.yaml
memory:
  memory_char_limit: 4000
  user_char_limit: 2500
```

### Option C: Direct code change (NOT recommended)

Edit `/opt/hermes/hermes_cli/config.py` directly. May be overwritten on Hermes updates.

## How to Check Current Usage

Call `memory(action='add', ...)` — the response includes a usage bar like:
```
"usage": "83% — 1,833/2,200 chars"
```

## Verification

Config is read by `load_config()` at session start. No hot-reload — restart agent to apply.

## Pitfalls

- ❌ **Restart required** — config is loaded at startup, not hot-reloaded
- ❌ **Too high (10k+) wastes tokens and causes hallucinations** — memory dilutes model focus
- ❌ Editing `/opt/hermes/` code directly — can be overwritten by updates
- ❌ YAML key typo — must be exactly `memory_char_limit` / `user_char_limit` under `memory:`
- ❌ Wrong config path — tool uses `get_hermes_home()` which checks `HERMES_HOME` env var, falls back to `~/.hermes`
