ai

Natural Language Search

Translate natural-language prompts into structured search filters. Use dry-run mode to preview interpretation before running a full search.

Filter Translation Dry-Run Preview Explanation Support

Prerequisites

The ai command requires a configured AI provider. By default, FileFortress uses Microsoft Foundry Local — a local LLM runtime that keeps your queries on your machine.

Quick setup (one-time):

# 1. Install Microsoft Foundry Local from Microsoft
# 2. Detect the Foundry tool
filefortress tools detect --force
# 3. Enable and set as active AI provider
filefortress tools configure foundry --enable
# 4. Verify it works
filefortress ai "find images" --dry-run

Using a different provider? FileFortress supports any OpenAI-compatible endpoint — Ollama, OpenAI, Azure OpenAI, OpenRouter, and more. See the Local AI Setup Guide and the tools command for full configuration details.

Syntax

filefortress ai "natural language query" [options]

The query argument is required and should describe file-search intent (media type, size, date, remote, path, etc.).

Options

Option Description Example
--dry-run Interpret query and show filters without executing search ai "find images under 5kb" --dry-run
--explain Show explanation of how the prompt was interpreted ai "recent videos" --explain
--view Control search result format after translation ai "find png files" --view summary
--save-to-file Accepted for compatibility; persistence not implemented for ai output ai "find photos" --save-to-file out.txt

Prompt Patterns That Work

Strong Prompt

ai "find images smaller than 5kb"

Maps directly to media type + size filter.

Weak Prompt

ai "how many remotes do i have?"

Account question, not a search filter query.

Use the right command for account questions

For remote counts and account state, use filefortress remotes list. Use ai when your intent is file discovery.

Examples

Basic AI search

filefortress ai "find images"

Preview interpretation first

filefortress ai "find images smaller than 5kb" --dry-run

Inspect reasoning + filters

filefortress ai "find images smaller than 5kb" --dry-run --explain

AI Provider Management

FileFortress supports multiple AI providers. Only one is active at a time.

Configuring Foundry (Default)

# Enable Foundry (auto-detects endpoint, sets as active)
filefortress tools configure foundry --enable
# Enable with a specific model
filefortress tools configure foundry --enable --model phi-4-mini
# Change model on already-enabled provider
filefortress tools configure foundry --model "phi-4-openvino-gpu:1"
# Disable Foundry
filefortress tools configure foundry --disable

Switching Providers

When you enable Foundry with --enable, it is automatically set as the active AI provider. FileFortress stores provider configurations so you can switch between them. For configuring other providers (Ollama, OpenAI, Azure, OpenRouter), see the Local AI Setup Guide.

Supported Providers

Microsoft Foundry Local — default, local
Ollama — local, any open-weight model
OpenAI — cloud
Azure OpenAI — cloud, enterprise
OpenRouter — cloud, multi-model
Any OpenAI-compatible — self-hosted

Troubleshooting

Provider 400 with Foundry

Commonly caused by model mismatch. Configure the exact model ID reported by your endpoint.

filefortress tools configure foundry --model "phi-4-openvino-gpu:1"

AI could not extract any search filters

Rephrase with explicit search intent (media type, size, date, remote, path). Use --dry-run --explain to validate translation before execution.

Continue Learning

Explore deeper guidance for prompt design and troubleshooting workflows.