# Hermes Agent sessions: search and resume past work

> How Hermes stores every conversation, how to name, resume, export and prune sessions, and how the agent searches its own history.

Canonical: https://hermeswatcher.com/learn/sessions-and-session-search  
Section: Learn · Memory & context  
Last reviewed: Oct 20, 2026  
Basis: Explained from the official Hermes Agent docs and repository (Nous Research). Steps follow the linked official sources.

## Every conversation is a session

Whether you chat in the terminal, through Telegram, from a cron job or via the API server, Hermes records the conversation as a session in a SQLite database at ~/.hermes/state.db. Each session keeps its ID, the platform it came from, the model used, a snapshot of the system prompt, the full message history, token counts, timestamps and a parent session ID. That last field matters later, because it is how Hermes links a conversation to its continuation after compression.

The source tag tells you where a session came from: cli, telegram, discord, slack, cron, api-server and many more. A few internal kinds (oneshot, kanban and tool) are hidden from the TUI, desktop and dashboard pickers so they don't clutter your list.

## Naming and resuming

Sessions are easier to find again if you name them. Use /title inside a chat, or hermes sessions rename <id> <title> from the shell. When you exit, Hermes prints a resume command containing the session ID.

- hermes -c (or hermes --continue): pick up your most recent CLI session with its full history.
- hermes --resume <id|title|latest> (short form -r): resume a specific session by ID or title.
- --in <dir>: limit the 'latest session' lookup to one workspace directory.
- /resume and /sessions inside a chat let you switch without leaving.
- /new or /reset: start fresh. The docs recommend doing this at natural task or topic boundaries.

## Housekeeping from the command line

The hermes sessions command covers the routine maintenance most people eventually need:

- hermes sessions list, with --source <platform>, --limit N or --workspace <needle> to narrow it.
- hermes sessions export <file> writes jsonl by default; --format also accepts md, html and others, and --redact strips sensitive content.
- hermes sessions delete <id> removes one session.
- hermes sessions prune removes ended sessions older than 90 days by default; add --dry-run first to see what would go.
- hermes sessions archive hides matching sessions without deleting them, and hermes sessions pin keeps important ones safe from auto-archiving.
- hermes sessions stats and hermes sessions optimize report on and tidy the database.

## How the agent searches its own history

The session_search tool lets Hermes look things up across all stored conversations. It returns the raw stored messages rather than an LLM-written summary, and once it finds a relevant session it can scroll forwards and backwards around a specific message. Queries use standard SQLite full-text syntax: keywords are combined with AND by default, and quoted phrases, OR, NOT and prefix wildcards (deploy*) all work.

Because search runs only on demand and uses no extra model calls, it complements memory nicely. Memory is always in context but tiny; session search is unlimited but has to be asked for. A useful habit is to prompt explicitly: "search our past sessions for the decision about the staging database."

## Compression creates linked sessions

When a conversation gets long, Hermes compresses it (automatically, or when you run /compress). Compression starts a continuation session that points back to the original through its parent ID. Titled sessions get numbered continuations such as #2 and #3, and resuming by name picks the newest one in that chain. Pruning keeps older segments as long as a later segment survives, so you don't lose the beginning of a long-running thread.

## Messaging sessions don't time out

On Telegram, Discord and other gateway platforms, conversations no longer reset after inactivity or at a daily boundary. They continue until someone sends /new or /reset, with compression handling length. If you relied on older session_reset settings, note that they are now ignored; the docs point to an optional hermes-session-reset-policy plugin if you want timed resets back. In group chats, each user gets their own session by default (group_sessions_per_user: true).

## Related guides

- [How Hermes Agent memory works (and where it stops)](https://hermeswatcher.com/learn/how-hermes-memory-works.md)
- [Hermes Agent forgets things mid-conversation](https://hermeswatcher.com/troubleshoot/forgets-mid-conversation.md)
- [Hermes Agent memory not carrying over between sessions](https://hermeswatcher.com/troubleshoot/memory-did-not-persist.md)

## Related tools

- [Carry project knowledge into the next session](https://hermeswatcher.com/workflows/project-knowledge.md)
- [Persistent memory: retain compact working knowledge](https://hermeswatcher.com/tools/memory.md)
- [CLI: run bounded tasks and inspect the working environment](https://hermeswatcher.com/tools/cli.md)

## Sources

- [Sessions (official docs)](https://hermes-agent.nousresearch.com/docs/user-guide/sessions)
- [CLI Interface (official docs)](https://hermes-agent.nousresearch.com/docs/user-guide/cli)
- [Persistent Memory (official docs)](https://hermes-agent.nousresearch.com/docs/user-guide/features/memory)
- [Tips and Best Practices (official guide)](https://hermes-agent.nousresearch.com/docs/guides/tips)

---

HermesWatcher is an independent guide. It is not affiliated with or endorsed by Nous Research. The [official Hermes Agent documentation](https://hermes-agent.nousresearch.com/docs) and [repository](https://github.com/NousResearch/hermes-agent) from Nous Research are the authority; each page here lists the official sources it was written from. If this site and the official docs disagree, trust the official docs. Index for agents: https://hermeswatcher.com/llms.txt
