Search by Algolia
Building a performant search bar in Nuxt with Algolia & Storefront UI
engineering

Building a performant search bar in Nuxt with Algolia & Storefront UI

In today's highly competitive e-commerce landscape, providing customers with a seamless and efficient search experience can make all ...

Jakub Andrzejewski

Senior Developer and Dev Advocate at Vue Storefront

How to use AI to build your business
ai

How to use AI to build your business

The world of technology is constantly evolving with generative Artificial Intelligence (AI) currently leading the charge. We’re suddenly surrounded ...

Abhijit Mehta

Director of Product Management

Haystack EU 2023: Learnings and reflections from our team
ai

Haystack EU 2023: Learnings and reflections from our team

If you have built search experiences, you know creating a great search experience is a never-ending process: the data ...

Paul-Louis Nech

Senior ML Engineer

What is k-means clustering? An introduction
product

What is k-means clustering? An introduction

Just as with a school kid who’s left unsupervised when their teacher steps outside to deal with a distraction ...

Catherine Dee

Search and Discovery writer

Feature Spotlight: Synonyms
product

Feature Spotlight: Synonyms

Back in May 2014, we added support for synonyms inside Algolia. We took our time to really nail the details ...

Jaden Baptista

Technical Writer

Feature Spotlight: Query Rules
product

Feature Spotlight: Query Rules

You’re running an ecommerce site for an electronics retailer, and you’re seeing in your analytics that users keep ...

Jaden Baptista

Technical Writer

An introduction to transformer models in neural networks and machine learning
ai

An introduction to transformer models in neural networks and machine learning

What do OpenAI and DeepMind have in common? Give up? These innovative organizations both utilize technology known as transformer models ...

Vincent Caruana

Sr. SEO Web Digital Marketing Manager

What’s the secret of online merchandise management? Giving store merchandisers the right tools
e-commerce

What’s the secret of online merchandise management? Giving store merchandisers the right tools

As a successful in-store boutique manager in 1994, you might have had your merchandisers adorn your street-facing storefront ...

Catherine Dee

Search and Discovery writer

New features and capabilities in Algolia InstantSearch
engineering

New features and capabilities in Algolia InstantSearch

At Algolia, our business is more than search and discovery, it’s the continuous improvement of site search. If you ...

Haroen Viaene

JavaScript Library Developer

Feature Spotlight: Analytics
product

Feature Spotlight: Analytics

Analytics brings math and data into the otherwise very subjective world of ecommerce. It helps companies quantify how well their ...

Jaden Baptista

Technical Writer

What is clustering?
ai

What is clustering?

Amid all the momentous developments in the generative AI data space, are you a data scientist struggling to make sense ...

Vincent Caruana

Sr. SEO Web Digital Marketing Manager

What is a vector database?
product

What is a vector database?

Fashion ideas for guest aunt informal summer wedding Funny movie to get my bored high-schoolers off their addictive gaming ...

Vincent Caruana

Sr. SEO Web Digital Marketing Manager

Unlock the power of image-based recommendation with Algolia’s LookingSimilar
engineering

Unlock the power of image-based recommendation with Algolia’s LookingSimilar

Imagine you're visiting an online art gallery and a specific painting catches your eye. You'd like to find ...

Raed Chammam

Senior Software Engineer

Empowering Change: Algolia's Global Giving Days Impact Report
algolia

Empowering Change: Algolia's Global Giving Days Impact Report

At Algolia, our commitment to making a positive impact extends far beyond the digital landscape. We believe in the power ...

Amy Ciba

Senior Manager, People Success

Retail personalization: Give your ecommerce customers the tailored shopping experiences they expect and deserve
e-commerce

Retail personalization: Give your ecommerce customers the tailored shopping experiences they expect and deserve

In today’s post-pandemic-yet-still-super-competitive retail landscape, gaining, keeping, and converting ecommerce customers is no easy ...

Vincent Caruana

