Summary

Read onto learn how to use LLMs to judge query intent, provide more relevant responses, and stand up smarter shopping experiences.

Download PDF

Introduction

The rapid advancement of artificial intelligence (AI) has not only drastically altered what and why technologists build, it's also started to change how technologists build those things. Computer code writing more computer code is no longer a futuristic concept synonymous with Skynet going live, and it doesn’t require taking a red pill to see its effects. AI is now a tangible, subtle, and nearly omnipresent force shaping our daily choices and interactions.

From the subtle curation of our music playlists, to the split-second selection of the next video on our feed, or from the pleasantly robotic voices in our kitchens to the dark window that’s doing our children’s homework, AI's influence permeates our lives. For those at the helm of technology – CTOs and senior developers – this transformation presents both an opportunity and a challenge. The ability to leverage large language models (LLMs) both as a means to rapidly write or rewrite code and as a means to replace the need to write those lines of code in the first place has, in the span of three years, become table-stakes for companies on the cutting edge of software development.

Based on the presently available domain knowledge, we’ll consider this trend through the scope of search, and how it's already manifested in the ability of large language models to judge the relevance and intent of an admittedly rushed, sometimes brief, almost always context-less search query. While search experiences have been a core component of dynamic and user-centric ecommerce experiences almost as long as ecommerce has been a word, never before have the engines behind those simple search bars been so good at taking only a few words, and easing consumers or potential customers to their most likely purchases with the minimum amount of friction or stress. Knowing a searcher's intent based on such little information borders on telepathy, but there is a subtle art to it, and no little amount of science.

This article aims to move beyond the theoretical "when" and "where" can AI (and more specifically LLMs) play a role in the consumer search experience (those answers are “now” and “everywhere,” respectively). What follows focuses instead on the practical "how." It will dissect the latest trends in AI-human entanglement, provide a strategic framework for employing LLMs to significantly enhance development efforts, and offer concrete code examples, particularly within the retail and ecommerce sectors that provide better results because they have LLMs under the hood, and even more specifically as these topics relate to standing up next-gen search experiences quickly and effectively.

 

What we’ll be building

After all, you probably get recommendations all the time: parents telling you to save your money, in-laws telling you how to mow the lawn, your children telling you not to use that word. If you already get the picture then feel free to skip ahead, but if you want a more formal definition, Emile Contal, PHD in Statistical Learning defines the practice of personalization as one in which:

“...content is modified based on some personal variables.These can be your past purchases on an online store, or your age, or where you live or simply what device you are using... What a user gets differs from what another user gets.”

Recommendation on the other hand requires: “filter[ing] a collection of things based on historical behavior of a user (typically likes/dislikes or behavioral history). Framing it this way recommendation is a form of personalization.” Some might argue, pedantically, that a recommendation must necessarily build upon personalization, because what are your previous shopping or clicking or viewing habits if not personal? Perhaps this data is even more personal than demographic information. Others, like Contal, would argue that the knowledge of previous activity and the history necessary for a recommendation are all ways to personalize. In any case, it's clear that the two are inextricably linked, because a good recommendation is not general. Your parents tell everyone to save their money, regardless of circumstance, your in-laws give everyone the same lawn advice and your children, hopefully, have learned that it's never okay to swear. Good recommendations are personalized. This Algolia blog post defines a personalized recommendation, in the scope of site search, as:

..a relevant suggestion generated by a recommendation engine (a.k.a. a recommender system) using an algorithm and filtering options based on what’s known about the customer’s on-site meanderings.

Enable anyone to build great Search & Discovery