Mercadona slashes AI search costs 90%
- Mercadona replaced Algolia in its online store with an in-house search engine built largely by Mercadona Tech CTO José Ramón Pérez Agüera. - The new stack handles 4.4 million weekly searches, cut monthly search costs from roughly $9,000-$15,000 to under $900, and improved ranking quality 85%. - That matters because search drives 30%-35% of products added to cart, so cheaper in-house relevance now looks viable for big retailers.
Online grocery search sounds boring until you realize it decides what people actually buy. At Mercadona, the search box influences roughly a third of the products that end up in the cart. So when the Spanish retailer ripped out Algolia after eight years and replaced it with an in-house system built with help from Anthropic’s Claude Code, this was not a side experiment. It was a production change to one of the company’s revenue pipes — and the reported savings are huge. ### What actually changed? Mercadona’s ecommerce team stopped relying on Algolia, the hosted search service many big brands use, and shipped its own internal search stack instead. The work was led largely by José Ramón Pérez Agüera, Mercadona Tech’s CTO, who said the foundation of the new system came together in “three days” of concentrated work — basically a long weekend plus Monday. The broader build took about a month before deployment. ### Why is search such a big deal here? Because this is not just a convenience feature. Mercadona’s online store processes 4.4 million searches a week, and search directly affects 30% to 35% of the products customers add to their baskets. In grocery, where margins are tight and repeat behavior matters, a better ranking system changes both conversion and customer frustration. A bad search engine is not cosmetic — it leaks sales. ### What did Claude Code do? This is the part people can easily overread. Claude Code was not the search engine customers talk to. It was the coding assistant used to help build the search engine faster. Pérez Agüera described it as the main development tool for implementing the system, improving the build.” ### How big were the savings? Mercadona said the old setup with Algolia cost between $9,000 and $15,000 per month. The new system costs under $900 a month. That is where the “90% cut” comes from — and in some months it works out closer to 94%. For a feature handling millions of weekly queries, that is not a rounding error. It changes the build-versus-buy math. ### Did the search get worse? Turns out, no — at least by Mercadona’s own metrics, it improved. The company said ranking quality rose 85%, and searches returning no results fell from 4% of total searches to zero. That matters more than the raw cost number, because the cheap version only counts if customers find products faster and with fewer dead ends. ### Why didn’t they do this earlier? Vendor lock-in and staffing math. Mercadona had considered replacing Algolia for years, but the internal estimate for building even a simpler version was about five months of work. AI coding agents changed that estimate enough to make the project worth doing. Basically, Claude Code compressed the engineering effort until an old “maybe someday” project became a live business decision. ### Does this mean retailers should all copy it? Not automatically. Mercadona had a technical leader willing to prototype the system himself, and its product catalog and search patterns are unusually well understood. But the broader signal is real — if AI coding tools can shrink custom infrastructure work from months to weeks, some companies will stop paying premium SaaS prices for core systems they can now own. ### What’s the bottom line? The interesting part is not that Mercadona used AI. Plenty of companies do that. The interesting part is where it used AI — to rebuild a boring, expensive, business-critical layer of software and then actually put it into production. If those numbers hold up, this is the kind of story other retail CTOs will read with a calculator open.