Sr. SEO Web Digital Marketing Manager

Algolia x eTail | A busy few days in Boston
algolia

Algolia x eTail | A busy few days in Boston

There are few atmospheres as unique as that of a conference exhibit hall: the air always filled with an indescribable ...

Marissa Wharton

Marketing Content Manager

What are vectors and how do they apply to machine learning?
ai

What are vectors and how do they apply to machine learning?

To consider the question of what vectors are, it helps to be a mathematician, or at least someone who’s ...

Catherine Dee

Search and Discovery writer

Why imports are important in JS
engineering

Why imports are important in JS

My first foray into programming was writing Python on a Raspberry Pi to flicker some LED lights — it wasn’t ...

Jaden Baptista

Technical Writer

Looking for something?

facebookfacebooklinkedinlinkedintwittertwittermailmail

Traditionally, we associate user intent with how search engines understand users’ needs and desires. But as the Web gets more and more sophisticated, understanding user intent has become a key challenge in designing personalized user journeys, even beyond search.

Ah, personalization — the holy grail of customer experience! Everyone talks about it, very few really know how to do it right. And there’s good reason for that: personalization is not a tick box exercise. It’s a complex undertaking due to the uniqueness of every user and the need to respect their privacy, while providing a personalized experience at the same time.

Thus, representing user intents as mathematical abstractions by plotting their actions and choices as points on a graph, enables us to visualize a user’s uniqueness while remaining (somewhat) anonymous.

Nowadays, relational data is naturally represented by graphs called networks of entities, which help us view and analyze the relationships between data points. These graphs can be applied to solving many real world problems, such as optimizing navigation between different locations and building recommendation engines, social graphs, and knowledge graphs.

Generally speaking, data can be graphed as long as it represents the interactions between its entities. For example, implicit social media relationships can be considered as a unified graph¹, with nodes representing entities such as users, pages, places, groups, comments, photos, photo albums, stories, videos, notes, and events. The graph represents how these nodes interact with each other, for example, a user posting a photo, video, or comment; a user updating their profile with their place of birth; a user liking a friend’s photo.

Before we attempt to represent user intents as a graph, however, let’s provide a more formal description of what we mean by “graph data”, without going into a lot of mathematical details, only enough to develop an intuitive understanding of graphs.

Graph principles

Formally, a graph is defined by a set of nodes V and a set of edges E between those nodes. We denote an edge going from one node (A) to another node (B). In many cases, we will be concerned only with simple graphs, where there is at most one edge between each pair of nodes, no edges between a node and itself, and where the edges are all undirected.

Directed vs. Undirected Graphs

A convenient way to represent graphs is through an adjacency matrix². To do that, let’s consider the relationship between users (U) and products (P) in an ecommerce scenario; we can represent the presence of edges as entries in this matrix:

Users (U) and Products (P) adjacency matrix

Of course, some graphs can also have weighted edges, where the entries in the adjacency matrix are arbitrary real values rather than {0, 1}. Additionally, graphs can have different types of edges. For instance, in our ecommerce scenarios, the interaction between users and products can take multiple forms: click, add to cart, add to wishlist, or purchase.

We can already see that our sample graph has two types of nodes: users and products. These are called bipartite heterogeneous graphs. Multipartite graphs are a well-known special case of heterogeneous graphs, where edges can only connect nodes that have different types, i.e., adding categories as a new type of node³.

Users, Products and Categories Graph

Lastly, in many cases we also have attribute or feature information associated with a graph (e.g., a picture associated with a product). Most often these are node-level attributes that are represented using vectors or matrices; in heterogeneous graphs, it’s usually the case that each different type of node has its own distinct type of attributes. In some cases, graphs are designed to support real-valued edge features in addition to discrete edge types, and in rare cases real-valued features are associated with entire graphs.

In recent years, graph neural networks have gained popularity in various domains due to their power and flexibility in modeling the dependencies between nodes. There are mainly three types of problems that can be solved by using machine learning with graphs:

