Search Indexed Content
ctx_searchSearch a unified knowledge base of indexed content plus auto-captured session memory to recall decisions, errors, plans, and blockers, returning ranked snippets and cross-session results.
Instructions
Search the unified knowledge base: content you indexed plus auto-captured session memory (decisions, errors, blockers, plans, user prompts, compaction guides — 26 categories). Stemming, trigram and typo-tolerant matchers rank each query.
WHEN:
You want to recall something already in storage instead of re-reading raw sources
You have several related questions about one body of knowledge — batch them into one call
You want one labelled source (pass
source— partial match is fine) or a cross-session view (passsort: "timeline")You want to filter by content shape (
contentType: "code"or"prose")
WHEN NOT:
The data was never indexed and no session memory surrounds it — capture first, then query
You have one ad-hoc question about unindexed data — run code in the sandbox tool instead
RETURNS:
Per-query ranked sections with window-extracted snippets. Use 2-4 technical terms per query. Labels: decision, error, blocker, plan, user-prompt, compaction. Results taper in the rolling time window and block after the hard cap (CONTEXT_MODE_SEARCH_WINDOW_MS).
EXAMPLE: ctx_search(queries: ["root cause", "proposed fix"], source: "issue-#683")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sort | No | Sort mode. 'relevance' (default): BM25 ranked, current session only. 'timeline': chronological across current session, prior sessions, and auto-memory. | relevance |
| limit | No | Results per query (default: 3) | |
| query | No | Single search query. Equivalent to queries: [query]. | |
| source | No | Filter to a specific indexed source (partial match). | |
| queries | No | Array of search queries. Batch ALL questions in one call. | |
| contentType | No | Filter results by content type: 'code' or 'prose'. |