hermes - 💡(How to fix) Fix [Bug]: session_search only indexes LLM summaries, not raw session text — cross-session recall unreliable

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…

Root Cause

session_search relies on LLM-generated summaries stored in ~/.hermes/sessions/. The raw JSONL files are never directly indexed for keyword search. Two failure modes:

  1. Active sessions (file 20260512_175407_86b463af.jsonl) are not summarized until session close, so they never appear in search results
  2. Failed summaries show [Raw preview — summarization unavailable] — these sessions are present in the raw files but the LLM summarizer either timed out or the content triggered truncation

The fix would be to maintain an FTS5 index directly on the raw JSONL text, updated at session close (and optionally on a timer for active sessions). This would make session_search independent of LLM summary quality.

Additionally, mnemosyne_recall should be consulted as a fallback — important conversations should be stored in Mnemosyne as durable memories, not just in session transcripts. The agent's system prompt instructs it to save preferences, facts, and environment details to Mnemosyne, but emotional/personal conversations (like discussions about imposter syndrome) are not currently captured by the auto-memory injection pipeline.

RAW_BUFFERClick to expand / collapse

Bug Description

session_search misses conversations that are present in raw session files (JSONL). The tool only searches LLM-generated summaries, not the raw text. This causes two failures:

  1. Active sessions are invisible. The current Telegram session is not indexed until it closes. Any conversation happening right now is not searchable.

  2. Summaries don't capture everything. Many sessions show [Raw preview — summarization unavailable] in search results. When the LLM summarizer times out or skips a session, that session effectively doesn't exist to session_search.

The raw JSONL files contain every message verbatim. A simple grep on disk finds "imposter syndrome" instantly, but session_search(query="imposter syndrome") returns nothing because the summarizer never ran or didn't capture the topic.

Steps to Reproduce

  1. Have a conversation about a specific topic (e.g. "imposter syndrome") in an active Telegram session
  2. Call session_search(query="imposter syndrome") from the same session
  3. Observe: the active session does NOT appear in results
  4. grep -r "impost" ~/.hermes/sessions/ does find it in the raw JSONL

Also reproducible for older sessions where summaries are marked [Raw preview — summarization unavailable]:

  1. session_search(query="syndrome") on sessions from May 8-12
  2. Many matching sessions show as "summary unavailable"
  3. Even when raw text matches, the search returns no results for those sessions

Expected Behavior

session_search should search raw session text, not just LLM-generated summaries. Ideally an FTS5 index on the raw JSONL that runs at session close (or periodically) would make all content searchable regardless of summary state. Active sessions should also be searchable.

Actual Behavior

Only sessions with successful LLM summaries are searchable. Sessions without summaries or with failed summaries are invisible. Active sessions are not indexed.

Affected Component

Tools (terminal, file ops, web, code execution, etc.), Agent Core (conversation loop, context compression, memory)

Messaging Platform

Telegram

Debug Report

N/A (VPS deployment — no hermes debug share on this environment)

Operating System

Ubuntu 26.04 LTS

Python Version

3.11.15 (Hermes venv), 3.14.4 (system)

Hermes Version

Hermes Agent v0.12.0 (2026.4.30)

Root Cause Analysis

session_search relies on LLM-generated summaries stored in ~/.hermes/sessions/. The raw JSONL files are never directly indexed for keyword search. Two failure modes:

  1. Active sessions (file 20260512_175407_86b463af.jsonl) are not summarized until session close, so they never appear in search results
  2. Failed summaries show [Raw preview — summarization unavailable] — these sessions are present in the raw files but the LLM summarizer either timed out or the content triggered truncation

The fix would be to maintain an FTS5 index directly on the raw JSONL text, updated at session close (and optionally on a timer for active sessions). This would make session_search independent of LLM summary quality.

Additionally, mnemosyne_recall should be consulted as a fallback — important conversations should be stored in Mnemosyne as durable memories, not just in session transcripts. The agent's system prompt instructs it to save preferences, facts, and environment details to Mnemosyne, but emotional/personal conversations (like discussions about imposter syndrome) are not currently captured by the auto-memory injection pipeline.

Proposed Fix

Two-part fix:

Short-term — session_search text indexing:

  • Add a FTS5 index on raw JSONL files in ~/.hermes/sessions/
  • Index active session text on a timer (every 60s) so current conversations are searchable
  • Fall back to raw text search when summaries are unavailable

Long-term — Mnemosyne enrichment:

  • Extend the auto-memory system to capture emotionally significant or identity-relevant conversations
  • When a user expresses vulnerability, uncertainty, or personal context about their relationship to their work, flag it for Mnemosyne storage
  • This ensures the "brain" (Mnemosyne) has memories even when the "transcript" (session search) doesn't

Are you willing to submit a PR for this?

No — reporting for investigation

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

hermes - 💡(How to fix) Fix [Bug]: session_search only indexes LLM summaries, not raw session text — cross-session recall unreliable