1. Node classification

Node classification is useful for inferring information about a node based on its relationship with other nodes in the graph. Suppose we are given a large dataset of millions of products that are being commercialized on a marketplace, and we know that a significant number of these products are fake. Identifying these fake products is important both for the company that doesn’t want to promote fake offers (not to mention the fact that the users who “sell” those products are in breach of the terms and services) and the buyers who will be at the risk of ordering (and paying for) products that may never reach their destination.

It’s expensive to manually examine every product that users post. So having a model that could classify products as fake (or not) seems like an elegant, more cost-effective solution.

This is a classic example of node classification, where the goal is to predict the label associated with each noted, which could be a type, category, or attribute – even when the training set gives us only the true labels on the nodes. Node classification is perhaps the most popular machine learning task on graph data, especially in recent years.

2. Relational inference

Along with node classification, relational inference is one of the more popular machine learning tasks with graph data and has countless real-world applications: product recommendations in ecommerce scenarios, predicting drug side-effects, or inferring new facts in relational databases. All of these tasks can be viewed as special cases of relation prediction.

The standard setup for relational inference is that we are given a set of nodes V and an incomplete set of edges between these nodes and the goal is to use this partial information to infer the missing edges. In simple graphs, such as recommender systems that only encode “purchase” relations, there are simple heuristics based on how many neighbors two nodes share that can achieve strong performance. On the other hand, in more complex multi-relational graph datasets, such as biomedical knowledge graphs that encode hundreds of different biological interactions, relation prediction can require complex reasoning and inference strategies.

3. Clustering

While node classification and relation prediction require inferring missing information about graph data, thereby making them, in many ways, analogous to supervised learning; cluster detection, in contrast, is more analogous to unsupervised clustering.

Again, in our ecommerce scenario, let’s say we have a database of user profiles, and we make a collaboration graph that connects two user profiles that express similar preferences. If we were to examine it, we’d notice that the graph segregates into different clusters of nodes, grouped together by product affinities, total order values, or other similar demographic factors.

The general intuition in graph clustering is to surface nodes that are much more likely to form edges with nodes that belong to the same cluster.

User intent graphs

After that short introduction to graph theory, we’re ready to build our user intent graph. We first need to define the nodes before describing the relationships between them. At first glance, for an ecommerce recommender system, it’s pretty straightforward to represent the nodes as users and products, and the edges as interactions — as we’ve seen in the graphs above.

But how do we define intent and how do we represent that in our graph?

If a user visits 3 products, what can we tell about her intent? Or if the same user adds one item to the cart, are we more clear on her intent? What if instead of finalizing the order, she visits the “Contact Us” page?

User intent is defined as the purpose of a user’s series of actions. Marketers have been traditionally working with a standard set of intents, mainly inspired by Google’s search algorithm:

  • Navigational — user wants to find a specific page or site (branded keywords)
  • Informational — user wants to answer a specific question (queries that include “how to”, “what is”, “where is”, “why do”)
  • Transactional — user wants to complete an action (conversion, signup, phone call)

Obviously, a user with a navigational intent would have very different expectations for their landing page than one that’s in a transactional mindset. Hence the need for personalization.

Thus, the complexity of our graph is tied to the way we define users, items, and intents: if we consider a finite number of intent classes (navigational, informational, transactional) then our graph can look pretty clean. However, if an intent can take a multitude of values depending on the specifics of the industry they are actively engaged in at any given time, and the characteristics of the items themselves, then the picture becomes fuzzier.

User Intents Graph

That’s why, for ecommerce journeys, we might be looking at the following types of intents: (1) goal-oriented intents; (2) affinity-oriented intents; (3) metrics-oriented intents. And it’s important to note that we’re expecting users to manifest a combination of intents, not just a dominant one.

Example of user intents: goals, affinities and metrics

To begin the representation of our user intent graph, we can imagine that each user (U) is linked to their sessions (S) and during each session the user interacts with products (P) — each with their own attributes (A).

