Skip to content

feat: use SOUL.md as primary agent identity instead of hardcoded default#1922

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-562a3784
Mar 18, 2026
Merged

feat: use SOUL.md as primary agent identity instead of hardcoded default#1922
teknium1 merged 1 commit into
mainfrom
hermes/hermes-562a3784

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Users have been requesting the ability to fully replace the Hermes identity with their own. Currently, DEFAULT_AGENT_IDENTITY is hardcoded as slot #1 in the system prompt, and SOUL.md appears later in the context files section. This means custom SOUL.md content conflicts with the built-in identity rather than replacing it.

This PR makes SOUL.md the primary identity source.

How it works

System prompt slot #1 resolution:

  1. If skip_context_files is NOT set → try loading ~/.hermes/SOUL.md
  2. If SOUL.md loads successfully → use it as identity, skip it in context files section (no duplication)
  3. If SOUL.md is missing, empty, unreadable, or skip_context_files is set → fall back to DEFAULT_AGENT_IDENTITY

No change for existing users: The default SOUL.md (already seeded by ensure_hermes_home() on first run) contains the full Hermes personality. Existing installs already have this file.

Customization is now simple: Edit ~/.hermes/SOUL.md to fully replace the agent identity. No more conflict with hardcoded text.

Changes

  • agent/prompt_builder.py: New load_soul_md() function; build_context_files_prompt() gains skip_soul parameter
  • run_agent.py: _build_system_prompt() tries SOUL.md first, falls back to DEFAULT_AGENT_IDENTITY

Test plan

  • pytest tests/test_run_agent.py tests/agent/test_prompt_builder.py -n0 -q — 278 passed
  • Full suite — 5377 passed (7 pre-existing failures)

SOUL.md now loads in slot #1 of the system prompt, replacing the
hardcoded DEFAULT_AGENT_IDENTITY. This lets users fully customize
the agent's identity and personality by editing ~/.hermes/SOUL.md
without it conflicting with the built-in identity text.

When SOUL.md is loaded as identity, it's excluded from the context
files section to avoid appearing twice. When SOUL.md is missing,
empty, unreadable, or skip_context_files is set, the hardcoded
DEFAULT_AGENT_IDENTITY is used as a fallback.

