- How the
aicommand translates prompts into filters - Prompt structures that produce reliable output
- Dry-run first validation workflow
- When to switch from
aito explicitsearchfilters
How Translation Works
The ai command is an interpretation layer over FileFortress search filters. It does not search by chat semantics. It tries to map your sentence to explicit fields like media type, size, dates, extensions, remote name, and metadata predicates.
Strong prompts include concrete filter hints. Weak prompts are usually account, billing, or configuration questions that do not map to file filters.
Pattern 1: Start with Media Type
Including media type up front gives the model a stable anchor and reduces ambiguous output.
# Strong
filefortress ai "find images from onedrive"
# Strong
filefortress ai "find videos larger than 500mb"
# Weak
filefortress ai "find my stuff"
Pattern 2: Use Comparable Phrases
Size and date boundaries are easier to map when phrased as explicit comparisons: larger than, smaller than, before, after, last 30 days, and similar.
| Intent | Prompt Example | Likely Mapping |
|---|---|---|
| Upper size bound | find images smaller than 5kb | sizeMaxBytes = 5120 |
| Lower size bound | find videos larger than 1gb | sizeMinBytes = 1073741824 |
| Relative date | find documents modified in last 30 days | modifiedAfter set to relative date |
Pattern 3: Prefer Filter Language Over Questions
Questions like how many remotes do I have? are valid product questions but not file-search prompts. Use command-specific intent:
- Use
ai: file discovery requests - Use
remotes list: remote inventory/count questions - Use
tools configure foundry: provider/model setup tasks
Do not use the AI search command as a general assistant. It is scoped to converting natural language into file-search filters.
Recommended Validation Workflow
- Start with a filter-oriented prompt.
- Run
--dry-runto verify interpreted filters. - Add
--explainto inspect reasoning when results are surprising. - Run without
--dry-runonly after interpretation matches intent.
# 1) Validate mapping only
filefortress ai "find images smaller than 5kb" --dry-run
# 2) Inspect model explanation
filefortress ai "find images smaller than 5kb" --dry-run --explain
# 3) Execute search
filefortress ai "find images smaller than 5kb"
When to Move to Explicit Search
If a query remains ambiguous after a couple of rephrases, switch to explicit search options. You will get deterministic behavior and easier scripts.
# Equivalent explicit search for "images smaller than 5kb"
filefortress search --media-type image --size-max 5KB
Related Resources
- AI Command Reference - Full syntax, options, and examples
- AI Troubleshooting Guide - Diagnose provider/model and interpretation failures