A representation of user intent graph: user-sessions-products-attributes

There are certain events that users can do in their session that are not necessarily linked to a specific item: signing up, churning, or browsing. While others are linked to the items and cart: abandoning the cart, adding to the cart, and checkout.

A representation of user intent graph: user-sessions-products-attributes and events

Users can also search, in which case there are common queries linked to items and categories of items.

A representation of user intent graph: user-sessions-products-attributes, events and search queries

As complex as the user intent graph has become, we can “compress” it to the following diagram:

A representation of the compressed user intent graph

In a REST API format, you’d expect something like /1/users/{identifier}/fetch to respond with:

In practice, you want to be able to explore the user intent graph and easily extract users based on any given combination of intents:

intents.cart_abandonment.probability: 0.5 TO 0.9 
AND intents.next_order_value.value >= 50 
AND intents.affinities.brand.value = “adidas” 
AND intents.affinities.brand.probability > 0.5

Applications

Let’s briefly talk about the type of applications the user intent graph enables us to build. We’ve already started this article by making references to personalization, but what can we personalize based on intent?

1. Search

For ecommerce websites that have an almost unlimited database of products, personalization is a really crucial capability for their end-users. If our user intent graph is equipped with user affinities then personalizing search results becomes pretty straightforward.

2. Recommendations

Similarly, we could use next order value intent as a filter for surfacing products inside a category that the user is currently browsing or as an upselling opportunity in the cart, matching the user’s buying power.

3. Journeys

Last but not least, we can go beyond on-site search and recommend and adjust or orchestrate user journeys depending on their intent. What if our users are not interested in buying any of our items and they’re just browsing around?

Why not prompt them to subscribe to the newsletter, or sign up to the blog, follow on social media, etc.? Sometimes, the best thing for a user is not to add to cart, but to read more about a certain product or a service before deciding to purchase, which might come in later sessions.

Assisting the user and personalizing her journey can be achieved via a user intent graph that’s capable of surfacing next best actions the user should take in order to reach a certain goal. For example, if our user is more likely to sign up to the newsletter than add to a cart, what do you think the right call to action should be?

In this article we’ve explored a new way of looking at personalization through the lenses of a user intent graph. Composing intelligent journeys once the graph has been built is considerably easier than actually starting from scratch and building the graph itself. Throughout this series of articles dedicated to uncovering the building blocks of orchestrating intelligent, real-time, and privacy-aware experiences and apps, we’re going to focus on what goes behind the scenes of a great personalization strategy. From fine-tuning product recommendations based on user intents to minimizing distractions for users who are at risk abandoning their cart — all of these and many, many more personalization use-cases can be implemented easily with the help of the user intent graph. Stay tuned for the next one.

[1] https://deepai.org/publication/graph-neural-networks-for-recommender-systems-challenges-methods-and-directions

[2] https://cs.mcgill.ca/~wlh/comp766/files/chapter1_draft_mar29.pdf

[3] https://www.morganclaypoolpublishers.com/catalog_Orig/samples/9781681739649_sample.pdf

[4] https://alessandro-negro.medium.com/is-a-knowledge-graph-capable-of-capturing-human-knowledge-8521162f06b2

[5] https://www.semrush.com/blog/how-to-use-search-intent-for-your-business/

About the author
Ciprian Borodescu

AI Product Manager | On a mission to help people succeed through the use of AI

githublinkedintwitter

Recommended Articles

Powered byAlgolia Algolia Recommend

Knowledge graphs and ontologies — Adding knowledge to keyword search
ai

Julien Lemoine

Co-founder & former CTO at Algolia

The 7 Dysfunctions of Personalization Engines
ai

Ciprian Borodescu

AI Product Manager | On a mission to help people succeed through the use of AI

How semantic search can deliver knowledge and answer questions
ux

Vincent Caruana

Sr. SEO Web Digital Marketing Manager