Skip to main content

AI image search settings

AI Image Search lets shoppers search your catalog by uploading a photo instead of typing a query. The uploaded image is described by an AI vision model, that description is turned into a vector, and the closest products in your catalog are returned.

The AI Image Search settings are located at Stores -> Configuration -> Mirasvit extensions -> AI Search. The AI Search section is shared with AI semantic search and consists of the groups OpenAI connection, Semantic search, Image search, Safety and moderation and Abuse protection. This page describes all of them except Semantic search.

The section is available to admin users whose role has the AI Search resource, under Stores -> Settings -> Configuration in the role resources. When you upgrade from an earlier version, roles that have access to the Search Ultimate settings receive it automatically.

AI Search section

AI Search section with its groups

warning

AI Image Search requires OpenSearch or Elasticsearch as the search engine. It does not work with the MySQL search engine, because the product vectors are stored in a dedicated engine index. See How to set up AI image search.

tip

To apply the settings, clear the Magento cache after making changes.

OpenAI connection​

The settings of this group are shared by AI Image Search and AI semantic search.

At the top of the group, a status block shows whether both features can call OpenAI: whether Enable AI features and Enable OpenAI provider are on in Stores -> Configuration -> Mirasvit extensions -> Developer -> AI Configuration, and which API key is in use — the SearchAi key set here, the AI Configuration key (fallback), or none. If something is missing, the block says so and links to the AI configuration.

  • OpenAI API key: an optional OpenAI API key used only by AI Image Search and AI Semantic Search, for example to track search costs on a separate OpenAI account. When empty, the key from Stores -> Configuration -> Mirasvit extensions -> Developer -> AI Configuration -> OpenAI Configuration is used. The key is stored encrypted. This setting is configurable at default scope only.
  • Monthly token budget: the maximum number of tokens — vision and embedding combined — that may be spent per calendar month per store view by both features. When the budget is exhausted, new image searches are rejected and semantic search falls back to keyword-only results until the counter resets at the start of the next month. Set it to 0 for no limit. If the field is left empty, the default value is used. Default value is 1000000.
note

The budget covers shopper searches and catalog indexing of both features alike, so a full catalog reindex or mirasvit:search-ai:embed-text run draws on the same allowance. Current consumption per store view is shown in the Token budget this month block of the Search Ultimate dashboard.

OpenAI connection

OpenAI connection group


  • Enabled: shows the image search button on the storefront and accepts image search requests. Default value is No.
  • Debug mode: exposes internal scoring and timing information on the image search results page, and enables the public thumbnail-streaming endpoint. Use it while tuning results, and disable it in production. Default value is No.
  • Show tips for a better match: shows the Tips for a better match hints inside the image upload panel. The block is expanded by default. Default value is Yes. This setting is available only when Enabled is set to Yes.
  • Store Context for AI: optional text that guides how the AI describes your products, up to 500 characters. For example, We sell vintage mid-century furniture; focus on era and material. Leave it empty if your catalog needs no special guidance.
  • Max Upload Size (KB): the largest image a shopper may upload, in kilobytes. Default value is 10240 (10 MB).
  • Minimum Similarity Score: drops matches whose similarity score is below this floor. The range is 0.0–1.0, and a higher value is stricter — fewer but more relevant matches. The useful range is narrow: a catalog-quality photo of a stocked product scores about 0.80–0.90, a shopper's phone photo of the same product about 0.60–0.70, and unrelated products about 0.45–0.55. Adjust it in small steps, such as 0.02. Default value is 0.60.
  • Max Results: the maximum number of products returned by the vector search before the Minimum Similarity Score filter is applied. Default value is 50.
  • Max images per product (indexing): how many images per product are sent to the vision model during reindex. More images produce a richer description, but consume proportionally more tokens. Default value is 2.
  • Log Retention (days): image search log entries older than this many days are removed by the daily cleanup cron, together with their stored thumbnails. Set it to 0 to keep logs indefinitely. Default value is 90. This setting is configurable at default scope only.
  • Skipped product attributes (for AI context): one attribute code per line. These attributes are excluded when building the product description sent to the vision model, and the product text used by AI semantic search, which is useful for removing noisy or irrelevant fields. If left empty, a built-in list is used.
note

Minimum Similarity Score is usually the setting that decides how many results a shopper sees. Raising Max Results alone will not widen the result set if the score floor filters the extra matches out. To tune the floor, compare actual searches against the scores recorded in var/log/mirasvit_ai.log.

Image search

Image search group


Safety and moderation​

  • Enable moderation gate: checks each uploaded image with OpenAI's moderation API before searching, and rejects images that fall into any of the categories enabled below. Default value is Yes. Images containing sexual content involving minors are always blocked, regardless of the category settings below.
  • Block sexual content: default value is Yes.
  • Block hate / harassment: default value is Yes.
  • Block violence: default value is Yes.
  • Block self-harm content: default value is Yes.
  • Block illicit / illegal activity: default value is Yes.

The five category settings are available only when Enable moderation gate is set to Yes.

Rejected uploads are recorded in the AI image search log with the matched categories shown in the Moderation flags column.

Safety and moderation

Safety and moderation group


Abuse protection​

All settings in this group are configurable at default scope only. If a rate limit field is left empty, its default value is used. IPv6 addresses are counted per /64 network, so all addresses of one network share one limit.

  • Rate limit per IP per hour: the maximum number of image searches accepted from a single IP address within a rolling hour. Set it to 0 to disable the limit. Default value is 30.
  • Rate limit per session per hour: the maximum number of image searches accepted per browser session within a rolling hour. This limit is tighter than the per-IP one, which protects stores whose visitors share an IP address. Set it to 0 to disable the limit. Default value is 10.
  • Semantic search rate limit per IP per hour: the maximum number of new search queries per IP address per hour that AI semantic search sends to the OpenAI API. Queries searched recently are reused and do not count. When the limit is reached, the visitor gets keyword-only results. Set it to 0 to disable the limit. Default value is 300.
  • Semantic search embeddings per store per hour: the maximum number of new search queries per store view per hour that AI semantic search sends to the OpenAI API, across all visitors. Queries already embedded do not count. When the limit is reached, shoppers get keyword-only results until the next hour. Set it to 0 to disable the limit. Default value is 1000.
  • Blocked IP addresses: one IP address per line, matched exactly.
  • Blocked User-Agent patterns (regex): one case-insensitive regular expression per line. Delimiters are added automatically, so a literal / does not need escaping. For example, python-requests or ^Mozilla.*PhantomJS. Default value is bot|crawler|spider|crawl|slurp, so search engine crawlers can't run image searches, and AI semantic search does not send their new queries to the OpenAI API. Invalid patterns are skipped and reported in var/log/mirasvit_ai.log.

Abuse protection

Abuse protection group