Academy → Using HermesOfficial documentation · clear explanation

Persistent Memory

الذاكرة المستمرة

Intermediate17 minutes3 questions2026-08-09
The idea in one minute

Start with meaning, then move to detail.

This lesson explains Persistent Memory as part of extending Hermes and connecting external tools. You will learn what it does, when it matters, and the smallest safe test that proves it works.

If you are new

If you are new, do not memorize names. Focus on three questions: what problem does this solve, what access does it need, and how can you verify the result?

For hands-on use

For practice, inspect the first example, identify its effects, run it on test data, and compare the result with the source claim.

For specialists

For advanced readers, inspect How It Works, How Memory Appears in the System Prompt, Memory Tool Actions, then verify failure modes and version compatibility.

What do you need first?

Complete installation and one successful task before adding new capabilities.

What will you know?

A clear outcome before you read.

  • Understand Persistent Memory without assumed prior knowledge.
  • Separate the source description from what still needs testing in your environment.
  • Read the first command and identify its inputs and outputs before copying it.
Lesson terms

Short definitions before the details.

Session & memory
A session holds conversation context, while memory keeps selected facts that should persist.
Tool
A structured action the agent can call to read or change something.
Official page description

How Hermes Agent remembers across sessions — MEMORY.md, USER.md, and session search

Topic map

What does the source say, and in what order?

  1. 01
    How It Works

    Start here to understand the core idea or structure.

  2. 02
    How Memory Appears in the System Prompt

    Read this after the foundation, then connect it to the previous step.

  3. 03
    Memory Tool Actions

    Read this after the foundation, then connect it to the previous step.

  4. 04
    Substring Matching

    Read this after the foundation, then connect it to the previous step.

  5. 05
    Two Targets Explained

    Read this after the foundation, then connect it to the previous step.

  6. 06
    memory — Agent's Personal Notes

    Read this after the foundation, then connect it to the previous step.

  7. 07
    user — User Profile

    Read this after the foundation, then connect it to the previous step.

  8. 08
    What to Save vs Skip

    Read this after the foundation, then connect it to the previous step.

  9. 09
    Save These (Proactively)

    Read this after the foundation, then connect it to the previous step.

  10. 10
    Skip These

    Finish here to verify the result and special cases.

Examples from the official page

Copy only after you understand the effect.

══════════════════════════════════════════════ MEMORY (your personal notes) [67% — 1,474/2,200 chars] ══════════════════════════════════════════════ User's project is a Rust web service at ~/code/myapi using Axum + SQLx § This machine runs Ubuntu 22.04, has Docker and Podman installed § User prefers concise responses, dislikes verbose explanations
If the substring matches multiple entries, an error is returned asking for a more specific match. ## Two Targets Explained ### `memory` — Agent's Personal Notes For information the agent needs to remember about the environment, workflows, and lessons learned: - Environment facts (OS, tools, project structure) - Project conventions and configuration - Tool quirks and workarounds discovered - Completed task diary entries - Skills and techniques that worked ### `user` — User Profile For information about the user's identity, preferences, and communication style: - Name, role, timezone - Co
The agent should then: 1. Read the current entries (shown in the error response) 2. Identify entries that can be removed or consolidated 3. Use `replace` to merge related entries into shorter versions 4. Then `add` the new entry **Best practice:** When memory is above 80% capacity (visible in the system prompt header), consolidate entries before adding new ones. For example, merge three separate "project uses X" entries into one comprehensive project description entry. ### Practical Examples of Good Memory Entries **Compact, information-dense entries work best:**
Try it now

Read the first command and identify its inputs and outputs before copying it.

Match every command to your installed Hermes version, review the files and accounts it can reach, and use non-sensitive data for the first test. If this explanation differs from the source, the official source wins.

Knowledge check

Three decisions before completion.

1. What is the source of truth when “Persistent Memory” changes?
2. What is the best way to apply this lesson?
3. What should happen before a step can modify files or an external account?