Search Chat History
search_historySearch the local chat archive to find transcript chunks for recalling past work; supports semantic, keyword, date-range, and related-chat queries.
Instructions
Search the local chat archive and return matching transcript chunks. Use this first to recall past work on a topic; then read a hit with get_chat_logs. For extracted action items, comparisons or briefs use compile_project_insights instead. Methods: 'semantic' (default) ranks chunks with Okapi BM25 plus recency decay and returns [{file, score}]; 'keyword' returns chunk ids containing every keyword; 'date_range' returns [{file_name, last_modified}] for chats saved between start_date and end_date; 'related' returns [{file, score}] for chats similar to file_name. Chunk ids look like 'name__part_2.json' and can be passed to get_chat_logs as chat_id. Active handoff receipts are ranked first. Read-only for chat data; it refreshes the local search index cache. An empty archive returns a single placeholder entry such as 'No stored chats found.'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum results for 'keyword' and 'date_range' searches. | |
| query | No | Free-text query for 'semantic' search; for 'keyword' it is split on spaces when 'keywords' is omitted. | |
| top_k | No | Maximum results for 'semantic' and 'related' searches. | |
| client | No | Archive namespace (a subfolder of the chats directory). Built-in: 'default', 'cursor', 'chatgpt', 'claude'; any other name creates its own subfolder. Omit to use 'default'. | default |
| method | No | Search strategy (see the tool description). | semantic |
| end_date | No | Inclusive end date (YYYY-MM-DD, UTC) for method='date_range'. Required with start_date. | |
| keywords | No | Exact terms for method='keyword'; all must appear. Overrides 'query' for that method. | |
| file_name | No | Reference chat file for method='related' (for example 'my-chat.json'). Falls back to 'query'. | |
| start_date | No | Inclusive start date (YYYY-MM-DD, UTC) for method='date_range'. Required with end_date. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |