How to set up AI image search
AI Image Search adds a camera button beside the storefront search field, so shoppers can upload a photo and find visually similar products. This guide walks through everything needed to get it working.
The button stays hidden until the whole chain is in place, so work through the steps in order.
1. Check your search engine
AI Image Search stores product vectors in a dedicated search engine index, so it requires OpenSearch or Elasticsearch. The MySQL search engine is not supported.
Check the current engine at Stores -> Configuration -> Mirasvit extensions -> Search ultimate -> Search engine. If it is set to MySQL, switch to OpenSearch or Elasticsearch first — see How to install a search engine.
2. Add your OpenAI API key
Generate a key in your OpenAI account. You can set it in either of two places:
- in Stores -> Configuration -> Mirasvit extensions -> Developer -> AI Configuration -> OpenAI Configuration — the key shared by all Mirasvit extensions that use OpenAI;
- in OpenAI API key at Stores -> Configuration -> Mirasvit extensions -> AI Search -> OpenAI connection — a key used only by AI search, for example to track search costs separately. When set, it takes priority.
In both cases, Enable AI features and Enable OpenAI provider in Stores -> Configuration -> Mirasvit extensions -> Developer -> AI Configuration must be set to Yes. Click Save Config, then check the status block at the top of OpenAI connection: it shows which key is in use and whether OpenAI is available.
The key is used for two kinds of call — describing images with a vision model, and turning those descriptions into vectors. It is stored encrypted and is shared with AI Semantic Search.
Without a key the storefront button never appears, and no error is shown to the shopper. If the button is missing, this is the first thing to check.
3. Enable the feature
Set Enabled to Yes in the Image search group of AI Search, then clear the Magento cache. Image search is disabled by default.
While you are there, consider filling in Store Context for AI. A short sentence about what you sell measurably improves the descriptions the vision model produces — and therefore the quality of matches. See AI image search settings for the full list of options.
4. Build the vectors
Nothing can be matched until your catalog has been indexed. Run the reindex for each store view you want image search to work in:
bin/magento mirasvit:search-ai:reindex --store-id=1
The command reports how many products it will process and estimates the tokens involved, then asks for confirmation before making any paid API calls.
This step calls the OpenAI API and costs money, roughly in proportion to your catalog size and to Max images per product (indexing). Products that already have an up-to-date vector are skipped without an API call, so re-running the command later is inexpensive.
Vectors are stored per store view. A store view you never index keeps the upload button hidden, even if every other store view is fully indexed. Repeat the command with the appropriate --store-id for each one.
5. Confirm it is live
Open System -> Search Management -> Dashboard. In the Index coverage per store view table of the AI search block, the Image search live column should read Yes for the store view, and Coverage should show the share of your catalog that has been indexed.
Then open your storefront: a camera button appears beside the search field. Upload a photo, and the results page lists the closest matches.
If Image search live still reads No, the dashboard tells you which condition is unmet — the feature being disabled, a missing API key, or missing vectors. Note also that a store view whose catalog search index is empty returns no products even when its vectors are in place, so make sure your regular search works first. See How to ensure search works properly.
6. Tune the results
Once searches are running, the AI image search log shows what shoppers uploaded and what the AI made of it. Use the AI Primary Query column to tell the two failure modes apart:
- The description does not match the photo — improve Store Context for AI, or raise Max images per product (indexing) and reindex.
- The description is accurate but few or no products come back — lower Minimum Similarity Score, which defaults to
0.60.
The Without results figure on the dashboard is the quickest way to see whether the threshold is set too high across the board.
7. Review the safeguards
Two groups of settings protect the feature from misuse, and both are worth reviewing before launch, since every accepted upload costs tokens:
- Safety and moderation screens uploads for inappropriate content before searching.
- Abuse protection caps how many searches a single IP address or browser session may run per hour.
You can also set a Monthly token budget in OpenAI connection to put a hard ceiling on monthly spend. See AI image search settings.