hermes - ✅(Solved) Fix [Bug]: Session search cannot answer time-bounded conversation recap queries (date/time-based recall unsupported) [1 pull requests]

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

Fixed

PR fix notes

PR #13058: fix(tools): add session_recap for time-window conversation summaries

Description (problem / solution / changelog)

What does this PR do?

This PR fixes a gap in conversation recall for time-based questions by introducing a dedicated session recap path that is driven by explicit time windows, not keyword ranking.

Problem solved:

  • Session search is optimized for keyword lookup and is not reliable for date/time recap intents such as yesterday afternoon, between 2pm and 4pm, or recap this morning.
  • This caused incomplete or noisy recall for temporal recap prompts.

Why this approach:

  • A dedicated session_recap flow allows strict time-window filtering first, then recap summarization over only in-window messages.
  • Lineage-aware grouping improves accuracy when conversations span parent/child session chains.

Related Issue

Fixes https://github.com/NousResearch/hermes-agent/issues/13056

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • Added session_recap tool to support date/time-based recap queries.
  • Implemented explicit time-window retrieval using window_start and window_end instead of keyword-only ranking behavior.
  • Added lineage-aware aggregation so recap output reflects relevant session chains accurately.
  • Updated tests for time-window recap behavior, including timestamp parsing and default window handling.
  • Updated tool schema and guidance text to reflect timestamp-first recap usage.

How to Test

  1. Run targeted tests:
    • run_tests.sh test_session_recap.py -q
  2. Reproduce prior issue behavior with a temporal prompt, for example:
    • Recap what we discussed yesterday between 2pm and 4pm.
  3. Verify the recap path uses time-window semantics and returns interval-bounded summary output (no keyword-only drift).

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS (please fill version)

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Screenshots / Logs

Targeted test run:

  • run_tests.sh test_session_recap.py -q
  • Result: 14 passed

Changed files

  • agent/prompt_builder.py (modified, +4/-2)
  • hermes_cli/tools_config.py (modified, +2/-1)
  • hermes_state.py (modified, +108/-0)
  • run_agent.py (modified, +31/-1)
  • tests/agent/test_prompt_builder.py (modified, +4/-1)
  • tests/hermes_cli/test_tools_config.py (modified, +3/-0)
  • tests/run_agent/test_run_agent.py (modified, +157/-0)
  • tests/test_hermes_state.py (modified, +68/-0)
  • tests/tools/test_session_recap.py (added, +203/-0)
  • tools/session_recap_tool.py (added, +601/-0)
  • toolsets.py (modified, +7/-1)
  • website/docs/developer-guide/agent-loop.md (modified, +1/-0)
  • website/docs/developer-guide/prompt-assembly.md (modified, +2/-1)
  • website/docs/developer-guide/tools-runtime.md (modified, +3/-2)
  • website/docs/reference/tools-reference.md (modified, +6/-0)
  • website/docs/reference/toolsets-reference.md (modified, +2/-1)
  • website/docs/user-guide/configuration.md (modified, +1/-1)
  • website/docs/user-guide/features/fallback-providers.md (modified, +2/-2)
  • website/docs/user-guide/features/tools.md (modified, +2/-2)
  • website/docs/user-guide/sessions.md (modified, +23/-5)

Code Example

Report  https://paste.rs/GpG8x

---
RAW_BUFFERClick to expand / collapse

Bug Description

Users ask questions like:

  • What did we decide yesterday afternoon?
  • Recap the conversation between 2pm and 4pm on April 18.
  • What blockers did we discuss this morning?

These are recap and time-window retrieval intents, but the existing session search flow is keyword/FTS oriented. It does not reliably support temporal window queries or recap-style synthesis across all messages in a bounded interval.

As a result, time-based memory questions return incomplete, noisy, or irrelevant results, especially when the query intent is temporal rather than keyword-specific.

Steps to Reproduce

  1. Prompt used
    “Can you recap what we discussed yesterday between 2pm and 4pm?”

  2. What happens
    The agent routes to session search style retrieval (keyword-based) instead of strict time-window recap behavior.

  3. Tool calls observed
    A session search style call is made (search/ranking behavior), not a dedicated time-bounded recap call with explicit window_start and window_end.

  4. Result observed
    Output is incomplete or mixed with messages outside the requested time range, and does not reliably provide a clean recap for that exact interval.

Expected Behavior

The agent should support conversation retrieval by explicit time window and produce recap-quality output:

  • Accept start and end timestamps (ISO-8601 or epoch).
  • Retrieve messages that actually fall inside that time window.
  • Aggregate across session lineage when relevant.
  • Return a concise recap of goals, actions, outcomes, blockers, and unresolved items for that interval.

Actual Behavior

With session search alone:

  • Time expressions in user prompts are treated like text, not strong temporal constraints.
  • Retrieval is driven by keyword relevance, not strict timestamp boundaries.
  • Recap-style questions can miss key messages, pull unrelated snippets, or fail to produce a coherent interval summary.
  • Date/time-only queries perform poorly when they contain few discriminative keywords.

Affected Component

Tools (terminal, file ops, web, code execution, etc.)

Messaging Platform (if gateway-related)

No response

Debug Report

Report  https://paste.rs/GpG8x

Operating System

MacOS 26.4

Python Version

No response

Hermes Version

No response

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

Primary root causes:

  • Tool mismatch: session search is optimized for keyword lookup, not interval recap.
  • Missing temporal-first retrieval path: no dedicated API contract for start/end window as first-class filters in recap workflows.
  • Recap synthesis gap: search returns ranked results/snippets, while recap needs window-complete message collection plus summarization.
  • Query-intent mismatch: natural-language date/time intent is not consistently converted into deterministic time bounds before retrieval.

Proposed Fix (optional)

Introduce and route to a dedicated time-window recap capability (session recap flow) for temporal recall intents:

  • Add a session recap tool that accepts explicit window_start and window_end timestamps.
  • Use timestamp-bounded retrieval from session storage, including relevant child/root lineage handling.
  • Summarize only messages within the resolved window.
  • Keep session search for keyword discovery; use session recap for time-based recall and recap intents.
  • Update prompting/routing guidance so temporal questions prefer recap flow and pass resolved timestamps.
  • Add tests covering:
    • explicit timestamp windows,
    • date-only end-of-day behavior,
    • default fallback window behavior when timestamps are omitted,
    • recap quality for temporal queries.

Are you willing to submit a PR for this?

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

extent analysis

TL;DR

Introduce a dedicated time-window recap capability to handle temporal recall intents, routing temporal questions to this new flow with explicit start and end timestamps.

Guidance

  • Identify and separate the intent behind user queries to determine whether a keyword search or a time-window recap is needed.
  • Develop a new session recap tool that accepts window_start and window_end timestamps for timestamp-bounded retrieval from session storage.
  • Implement logic to summarize messages within the resolved time window, ensuring the inclusion of relevant child/root lineage handling.
  • Update the prompting and routing logic to prefer the recap flow for temporal questions and pass resolved timestamps to the new recap tool.
  • Consider adding tests for various scenarios, including explicit timestamp windows, date-only queries, and default fallback window behavior.

Example

def route_query(query):
    if is_temporal_query(query):
        # Extract timestamps from query
        window_start, window_end = extract_timestamps(query)
        # Route to session recap tool with timestamps
        return session_recap(window_start, window_end)
    else:
        # Route to session search for keyword discovery
        return session_search(query)

def session_recap(window_start, window_end):
    # Retrieve messages within the time window
    messages = retrieve_messages(window_start, window_end)
    # Summarize the messages
    summary = summarize_messages(messages)
    return summary

Notes

The proposed fix involves significant changes to the existing system, including the introduction of a new session recap tool and updates to the prompting and routing logic. Care should be taken to ensure that the new recap flow is properly integrated with the existing system and that the changes do not introduce any regressions.

Recommendation

Apply the workaround by introducing a dedicated time-window recap capability, as this addresses the root cause of the issue and provides a more reliable solution for handling temporal recall intents. This approach allows for more accurate retrieval and summarization of messages within a specified time window, improving the overall user experience.

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 - ✅(Solved) Fix [Bug]: Session search cannot answer time-bounded conversation recap queries (date/time-based recall unsupported) [1 pull requests]