Quick Start
An agent recalls past sessions through thesession_search tool — the CLI reaches the same engine from your terminal.
1
Search your sessions
2
Widen the search
Return more sessions and more context around each hit:
3
Get machine-readable output
Add the global Each result is
--json flag for a structured result:SessionHit.as_dict() — the same shape as the Cross-Session Recall Discovery return.How It Works
session search delegates to SqliteSessionStore — the same FTS5/bm25 engine as the session_search agent tool — instead of a substring scan.
The command iterates the CLI’s canonical stores via canonical_cli_stores() — the same helper session resume / show / delete / export use — so id resolution stays consistent across every sub-command. See Session Resume.
Cross-store dedup
A session resumed from the global default store keeps a project-side shadow, so the same id can match in both canonical stores. Without dedup those duplicate rows each consume a slot of--limit and crowd out distinct sessions. The command collapses by session_id, keeping the higher-scoring copy — mirroring the lineage dedup the store already applies inside a single directory.
Search never breaks: if a store can’t be indexed, that store is skipped and the remaining hits are still returned.
Flags
Text mode prints a table with columns
ID | Title | Score | Snippet | When. JSON mode prints {"query": "...", "results": [...]} where each result is SessionHit.as_dict().
Common Patterns
From an agent tool to the terminal
Thesession_search agent tool and praisonai session search share the same store — pick whichever fits your workflow.
Pipe JSON into a script
Resume the top hit
Best Practices
Keep --window small for a quick scan
Keep --window small for a quick scan
Start with the default
--window 5. Widen only when you need more surrounding context after finding the right session — then session resume it.Treat scores as relative rankings
Treat scores as relative rankings
Scores are FTS5/bm25 ranks, not probabilities. A
5.0 beats a 2.0, but says nothing absolute — read the snippets to confirm the match.Raise --limit when duplicates are expected
Raise --limit when duplicates are expected
Cross-store dedup collapses same-id shadows, but distinct sessions on the same topic still compete for slots. Raise
--limit when a topic spans many sessions.Use --json to automate
Use --json to automate
The
--json output is SessionHit.as_dict() per result — pipe it into jq to feed ids straight into session resume, show, or export.Related
Session (CLI)
List, resume, show, delete, export, and share sessions
Session Resume
Continue a session with full state restored
Cross-Session Recall
The same engine as an agent tool (
session_search)Session Store
SqliteSessionStore — FTS5 + bm25 recall index

