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
Basic Search
Search with Date Filter
Search with Date Range
Search with Limit
Search Behavior
What Gets Searched
CodeArchitect searches in three places for each session:- Topic (weighted 3x) - The session folder name/topic
- Content (weighted 2x) - The conversation text content
- 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
Result Sorting
Results are sorted by:- Relevance score (highest first)
- 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
Storage Location
Always searches in:~/.codearchitect/sessions/
- Windows:
C:\Users\YourName\.codearchitect\sessions\ - Linux/Mac:
~/.codearchitect/sessions/ - Searches through all date folders unless filtered
- New format: Topic folders with
summary.mdandfull.md(prefersfull.mdfor 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
limitparameter to get top matches only - Check snippets: Use snippets to quickly identify relevant sessions before retrieving full content
Next Steps
After searching:- Get specific session:
use codearchitect get_session [topic-name] - Refine search: Try different keywords or filters
- Store related sessions: Save new discussions about related topics