**Duration:** ~35 minutes
**Prerequisites:** Module 5 (Skills System)
**Skill Level:** Intermediate
6.1 Introduction
In Module 5, you learned how skills make the agent permanently capable. But skills are just one piece of the training puzzle. A truly effective agent knows not just *what to do*, but *how you like things done* — your preferences, your conventions, your environment, your communication style.
This module covers the complete training system:
- **Memory:** How the agent stores and retrieves information about you
- **Corrections:** How every mistake becomes a learning opportunity
- **User profiles:** Who you are, what you prefer, how you work
- **Session search:** Finding past work and context
- **The compound effect:** How 50+ sessions of training produce an agent that knows your entire stack
After this module, you'll be able to train Hermes to be *your* agent — not just a generic AI assistant.
6.2 How Memory Works
Hermes Agent has a structured memory system with two main targets:
Memory Targets
| Target | Purpose | Example |
|---|---|---|
| `memory` | General facts, preferences, and knowledge | "Prefers tabs over spaces" |
| `user_profile` | Identity, roles, and communication style | "Senior DevOps engineer, Python expert" |
The `memory` Target
The `memory` target stores general facts the agent should remember across sessions.
**What goes in memory:**
- Environment configuration (OS, tools installed, paths)
- Project conventions (naming, structure, workflow)
- Personal preferences (editor, language, formatting)
- Lessons learned (mistakes, edge cases, workarounds)
- Common credentials or connection info (without secrets)
**How it works:**
- Memory is persistent across sessions
- The agent queries memory when it needs context it doesn't have
- Memories can be tagged for better retrieval
- New memories are added explicitly or by correction
The `user_profile` Target
The `user_profile` target is a structured profile of *you* — your identity, expertise, and communication preferences.
**What goes in user_profile:**
- Your name and role
- Technical expertise level
- Communication style (verbose/concise, formal/casual)
- Preferred tools and technologies
- Timezone and working hours
- Language and locale preferences
6.3 The Memory Tool
Memory is managed through the `memory` tool with three actions: `add`, `replace`, and `remove`.
Adding Memory
memory(add, "The user prefers two-space indent in Python files")
memory(add, "Project root is at /home/user/projects/myapp")
memory(add, "Deployments target staging.example.com")
You can also add memories directly through conversation:
**User:** "Remember that I use tabs for Go files."
>
**Agent:** "Got it. I've memorized: User prefers tabs for Go files."
The agent extracts the key information and stores it properly.
Replacing Memory
When a fact changes:
memory(replace, "The user prefers tabs for Go files", "The user now prefers spaces for Go files")
Removing Memory
When a fact is no longer relevant:
memory(remove, "The old project root was at /home/user/projects/legacy")
Batch Memory Operations
For larger updates:
memory(add, [
"Database host is db.internal.example.com",
"Database port is 5432",
"Production database is named 'myapp_prod'"
])
6.4 What to Save in Memory
Effective memory management is about knowing what's worth remembering. Here's a guide:
✅ Save These
| Category | Examples |
|---|---|
| **Preferences** | "Prefers dark mode terminals", "Uses neovim not vim" |
| **Environment facts** | "Running on Ubuntu 24.04", "Python 3.12 is default" |
| **Project conventions** | "Uses pnpm not npm", "Tests use pytest" |
| **Paths and locations** | "Code at /home/user/code", "Logs at /var/log/myapp" |
| **Credentials context** | "SSH key is at ~/.ssh/id_ed25519" (not the key itself!) |
| **Lessons learned** | "Port 8080 requires sudo", "Docker needs --platform linux/amd64 on this machine" |
| **Workflow preferences** | "Always run tests before committing", "Use feature branches" |
| **Access patterns** | "Usually deploys on Tuesdays", "Check staging before production" |
❌ Don't Save These
| Category | Why Not |
|---|---|
| **Secrets/passwords** | Memory is stored on disk — treat it as unencrypted |
| **Task progress** | "I'm 60% through the migration" — stale immediately |
| **Completed work** | "Deployed v2.3 yesterday" — irrelevant tomorrow |
| **Temporary state** | "The build failed with error X" — belongs in the current session |
| **Obvious facts** | "The sky is blue" — wastes memory space |
| **Emotional state** | "User was frustrated" — not useful for future sessions |
The Litmus Test
Before saving something to memory, ask:
1. **Will this be true next month?** — If no, it's temporary state, not memory.
2. **Will I need this again?** — If no, it's one-off context.
3. **Is this a preference or a fact?** — Preferences and stable facts are good memory.
4. **Can I look this up faster than storing it?** — Some things are better documented externally.
6.5 How Corrections Make the Agent Smarter
Every interaction with the agent is a training opportunity. When the agent gets something wrong, your correction is the most valuable data it can receive.
The Correction Mechanism
When you correct the agent:
User: "Deploy to staging, not production."
Agent: "You're right. I've corrected my understanding.
Memory updated: Deployments target staging first.
Would you like me to save this as a skill?"
The agent:
1. **Acknowledges** the correction
2. **Updates** its memory with the correct information
3. **Offers** to create a skill if the correction represents a repeatable workflow
Types of Corrections
| Correction Type | Example | Agent Response |
|---|---|---|
| **Factual** | "The database is PostgreSQL, not MySQL" | Updates memory |
| **Preferential** | "I prefer full sentences in responses" | Updates user_profile |
| **Procedural** | "Always run lint before commit" | Updates memory + offers skill |
| **Environmental** | "The API is on port 3000, not 8080" | Updates memory |
| **Safety** | "Never delete files without confirmation" | Updates memory as rule |
The One-Correction Rule
A well-trained agent should never make the same mistake twice. If you correct the agent about something, and it makes the same error in a future session, that's a sign the memory didn't stick — escalate it to a skill.
6.6 Teaching Your Agent Your Preferred Workflows
The most powerful training happens when you teach the agent your workflows step by step.
The Walk-Through Method
The first time you do a complex task, walk the agent through it:
**User:** "Let me show you how I set up a new project. First, I clone the template repo..."
>
**Agent:** "I'm following. Clone from which repo?"
>
**User:** "git@github.com:myorg/project-template.git"
>
**Agent:** "Noted. What's next?"
>
**User:** "Then I run `pnpm install` and configure the `.env` file..."
>
**Agent:** "I see the pattern. After this walk-through, would you like me to save this as a skill called 'setup-new-project'?"
The Shadow Mode
For workflows you're experienced with, let the agent shadow you:
**User:** "Watch what I do for deploying to production. I'll narrate."
>
(User performs the steps)
>
**Agent:** "I observed your deployment workflow. It involved:
1. Run tests (`pnpm test`)
2. Build (`pnpm build`)
3. Copy to server (`rsync -avz dist/ user@server:/var/www/`)
4. Reload nginx (`ssh user@server 'sudo systemctl reload nginx'`)
>
Shall I save this as a skill called 'deploy-production'?"
The Correction Pipeline
Every correction should be treated as a potential pipeline input:
Correction → Memory Update → Skill Offer → (optional) Skill Creation
**Real example:**
**User:** "No, don't use `cp` — use `rsync` with compression."
>
**Agent:** "Corrected. Memory updated: Use `rsync -avz` instead of `cp` for deployments."
>
**User:** "Yes, save that as a skill."
>
*(Agent creates `deploy-with-rsync` skill)*
This pipeline is the single most powerful training technique in Hermes Agent.
6.7 User Profiles
The `user_profile` target stores structured information about who you are and how you like to interact.
Creating Your Profile
Start with the basics:
memory(user_profile, "Senior DevOps engineer at Acme Corp")
memory(user_profile, "Expert in: Python, Go, Kubernetes, Terraform")
memory(user_profile, "Prefers concise, action-oriented responses")
memory(user_profile, "Timezone: US/Eastern")
memory(user_profile, "Communication style: direct, minimal pleasantries")
memory(user_profile, "Preferred code editor: Neovim")
memory(user_profile, "Shell: zsh with oh-my-zsh")
Profile Sections
A well-built profile covers:
**Identity**
- Your name, role, team, organization
- Your technical role (developer, SRE, data scientist, etc.)
**Expertise**
- Languages you know well (so the agent can tailor code examples)
- Frameworks and tools you use daily
- Areas where you want more guidance vs. areas where you're expert
**Communication**
- Verbosity preference (one-liners vs. detailed explanations)
- Formality level (casual vs. formal)
- Response structure preference (bullet points, paragraphs, steps)
- Whether you want citations, confidence levels, or options
**Environment**
- Operating system and version
- Default shell and terminal
- Package manager preferences
- Editor/IDE configuration
**Workflow Preferences**
- Testing before deployment (always/never/ask)
- Staging/production workflow
- Git workflow (feature branches, rebase, squash)
- Code review expectations
Evolving Your Profile
Your profile isn't static. As your preferences change:
memory(user_profile_replace, "Prefers concise responses",
"Now prefers detailed explanations with examples")
Or let the agent observe:
**Agent:** "I notice you've been asking for more detailed explanations lately.
Would you like me to update your profile from 'concise' to 'detailed'?"
6.8 Memory Curation
Memory accumulates. Left unchecked, it becomes cluttered with outdated facts, superseded preferences, and irrelevant context.
Reviewing Memory
List all stored memories:
/memory list
/memory list --tag database
/memory list --since 2025-01-01
Pruning Stale Memories
**User:** "Check my memory for anything outdated."
>
The agent reviews each memory against current reality and suggests pruning.
Automated Curation
The agent can auto-curate memories:
- **Staleness detection:** Memories older than 90 days are flagged
- **Contradiction detection:** If two memories conflict, the agent asks for clarification
- **Deduplication:** Similar memories are merged
- **Low-value flagging:** Very generic memories are suggested for removal
Memory Health Check
Run a periodic memory audit:
/memory health-check
The agent produces a report:
Memory Health Report
====================
Total memories: 47
Recently added (30d): 12
Stale (90d+): 3
Conflicts: 0
Duplicates: 1
Recommendations:
- Remove: "Used to use Apt" (superseded by "Uses Nix")
- Remove: "Project path was /tmp/test" (temporary)
- Merge: 2 memory entries about Go formatting preferences
6.9 Session Search
Sometimes the answer isn't in memory — it's in a previous conversation. Session search lets you find past context.
Searching Sessions
/session search "database migration plan"
/session search --from 2025-03-01 --to 2025-03-15
/session search --tag deployment
Session Context Loading
When you find a relevant session, you can load its context:
/session load last-deployment-conversation
This brings the agent up to speed on what was discussed and decided.
Session Tags
Tag important sessions for easy retrieval:
/session tag "production-incident-2025-05-15"
Smart Session Linking
The agent automatically links sessions to memory and skills:
**User:** "Remember that issue we debugged last week?"
>
**Agent:** "I found the session from May 16 about the database connection
timeout. Key findings:
- Pool size was too small (5 connections)
- Fix: Increased to 25 connections in the config
- Root cause: Connection leak in the worker pool
>
I've saved this as a memory entry. Shall I make a diagnostic skill for it?"
6.10 The Compound Effect
The headline claim of Hermes Agent is that it gets better over time. Here's what that actually means in practice.
Session 1: First Contact
The agent knows nothing about you. Everything is manual. You describe your environment, preferences, and needs from scratch. The agent asks clarifying questions.
**Experience:** Like talking to a competent stranger.
Session 10: Familiarity
The agent knows your basic preferences, your common tools, your environment. It stops asking "what OS?" and starts remembering previous conversations.
**Experience:** Like a new coworker on week two.
Session 25: Competence
The agent has a solid library of skills (10-15), a populated memory, and a user profile. It anticipates your needs and suggests skills unprompted. Corrections are rare and specific.
**Experience:** Like a junior team member who's been on the project for a month.
Session 50: The Tipping Point
The agent crosses into **autonomous competence**. It has 30-50 skills covering your entire workflow. It:
- Loads the right skill without being asked
- Chains multiple skills for complex tasks
- Remembers project-specific conventions
- Suggests improvements to your workflows
- Corrects itself before you can
- Handles entire workflows with a single command
**Experience:** Like a senior engineer who's worked with you for years.
Session 100+: Mastery
The agent has your entire stack memorized. It knows every tool, every config file, every deployment target, every team convention, every edge case you've ever encountered. It's not just an assistant — it's a force multiplier.
**Experience:** Telepathy. You think about what needs doing, and the agent has already started.
What Drives the Compound Effect
| Session Range | Key Actions | Result |
|---|---|---|
| **1-10** | Create user profile, add core memories, skill 3-5 repeated tasks | Basic competence |
| **11-25** | Skill all repeated workflows, curate memories, develop correction reflex | Reliable execution |
| **26-50** | Refine skills with pitfalls, publish useful skills, build profile depth | Autonomous operation |
| **51-100** | Skill complex multi-step processes, chain skills, teach edge cases | Mastery |
6.11 Practical Training Workflow
Here's a step-by-step workflow for training your agent in any new domain:
Step 1: Prime the Memory
Before working in a new domain, add relevant context:
memory(add, "Working on project AcmeWeb, a Django app at /home/user/acmeweb")
memory(add, "Using Python 3.12, PostgreSQL 16, Redis 7")
memory(add, "Deploy target: acmeweb.staging.company.com via systemd")
Step 2: Walk Through the First Task
Do the task once with the agent observing:
User: "Let me show you how to deploy the staging environment..."
(Walks through the deployment)
Agent: "I see the pattern. Save as skill?"
Step 3: Create Skills from Repeatable Tasks
For every step you'll do again, create a skill:
- Skill: `deploy-acmeweb-staging`
- Skill: `rollback-acmeweb-staging`
- Skill: `check-acmeweb-health`
Step 4: Correct Liberally
Every mistake is a teaching moment:
User: "No, use the staging config, not production."
Agent: "Corrected. Saving to memory: Always use staging config first."
Step 5: Review and Curate
At the end of the session:
Memory check: Are there any new preferences or facts to save?
Session tag: Tag this session for future reference.
6.12 Common Training Mistakes
Mistake 1: Saving Too Much
Don't save everything. Focus on **reusable facts**, not ephemeral context.
❌ `memory(add, "The build failed twice before succeeding")` — ephemeral, not useful
✅ `memory(add, "Build sometimes fails on the first attempt due to cache issues")` — reusable lesson
Mistake 2: Saving Secrets
Never save passwords, API keys, or tokens in memory. Memory files are readable on disk.
Mistake 3: Not Correcting
The most common mistake is letting small errors slide. Every uncorrected error is a future repeated error.
Mistake 4: Skipping the Skill Prompt
When the agent asks "Should I save this as a skill?" — say yes if it's repeatable. The agent's judgment about what's skill-worthy is conservative; it's better to have an extra skill than to lose a useful procedure.
Mistake 5: Neglecting Curation
Old memories create noise. Prune monthly. A cluttered memory is almost as bad as no memory.
6.13 Summary
Training your Hermes Agent is an investment that compounds with every session.
**Key takeaways:**
- Memory stores stable facts (preferences, environment, conventions) via `add`, `replace`, `remove`
- The `user_profile` target captures who you are and how you communicate
- Corrections are training data — every mistake is an opportunity to improve
- The correction → skills pipeline turns one-time fixes into permanent capabilities
- Session search lets you retrieve past context and decisions
- After 50+ sessions, the agent transitions from helpful assistant to autonomous partner
- Regular curation keeps memory clean and relevant
**In the next module,** we'll cover advanced agent patterns — chaining skills, building autonomous workflows, and deploying the agent as a service.
6.14 Exercises
1. **Build your profile:** Use `memory(user_profile, ...)` to create a complete user profile with identity, expertise, and communication preferences.
2. **Memory audit:** Run `/memory list` and identify three memories that are outdated — remove or update them.
3. **Correction practice:** Use the agent for a task you know well. When it gets something wrong, correct it explicitly. Verify the correction stuck by asking about it later.
4. **Skill pipeline:** Pick a workflow you do manually. Walk the agent through it, then save it as a skill. Then run the skill to verify it works.
5. **Session search:** Tag an important session, then search for it by tag. Practice loading session context.
6.15 Further Reading
- [Memory Management Guide](https://hermes-agent.nousresearch.com/docs/memory)
- [User Profiles Documentation](https://hermes-agent.nousresearch.com/docs/user-profiles)
- [Session Management API](https://hermes-agent.nousresearch.com/docs/sessions)
- [Training Best Practices](https://hermes-agent.nousresearch.com/docs/training)