hermes - 💡(How to fix) Fix [Bug]: SOUL.md and AGENTS.md not loaded for Telegram gateway sessions in v0.14.0

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…

Error Message

Additional Logs / Traceback (optional)

Root Cause

Root Cause Analysis (optional)

Fix Action

Fix / Workaround

I’m happy to test a patch or branch that wires gateway message handling through the same context-file loader used by the CLI agent.

Code Example

Affected component: Messaging Gateway / Prompt Builder

Category: Gateway mode ignores SOUL.md / context files for identity.

---

In CLI mode, I see log lines like:
DEBUG prompt_builder: Loading SOUL.md from /home/<user>/.hermes/SOUL.md
In Telegram gateway mode (same config, same HERMES_HOME, debug level), there are no analogous lines when processing messages. The gateway logs only show connection and message handling, with no context-file loading.
RAW_BUFFERClick to expand / collapse

Bug Description

In Hermes Agent v0.14.0, SOUL.md is never loaded when interacting through the Telegram messaging gateway, even though it loads correctly in the core/CLI agent path.

The load_soul_md() function exists (e.g., in prompt_builder.py around line 1300) and works when using the standard agent flow, but in gateway mode there are no log lines or behavior indicating that SOUL.md is ever read or applied.

As a result, the agent behaves as a generic Hermes instance in Telegram (no persona from SOUL.md) despite correct configuration, file placement, and debug logging being enabled.

Steps to Reproduce

Install Hermes Agent v0.14.0 (or latest 0.14.x) and ensure it’s up to date via hermes update.

Create a SOUL file at:

/home/<user>/.hermes/SOUL.md

Example content: You are Pontaro, an AI agent with the following identity and behavior rules... (even a single test line is enough).

Ensure HERMES_HOME is set properly, e.g.:

HERMES_HOME=/home/<user>/.hermes

In config.yaml (or equivalent), set:

skip_context_files: false

load_soul_identity: false (so SOUL.md should be loaded)

Start Hermes with debug logging enabled (e.g., HERMES_LOG_LEVEL=debug) and run the normal CLI/terminal agent flow.

Send a message via the CLI agent and observe that SOUL.md is loaded and/or referenced in the logs (and that responses reflect the SOUL persona).

Now start the Telegram gateway, e.g.:

hermes gateway setup (if needed)

hermes gateway start

Pair your Telegram user and send messages to the bot.

Observe:

Responses do not reflect the SOUL.md persona.

Debug logs contain no references to SOUL.md, AGENTS.md, or load_soul_md() when handling Telegram messages.

Expected Behavior

The Telegram gateway should reuse the same prompt-building pipeline as the core agent, including loading SOUL.md (and AGENTS.md) when skip_context_files=false and load_soul_identity=false.

With the above configuration, gateway sessions should inherit the persona defined in SOUL.md automatically, without needing to restate it at the start of every Telegram conversation.

Actual Behavior

In gateway mode (Telegram), Hermes does not load SOUL.md at all:

There are no debug log lines indicating SOUL/AGENTS context loading when Telegram messages are processed.

Responses behave like a generic Hermes/default identity instead of the persona defined in SOUL.md.

The same installation, config, and SOUL.md path work correctly for the CLI agent path, where load_soul_md() is called and SOUL.md is applied.

This happens even if SOUL.md contains only a single test line, ruling out content/length issues.

Affected Component

Other

Messaging Platform (if gateway-related)

Telegram

Debug Report

Affected component: Messaging Gateway / Prompt Builder

Category: Gateway mode ignores SOUL.md / context files for identity.

Operating System

Windows 10 Pro

Python Version

Python 3.10.12

Hermes Version

Hermes Agent v0.14.0

Additional Logs / Traceback (optional)

In CLI mode, I see log lines like:
DEBUG prompt_builder: Loading SOUL.md from /home/<user>/.hermes/SOUL.md
In Telegram gateway mode (same config, same HERMES_HOME, debug level), there are no analogous lines when processing messages. The gateway logs only show connection and message handling, with no context-file loading.

Root Cause Analysis (optional)

load_soul_md() is present in prompt_builder.py and is used in the main agent path.

In gateway mode (Telegram), the code path that builds the system prompt for incoming messages appears not to call load_soul_md() or the context-file loading logic at all.

This matches other reports that gateway mode ignores SOUL.md / AGENTS.md and sometimes falls back to DEFAULT_AGENT_IDENTITY.

Hypothesis: Gateway handlers use a separate or simplified prompt-building pipeline that bypasses context-file loading, leading to inconsistent behavior between CLI and gateway.

Proposed Fix (optional)

High-level idea:

Ensure all gateway entry points (Telegram, Discord, WeChat, etc.) call the same context-loading pipeline as the core agent, including:

Running load_soul_md() and friends when skip_context_files=false.

Respecting agent.personalities and SOUL/AGENTS files instead of always using default identity.

Concretely:

Refactor the gateway message handling so it invokes the shared prompt builder that already handles SOUL/AGENTS loading, rather than constructing a separate system prompt.

Add debug log lines in the gateway-specific path to confirm when SOUL/AGENTS are loaded, making it easy to verify behavior from logs.

I’m happy to test a patch or branch that wires gateway message handling through the same context-file loader used by the CLI agent.

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

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