Parameters
Required. Search query string to find in sessions. Case-insensitive.
Optional. Filter sessions by specific date (YYYY-MM-DD format). Only sessions from this date will be searched.
Optional. Filter sessions from this date onwards (YYYY-MM-DD format). Used with
dateTo to search within a date range.Optional. Filter sessions up to this date (YYYY-MM-DD format). Used with
dateFrom to search within a date range.Optional. Maximum number of results to return. Default: no limit (returns all matches).
Response
Success
Always
true on success.Array of matching sessions sorted by relevance (highest first), then by date (newest first).
Session folder name (e.g.,
authentication-implementation).Session topic.
ISO date string.
Full path to session file.
File size in bytes.
Relevance score (0-1). Higher scores indicate better matches. Topic matches score higher than content matches.
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.
Total number of matches found (across topic, content, and messages).
Total number of matching sessions returned.
The search query that was used.
Error
Always
false.Error code (see below).
Human-readable error message.
Error Codes
| Code | Description |
|---|---|
Search query is required | Empty or missing query parameter |
READ_ERROR | Cannot read session file |
PARSE_ERROR | Cannot parse session file |
UNKNOWN_ERROR | Unexpected error |
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