{"slug": "building-a-12-language-ai-product-search-on-the-edge-what-actually-broke", "title": "Building a 12-language AI product search on the edge: what actually broke", "summary": "The developer behind OneFindMe, an AI product-search front end for AliExpress, detailed three major technical challenges encountered while building the service. The issues included the LLM producing fluent but useless translations, hallucinated category IDs, and high latency on cold searches. The developer shared the fixes, such as prompting for keyword-style noun phrases, using an allow-list for category IDs, and optimizing perceived latency.", "body_md": "I run [OneFindMe](https://onefindme.com/en/), an AI product-search front end for\n\nAliExpress. You describe what you want in plain language — in any of 12 languages\n\n— or upload a photo, and it returns the product, similar items, and cheaper\n\nalternatives. It runs entirely on a Cloudflare Worker with an LLM doing the\n\nlanguage work.\n\nThis isn't a launch post. It's the three problems that were genuinely hard, the\n\nwrong first solutions I shipped, and what actually fixed them. If you're putting\n\nan LLM in front of a marketplace search API, you'll hit all three.\n\nThe core loop is: take a natural-language query in any language → turn it into a\n\nclean marketplace search term → hit the affiliate search API → rank and filter →\n\nreturn. The interesting failures are all in the \"turn it into a clean search\n\nterm\" step.\n\nThe first version asked the model to \"translate this shopping query to English.\"\n\nIt did — beautifully, fluently, and uselessly.\n\nA user searching for a `שמלת ערב`\n\n(evening dress) got back\n\n`an elegant formal gown suitable for evening occasions`\n\n. Grammatically perfect.\n\nIt also returned almost nothing from the marketplace, because **nobody titles a\nproduct listing in fluent prose.** Marketplace sellers write\n\n`Women Elegant Evening Party Dress Sexy Backless`\n\n— keyword soup, not sentences.The fix was to stop asking for translation and start asking for **the 2-3 word\nnoun phrase a seller would put in a title.** The prompt changed from \"translate\"\n\n**Lesson:** when an LLM feeds a keyword system, you don't want its best language.\n\nYou want the language of the target index. Prompt for that explicitly.\n\nTo narrow results, I let the model suggest an AliExpress category ID alongside\n\nthe keywords. Category-constrained search returns cleaner results — when the ID\n\nis real.\n\nThe model would confidently return category IDs that **did not exist.** Not\n\noften, but often enough. And a nonexistent category ID doesn't error — it returns\n\nan empty or garbage result set, which then *replaced* the perfectly good\n\nkeyword-only results the same query would have produced. The hallucinated\n\nconstraint silently beat the honest fallback.\n\nTwo things fixed it. First, a hard allow-list: category IDs the model proposes\n\nare checked against a map of known-good IDs and dropped if unrecognised. Second,\n\nand more important, the keyword search always runs; the category is an\n\n*optional* refinement layered on top, never a replacement. If the category path\n\nreturns nothing, the keyword results are still there.\n\n**Lesson:** never let a model's optional enrichment silently override your\n\ndeterministic baseline. Layer it, gate it, and make the baseline win by default.\n\nAn uncached search does real work: an LLM call to build the query, the\n\nmarketplace API round trip, ranking, filtering. Cold, that's 6-8 seconds. Users\n\ndon't wait 6-8 seconds. The single biggest driver of bounce wasn't relevance —\n\nit was latency on the first search.\n\nThe cache helps enormously: every search result is cached in KV for up to 30\n\ndays, so a warm search returns in ~200 ms. But you can't cache a query nobody has\n\nrun yet, and the *first* person to search a term pays the full cost.\n\nTwo moves cut the *perceived* wait to near zero without making the search\n\nactually faster:\n\nNeither makes the cold path faster. Both make it invisible. That distinction —\n\noptimising perceived latency instead of actual latency — moved the metric that\n\nmattered more than any relevance tuning did.\n\n**Lesson:** on a search product, the empty-state-while-loading is a feature, not\n\na gap. Show *something* instantly and backfill.\n\nA subtle one, because it looks like success: **don't trust the marketplace's own\n\"is this product available\" signal in isolation.** The affiliate API would report\n\nThe engine runs in 12 languages now, and every one of those bugs showed up\n\nidentically in each. If you're building anything that puts an LLM between a human\n\nsentence and a structured search index, you'll meet all four. Happy to compare\n\nnotes in the comments — especially if you've found a better answer to the\n\ncold-search problem than \"show bestsellers and pray.\"\n\n*I build OneFindMe — AI product search for\nAliExpress by text or image, in 12 languages. It's free; it runs on affiliate\ncommission at no extra cost to the buyer.*", "url": "https://wpnews.pro/news/building-a-12-language-ai-product-search-on-the-edge-what-actually-broke", "canonical_source": "https://dev.to/ohadfarkash/building-a-12-language-ai-product-search-on-the-edge-what-actually-broke-45kb", "published_at": "2026-08-25 10:10:26+00:00", "updated_at": "2026-08-25 10:44:14.390509+00:00", "lang": "en", "topics": ["artificial-intelligence", "large-language-models", "ai-products", "ai-infrastructure", "developer-tools"], "entities": ["OneFindMe", "AliExpress", "Cloudflare"], "alternates": {"html": "https://wpnews.pro/news/building-a-12-language-ai-product-search-on-the-edge-what-actually-broke", "markdown": "https://wpnews.pro/news/building-a-12-language-ai-product-search-on-the-edge-what-actually-broke.md", "text": "https://wpnews.pro/news/building-a-12-language-ai-product-search-on-the-edge-what-actually-broke.txt", "jsonld": "https://wpnews.pro/news/building-a-12-language-ai-product-search-on-the-edge-what-actually-broke.jsonld"}}