hermes - 💡(How to fix) Fix [Feature]: session_search source filter — support cross-platform session recall [1 comments, 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#14320Fetched 2026-04-23 07:45:37
View on GitHub
Comments
1
Participants
1
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
closed ×1commented ×1

Code Example

{
  "source": {
    "type": "string",
    "description": "Optional: filter by session source platform. E.g. \"cli\", \"feishu\", \"telegram\". Use \"all\" or omit to search across all platforms."
  }
}
RAW_BUFFERClick to expand / collapse

Problem or Use Case

Users who alternate between multiple platforms (e.g. CLI + Feishu + Telegram) cannot effectively recall past conversations via session_search.

The recent mode (no query) returns sessions sorted purely by started_at DESC. When one platform has high session density (e.g. CLI), it dominates the top-N results, completely hiding sessions from other platforms.

Example: a user with 10 CLI sessions and 1 Feishu session on the same day, with limit=3, will only ever see CLI sessions — even though the Feishu conversation may be more relevant.

Proposed Solution

Add an optional source parameter to the session_search tool:

{
  "source": {
    "type": "string",
    "description": "Optional: filter by session source platform. E.g. \"cli\", \"feishu\", \"telegram\". Use \"all\" or omit to search across all platforms."
  }
}

Changes needed:

  1. tools/session_search_tool.py — add source parameter to session_search() and _list_recent_sessions(), pass it through to db.list_sessions_rich(source=...)
  2. SESSION_SEARCH_SCHEMA — add the source property to parameters
  3. run_agent.py — pass source from function_args through to the handler (both call sites ~line 7516 and ~line 8021)
  4. hermes_state.pylist_sessions_rich() already supports source filtering, no changes needed

Alternatives Considered

  • Per-source separate calls: would require multiple session_search calls and manual merging, wasteful
  • Group results by source in the response: useful but still needs a filter param for targeted searches

Feature Type

<!-- feature_type -->

Gateway / messaging improvement

Scope

<!-- scope -->

Small (single file, < 50 lines)

Debug Report

  • Hermes Agent v0.10.0
  • Platforms in use: cli, feishu

extent analysis

TL;DR

To fix the issue of sessions from different platforms not being effectively recalled, add a source parameter to the session_search tool to filter by session source platform.

Guidance

  • Modify the session_search_tool.py file to include the source parameter in the session_search() and _list_recent_sessions() functions.
  • Update the SESSION_SEARCH_SCHEMA to include the source property in the parameters.
  • Pass the source parameter from function_args to the handler in run_agent.py at the specified call sites.
  • Verify that the hermes_state.py file does not require changes, as list_sessions_rich() already supports source filtering.

Example

{
  "source": "feishu"
}

This example shows how to use the source parameter to filter sessions by the Feishu platform.

Notes

The proposed solution involves adding a new parameter to the session_search tool, which may require additional testing to ensure compatibility with existing functionality.

Recommendation

Apply the workaround by adding the source parameter to the session_search tool, as it provides a targeted solution to the issue of sessions from different platforms not being effectively recalled.

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