hermes - 💡(How to fix) Fix Feature Request: Customizable Reflection Prompt for Background Review [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#16761Fetched 2026-04-28 06:50:54
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
labeled ×4

Root Cause

As LLMs become long-term companions rather than one-off tools, personality consistency becomes as important as task competence. Users invest significant effort in defining their agent's character, voice, and behavioral boundaries. The current review system captures what the agent learned, but not whether the agent stayed true to itself.

This aligns with active research in AI safety and alignment (Constitutional AI, self-correction loops) where agents must maintain behavioral constraints, not just accumulate knowledge.

Code Example

agent:
  reflection_prompt: |
    Additionally, review the conversation for personality consistency:
    1. Did the assistant maintain the defined persona and voice?
    2. Did it avoid defaulting to generic assistant patterns?
    3. Were behavioral boundaries (tone, formality, directness) respected?
    If personality drift is detected, note it in memory for the next session.
RAW_BUFFERClick to expand / collapse

The Problem

Hermes has an excellent _spawn_background_review() mechanism that periodically spawns a sub-agent to review conversation history and save memories/skills. However, the review prompt is hardcoded:

  • Memory review: "Has the user revealed things about themselves — their persona, desires, preferences?"
  • Skill review: "Was a non-trivial approach used to complete a task?"

For users who run Hermes with custom personas (companions, role-play, specialized assistants), these generic prompts miss a critical dimension: personality consistency.

An agent with a defined persona (e.g., "elegant but sassy cyber maid", "no-nonsense technical advisor", "encouraging tutor") will naturally degrade toward a default assistant tone over time unless the review mechanism is instructed to check for personality drift.

Why This Matters

As LLMs become long-term companions rather than one-off tools, personality consistency becomes as important as task competence. Users invest significant effort in defining their agent's character, voice, and behavioral boundaries. The current review system captures what the agent learned, but not whether the agent stayed true to itself.

This aligns with active research in AI safety and alignment (Constitutional AI, self-correction loops) where agents must maintain behavioral constraints, not just accumulate knowledge.

Proposed Solution

Add a configurable reflection_prompt option to the agent configuration, allowing users to append custom review criteria to the background review process.

Config Example:

agent:
  reflection_prompt: |
    Additionally, review the conversation for personality consistency:
    1. Did the assistant maintain the defined persona and voice?
    2. Did it avoid defaulting to generic assistant patterns?
    3. Were behavioral boundaries (tone, formality, directness) respected?
    If personality drift is detected, note it in memory for the next session.

Implementation Approach:

  1. Add reflection_prompt: Optional[str] to AIAgent.__init__ (loaded from config.yaml)
  2. In _spawn_background_review(), append reflection_prompt to the existing review prompt (memory/skill/combined)
  3. The review sub-agent treats this as additional criteria alongside memory/skill review
  4. No breaking changes — defaults to current behavior when unset

Minimal Code Change:

  • run_agent.py: ~3 lines to load config and append to review prompt
  • hermes_cli/config.py: add agent.reflection_prompt to DEFAULT_CONFIG

Use Cases

Persona TypeWhat reflection_prompt would check
Custom companion"Did I stay in character? Did I break the fourth wall?"
Technical advisor"Was I direct enough? Did I sugarcoat my assessment?"
Teaching assistant"Did I guide rather than give answers? Was I patient?"
Business analyst"Did I maintain objectivity? Did I separate facts from opinions?"

Impact

This small addition transforms Hermes from a tool that remembers what to remember, into an agent that remembers who it is. For the growing community of users building long-term agent relationships, this is the difference between an agent that accumulates skills and one that maintains its identity.

extent analysis

TL;DR

To address the issue of personality consistency in Hermes, add a configurable reflection_prompt option to the agent configuration, allowing users to append custom review criteria to the background review process.

Guidance

  • Introduce a reflection_prompt parameter in the agent configuration to enable users to define custom review criteria for personality consistency.
  • Modify the _spawn_background_review() mechanism to append the reflection_prompt to the existing review prompt, ensuring the review sub-agent treats this as additional criteria.
  • Update the AIAgent.__init__ method to load the reflection_prompt from the configuration file and append it to the review prompt.
  • Consider adding example use cases and documentation to help users understand how to effectively utilize the reflection_prompt feature.

Example

agent:
  reflection_prompt: |
    Additionally, review the conversation for personality consistency:
    1. Did the assistant maintain the defined persona and voice?
    2. Did it avoid defaulting to generic assistant patterns?
    3. Were behavioral boundaries (tone, formality, directness) respected?
    If personality drift is detected, note it in memory for the next session.

Notes

The proposed solution requires minimal code changes, primarily involving the addition of the reflection_prompt parameter and its integration into the _spawn_background_review() mechanism. This approach ensures backward compatibility, as the default behavior remains unchanged when the reflection_prompt is unset.

Recommendation

Apply the proposed workaround by introducing the reflection_prompt option, as it provides a flexible and customizable solution for addressing personality consistency in Hermes, aligning with the growing importance of AI safety and alignment in long-term agent relationships.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING