Skip to content

feat(session_search): add recent sessions mode when query is omitted#2533

Merged
teknium1 merged 2 commits intomainfrom
hermes/hermes-baa39faf
Mar 25, 2026
Merged

feat(session_search): add recent sessions mode when query is omitted#2533
teknium1 merged 2 commits intomainfrom
hermes/hermes-baa39faf

Conversation

@teknium1
Copy link
Copy Markdown
Contributor

Summary

When session_search is called without a query, it now returns metadata for recent sessions instead of erroring. The agent can quickly see what was worked on recently without needing specific keywords.

How it works

  • With query: Same FTS5 keyword search as before (unchanged)
  • Without query: Returns metadata for the last N sessions — title, preview, timestamps, message count

Zero LLM cost for the recent mode — pure SQLite query via existing list_sessions_rich. Current session lineage and child delegation sessions are excluded.

Example output

{
  "mode": "recent",
  "results": [
    {"session_id": "20260321_...", "title": "PR review session", "preview": "Lets do 2264", "message_count": 47, ...},
    {"session_id": "20260320_...", "title": null, "preview": "Can you check the ATM10 server?", "message_count": 12, ...}
  ]
}

The agent can then keyword-search specific sessions if it needs deeper context.

Test plan

  • All 23 session search tests pass
  • query parameter no longer required in schema
When session_search is called without a query (or with an empty query),
it now returns metadata for the most recent sessions instead of erroring.
This lets the agent quickly see what was worked on recently without
needing specific keywords.

Returns for each session: session_id, title, source, started_at,
last_active, message_count, preview (first user message).
Zero LLM cost — pure DB query. Current session lineage and child
delegation sessions are excluded.

The agent can then keyword-search specific sessions if it needs
deeper context from any of them.
@teknium1 teknium1 merged commit b36fe92 into main Mar 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant