Skip to content

[BUG] session_search returns zero/partial results despite session files containing matching content #15500

@hokingyang

Description

@hokingyang

Bug Description

Session files are being saved correctly to ~/.Hermes/sessions/, but session_search fails to find content that clearly exists within those session files.

Reproduction

  1. Conduct a multi-session conversation involving a specific topic (e.g., "大别山项目")
  2. Verify session files exist: ls ~/.Hermes/sessions/session_20260424_*.json | wc -l
  3. Run session_search(query="topic_keyword")
  4. Compare results with direct grep: grep -r "keyword" ~/.Hermes/sessions/session_20260424_*.json | wc -l

Actual Results

Method Match Count
grep on session files 148 matches
session_search 1 match

Session files are ~500KB each and clearly contain the keyword "大别山", yet session_search returns almost nothing.

Environment

  • Hermes version: 1.0.0 (from hermes-agent package.json)
  • OS: macOS
  • Session file count: 153 files for 2026-04-24 alone
  • Total session storage: significant (multiple GB)

Root Cause Hypothesis

  1. Indexing issue: The session search index may not be built or updated properly
  2. Context Compaction side effect: When context is compacted, the full content may be replaced by a summary that loses searchable detail
  3. FTS5 configuration: Session search likely uses SQLite FTS5 — the index may be stale or not rebuilt after session updates

Expected Behavior

session_search should return all sessions containing the query keyword, matching what grep finds.

Impact

  • Historical conversations are effectively unsearchable
  • This breaks the core value proposition of persistent memory across sessions
  • Users cannot retrieve past work, research, or decisions

Workaround

Manual grep works but is not user-friendly:

grep -r "keyword" ~/.Hermes/sessions/session_*.json | head -20

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/agentCore agent loop, run_agent.py, prompt buildertype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions