Search this session's stored context
smart_compact_searchSearch every stored message in a session, including trimmed context, by full-text query or regex. Returns matching rows with excerpts and exact match counts for recall and counting questions.
Instructions
Search every stored message of this session, including messages trimmed from your context, and return matching rows with an excerpt. Use it when an [openmem: continuing session …] pointer says earlier messages were trimmed; pass that session_id (without one it searches recent sessions in this git root). Pass exactly one of query (full-text words) or pattern (regex). Roles default to user and tool. total_matches counts rows; line_matches is an exact count of matching lines across the whole session; use it for 'how many' questions, or smart_compact_sql for grouped counts. Rows citing a compressed result return blob_ids for smart_compact_get.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "smart_compact_search"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | hybrid merges full-text and embedding rankings (default when the session has vectors); lexical is full-text only | |
| role | No | Roles to search: "user", "assistant", "tool", a list of them, or "all" (default ["user", "tool"]) | |
| limit | No | Max rows (default 8) | |
| query | No | Words to find (case-insensitive whole words; rows with more words rank first). Omit when passing pattern | |
| context | No | Neighbouring rows of the same conversation to return before and after each hit, 0-5 (default 0) | |
| pattern | No | JavaScript regex source, at most 200 characters; tested against each row's first 20000 characters and against every line. Omit when passing query | |
| in_context | No | true: only rows still in your context; false: only trimmed rows (default both) | |
| session_id | No | Session id from the [openmem: continuing session …] pointer | |
| ignore_case | No | Match pattern case-insensitively (default false) |