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.Each message carries an archived boolean β true marks a turn recalled from archived_messages (compacted out of the active window by the default retention="compact" policy). See Recall Across Compacted History.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. One bad transcript on disk (unreadable, malformed JSON, or invalid UTF-8) is also skipped β so you donβt need to clean up
~/.praisonai/sessions/ before running the command. See Cross-Session Recall β Resilience to Corrupt Transcripts.Compacted history stays searchable
The CLI walks the same archived + active projection as thesession_search agent tool. A detail rolled into archived_messages under retention="compact" is still recallable via praisonai session search β hits on archived turns come back with archived: true in each message entry (JSON mode) so the compaction boundary stays visible.
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

