Skip to main content
Search across all stored AI conversation sessions using full-text search. Returns matching sessions with relevance scores, context snippets, and match counts. Results are sorted by relevance (highest first), then by date (newest first).

Parameters

string
required
Required. Search query string to find in sessions. Case-insensitive.
string
Optional. Filter sessions by specific date (YYYY-MM-DD format). Only sessions from this date will be searched.
string
Optional. Filter sessions from this date onwards (YYYY-MM-DD format). Used with dateTo to search within a date range.
string
Optional. Filter sessions up to this date (YYYY-MM-DD format). Used with dateFrom to search within a date range.
number
Optional. Maximum number of results to return. Default: no limit (returns all matches).

Response

Success

boolean
required
Always true on success.
SearchResult[]
required
Array of matching sessions sorted by relevance (highest first), then by date (newest first).
string
required
Session folder name (e.g., authentication-implementation).
string
required
Session topic.
string
required
ISO date string.
string
required
Full path to session file.
number
File size in bytes.
number
required
Relevance score (0-1). Higher scores indicate better matches. Topic matches score higher than content matches.
string[]
Array of context snippets showing where matches were found. Up to 3 snippets per session. Each snippet is ~150 characters before and after the match.
number
required
Total number of matches found (across topic, content, and messages).
number
required
Total number of matching sessions returned.
string
The search query that was used.

Error

boolean
required
Always false.
string
required
Error code (see below).
string
Human-readable error message.

Error Codes

Examples

Search with Date Filter

Search with Date Range

Search with Limit

Search Behavior

What Gets Searched

CodeArchitect searches in three places for each session:
  1. Topic (weighted 3x) - The session folder name/topic
  2. Content (weighted 2x) - The conversation text content
  3. Messages (weighted 1x) - Individual user/assistant messages

Relevance Scoring

Results are scored using weighted relevance:
  • Topic matches contribute 3 points per match
  • Content matches contribute 2 points per match
  • Message matches contribute 1 point per match
Scores are normalized to a 0-1 range, with higher scores indicating better matches.

Result Sorting

Results are sorted by:
  1. Relevance score (highest first)
  2. Date (newest first) - if relevance scores are equal

Case-Insensitive

Search is case-insensitive. "authentication" matches "Authentication", "AUTHENTICATION", etc.

Snippets

Snippets show context around matches:
  • Length: ~150 characters before and after each match
  • Limit: Maximum 3 snippets per session (to avoid clutter)
  • Format: Preserves original text formatting and case
  • Ellipsis: Shows ”…” if snippet is cut off
Snippets help you quickly see where matches were found without reading the entire session.

Storage Location

Always searches in: ~/.codearchitect/sessions/
  • Windows: C:\Users\YourName\.codearchitect\sessions\
  • Linux/Mac: ~/.codearchitect/sessions/
  • Searches through all date folders unless filtered
Supports both storage formats:
  • New format: Topic folders with summary.md and full.md (prefers full.md for search)
  • Legacy format: Flat files directly in date folders

Performance

  • Scans all sessions in your knowledge base
  • Reads file contents to search within them
  • Fast for typical use (hundreds of sessions)
  • Date filtering reduces work by limiting folders scanned

Usage Tips

  • Be specific: Use descriptive keywords (e.g., “authentication” instead of “auth”)
  • Use date filters: Narrow results when searching within a time period
  • Limit results: Use limit parameter to get top matches only
  • Check snippets: Use snippets to quickly identify relevant sessions before retrieving full content

Next Steps

After searching:
  1. Get specific session: use codearchitect get_session [topic-name]
  2. Refine search: Try different keywords or filters
  3. Store related sessions: Save new discussions about related topics