The default SOUL.md (seeded on first run) already contains the full
Hermes personality, so existing installs are unaffected.
@teknium1 teknium1 merged commit e4a3ffa into main Mar 18, 2026
1 check failed
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
…ult (NousResearch#1922)

SOUL.md now loads in slot NousResearch#1 of the system prompt, replacing the
hardcoded DEFAULT_AGENT_IDENTITY. This lets users fully customize
the agent's identity and personality by editing ~/.hermes/SOUL.md
without it conflicting with the built-in identity text.

When SOUL.md is loaded as identity, it's excluded from the context
files section to avoid appearing twice. When SOUL.md is missing,
empty, unreadable, or skip_context_files is set, the hardcoded
DEFAULT_AGENT_IDENTITY is used as a fallback.

The default SOUL.md (seeded on first run) already contains the full
Hermes personality, so existing installs are unaffected.

Co-authored-by: Test <test@test.com>
rapackitirone-creator pushed a commit to rapackitirone-creator/hermes-agent that referenced this pull request May 6, 2026
…njection

Three major changes from the Hermes multi-profile production deployment:

1. gateway/gateway_multifeishu.py (new file, ~350 lines)
   Implements Scheme C: a single shared webhook port that routes events
   to per-profile FeishuAdapters based on header.app_id.  Activated by
   MULTI_FEISHU_PROFILES=1.  Each profile reads its own config.yaml
   (app_id, app_secret, _profile_soul) so one公网 webhook port
   serves all bots without port conflicts.

2. gateway/platforms/feishu.py + base.py + run.py
   - FeishuAdapter.get_system_prompt(): returns _profile_soul injected
     from config.yaml platforms.feishu.extra._profile_soul — each bot人格
     (Lead, VOC, CX, …) gets its own identity prompt.
   - BasePlatformAdapter.get_system_prompt(): new virtual method, returns
     "" by default.
   - run.py: combined_ephemeral now includes adapter.get_system_prompt()
     and passes it as system_message= to run_conversation().
   - run_agent.py: _build_system_prompt() uses injected system_message as
     primary identity (skipping load_soul_md()), avoiding double injection.
   - Fixed: typing_task exception handler now catches (CancelledError,
     Exception) instead of just CancelledError — prevents AttributeError
     from crashing _keep_typing on missing _typing_paused attribute.

3. hermes_cli/model_normalize.py + model_switch.py
   DeepSeek model normalization updated to support v4 variants
   (deepseek-v4-pro, deepseek-v4-flash).  'deepseek' alias now defaults
   to deepseek-v4-pro instead of deepseek-chat.

Closes NousResearch#1922 (SOUL.md as primary agent identity)
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…ult (NousResearch#1922)

SOUL.md now loads in slot NousResearch#1 of the system prompt, replacing the
hardcoded DEFAULT_AGENT_IDENTITY. This lets users fully customize
the agent's identity and personality by editing ~/.hermes/SOUL.md
without it conflicting with the built-in identity text.

When SOUL.md is loaded as identity, it's excluded from the context
files section to avoid appearing twice. When SOUL.md is missing,
empty, unreadable, or skip_context_files is set, the hardcoded
DEFAULT_AGENT_IDENTITY is used as a fallback.

The default SOUL.md (seeded on first run) already contains the full
Hermes personality, so existing installs are unaffected.

Co-authored-by: Test <test@test.com>
olympus-terminal pushed a commit to olympus-terminal/hermes-agent that referenced this pull request May 16, 2026
…ult (NousResearch#1922)

SOUL.md now loads in slot NousResearch#1 of the system prompt, replacing the
hardcoded DEFAULT_AGENT_IDENTITY. This lets users fully customize
the agent's identity and personality by editing ~/.hermes/SOUL.md
without it conflicting with the built-in identity text.

When SOUL.md is loaded as identity, it's excluded from the context
files section to avoid appearing twice. When SOUL.md is missing,
empty, unreadable, or skip_context_files is set, the hardcoded
DEFAULT_AGENT_IDENTITY is used as a fallback.

The default SOUL.md (seeded on first run) already contains the full
Hermes personality, so existing installs are unaffected.

Co-authored-by: Test <test@test.com>
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…ult (NousResearch#1922)

SOUL.md now loads in slot NousResearch#1 of the system prompt, replacing the
hardcoded DEFAULT_AGENT_IDENTITY. This lets users fully customize
the agent's identity and personality by editing ~/.hermes/SOUL.md
without it conflicting with the built-in identity text.

When SOUL.md is loaded as identity, it's excluded from the context
files section to avoid appearing twice. When SOUL.md is missing,
empty, unreadable, or skip_context_files is set, the hardcoded
DEFAULT_AGENT_IDENTITY is used as a fallback.

The default SOUL.md (seeded on first run) already contains the full
Hermes personality, so existing installs are unaffected.

Co-authored-by: Test <test@test.com>
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
…ult (NousResearch#1922)

SOUL.md now loads in slot NousResearch#1 of the system prompt, replacing the
hardcoded DEFAULT_AGENT_IDENTITY. This lets users fully customize
the agent's identity and personality by editing ~/.hermes/SOUL.md
without it conflicting with the built-in identity text.

When SOUL.md is loaded as identity, it's excluded from the context
files section to avoid appearing twice. When SOUL.md is missing,
empty, unreadable, or skip_context_files is set, the hardcoded
DEFAULT_AGENT_IDENTITY is used as a fallback.

The default SOUL.md (seeded on first run) already contains the full
Hermes personality, so existing installs are unaffected.

Co-authored-by: Test <test@test.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant