Quick Start
How It Works
Sessions live at~/.praisonai/sessions/*.json — one JSON file per session. The default search is a dependency-free substring/keyword scan with no extra setup required.
Picking the right shape:
Configuration Options
session_search Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
query | str | "" | Free-text query for discovery mode |
session_id | str | "" | Session to read in scroll mode |
around_message_id | str | "" | Anchor message index (as string) for scroll mode |
limit | int | 5 | Maximum sessions/results to return |
window | int | 5 | Messages to include around a hit/anchor |
Return Shapes
- Discovery
- Scroll
- Browse
Returned when
query is set:Scoring
Discovery mode scores hits using keyword matching:| Match type | Score added |
|---|---|
| Exact substring match | +2 per message |
| Per-term keyword match | +1 per term per message |
updated_at descending). Scores are heuristic — treat them as relative rankings, not probabilities.
Snippets are centred on the first match and trimmed to ~120 characters with … ellipses.
Common Patterns
Gateway assistant recalling a past decision
”What was I working on?” at the start of a new session
Programmatic access via the store directly
Best Practices
Keep window small for fast scans
Keep window small for fast scans
Use
window=3 to window=5 for discovery. Widen only when you need more surrounding context after finding a hit — use scroll mode for that.Treat scores as relative rankings
Treat scores as relative rankings
Scores are heuristic keyword counts, not probability-calibrated relevance scores. A score of 4.0 beats 2.0 but says nothing absolute. Always let the agent reason about the returned snippets.
Scope sessions per user in multi-user deployments
Scope sessions per user in multi-user deployments
The default search is per-store, not per-user. In multi-user deployments, prefix
session_id values with a user identifier (e.g. user_42_session_xyz) and search within those sessions explicitly.Scale-out: swap in an FTS-backed store
Scale-out: swap in an FTS-backed store
The default dependency-free substring scan works well for personal agents with hundreds of sessions. For large deployments, a wrapper FTS5/SQLite-backed store implementing
SearchableSessionStoreProtocol is the planned upgrade path — swap it in without changing agent code.Advanced: SearchableSessionStoreProtocol
The default store implements SearchableSessionStoreProtocol, a separate runtime_checkable protocol that adds search to any session store backend.
Protocol Methods
| Method | Signature | Description |
|---|---|---|
search | search(query, *, limit=5, window=5) -> List[SessionHit] | Keyword scan across all stored sessions |
window | window(session_id, around_message_id=None, *, window=5) -> List[Dict] | ±N messages around an anchor; uses most recent if anchor omitted |
recent | recent(*, limit=10) -> List[SessionSummary] | Most recently updated sessions |
SessionHit Fields
| Field | Type | Default | Description |
|---|---|---|---|
session_id | str | required | The session that matched |
title | str | "" | Agent name or first user message snippet |
when | Optional[str] | None | updated_at or created_at timestamp |
snippet | str | "" | Short snippet centred on the first match |
score | float | 0.0 | Match score (higher = better) |
anchor_index | int | -1 | Index of the best-matching message |
messages | List[Dict] | [] | Context window around the hit |
SessionSummary Fields
| Field | Type | Default | Description |
|---|---|---|---|
session_id | str | required | Session identifier |
title | str | "" | Agent name or session id |
when | Optional[str] | None | Last update timestamp |
message_count | int | 0 | Number of messages in the session |
SessionStoreProtocol (the core persistence contract) is unchanged and backward compatible. SearchableSessionStoreProtocol is an additive, separately runtime-checkable protocol.Related
Bot Default Tools
Where session_search fits in the opt-in tool list for bots
Session Store
How sessions are persisted in ~/.praisonai/sessions/
Memory
Distilled long-term memory (different from raw session transcripts)
Knowledge
RAG over documents (also different from session recall)

