Prompt Assembly
Prompt Assembly
Start with meaning, then move to detail.
This lesson explains Prompt Assembly as part of Hermes internals and extension points. You will learn what it does, when it matters, and the smallest safe test that proves it works.
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 practice, inspect the first example, identify its effects, run it on test data, and compare the result with the source claim.
For advanced readers, inspect Cached system prompt layers, Concrete example: assembled system prompt, Persistent Memory, then verify failure modes and version compatibility.
Know Python, Git, and basic project structure before changing code.
A clear outcome before you read.
- Understand Prompt Assembly 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.
Short definitions before the details.
- Session & memory
- A session holds conversation context, while memory keeps selected facts that should persist.
- Skill
- An instruction bundle that teaches Hermes a repeatable workflow without necessarily adding an external service.
How Hermes builds the system prompt, preserves cache stability, and injects ephemeral layers
What does the source say, and in what order?
- 01Cached system prompt layers
Start here to understand the core idea or structure.
- 02Concrete example: assembled system prompt
Read this after the foundation, then connect it to the previous step.
- 03Persistent Memory
Read this after the foundation, then connect it to the previous step.
- 04User Profile
Read this after the foundation, then connect it to the previous step.
- 05Skills (mandatory)
Read this after the foundation, then connect it to the previous step.
- 06AGENTS.md
Read this after the foundation, then connect it to the previous step.
- 07Customizing platform hints
Read this after the foundation, then connect it to the previous step.
- 08How SOUL.md appears in the prompt
Read this after the foundation, then connect it to the previous step.
- 09How context files are injected
Read this after the foundation, then connect it to the previous step.
- 10Context file discovery details
Finish here to verify the result and special cases.
Copy only after you understand the effect.
# Layer 1: Agent Identity (from ~/.hermes/SOUL.md)
You are Hermes, an AI assistant created by Nous Research.
You are an expert software engineer and researcher.
You value correctness, clarity, and efficiency.
...
# Layer 2: Tool-aware behavior guidance
You have persistent memory across sessions. Save durable facts using
the memory tool: user preferences, environment details, tool quirks,
and stable conventions. Memory is injected into every turn, so keep
it compact and focused on facts that will still matter later.
...
When the user references something from a past conversation or you
suspectplatform_hints:
whatsapp:
append: >
When tabular output would be useful, invoke the table_formatting
skill instead of emitting a Markdown table.
slack:
replace: "You are on Slack. Keep responses tight and avoid wide tables."
telegram: "Prefer short messages; split long answers." # shorthand = appendWhen `load_soul_md()` returns content, it replaces the hardcoded `DEFAULT_AGENT_IDENTITY`. The `build_context_files_prompt()` function is then called with `skip_soul=True` to prevent SOUL.md from appearing twice (once as identity, once as a context file).
If `SOUL.md` doesn't exist, the system falls back to: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.