> ## Documentation Index
> Fetch the complete documentation index at: https://algolia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# User profiles

> A user profile is a representation of a user based on their behavior on your website or app.

A user profile is a representation of a user based on their behavior on your website or app.
It's used in conjunction with Algolia's [NeuralSearch](/doc/guides/ai-relevance/neuralsearch/get-started) and keyword search to personalize results.

## How user profiles are built

**Send accurate events to build relevant user profiles.**
Algolia requires events that describe how users interact with your app.
For example, an online bookstore might track when users:

* Click a specific book in a listing.
* View the genre or author on the book's details page.
* Add the book to their cart.
* Buy the book.

After receiving events, the Advanced Personalization feature applies various algorithms to your data (index and events).
It identifies patterns and relationships within your data to predict user affinities.
These affinities are used to create a user profile, which is continually updated with new information.

<Callout icon="credit-card" color="#c084fc">
  This feature isn't available on every plan.
  Refer to your [pricing plan](https://www.algolia.com/pricing) to see if it's included.
</Callout>

## Schema

A user profile is represented in JSON format and includes a unique identifier for the user and their preferences (affinities).

```json JSON icon=braces theme={"system"}
{
  "userID": "user-1",
  "lastUpdatedAt": "2024-05-21T01:15:35Z",
  "type": "basic",
  "affinities": [
    {
      "name": "categories",
      "value": "Software",
      "indices": ["storefront"],
      "score": 18,
      "lastUpdatedAt": "2024-05-20T23:14:26.078071Z"
    },
    {
      "name": "color",
      "value": "Blue",
      "indices": ["storefront"],
      "score": 14,
      "lastUpdatedAt": "2024-05-21T01:15:08.590763Z"
    },
    {
      "name": "brand",
      "value": "Microsoft",
      "indices": ["storefront"],
      "score": 6,
      "lastUpdatedAt": "2024-05-21T01:15:35.465487Z"
    }
  ]
}
```

## Properties

| Name                      | Type                | Description                                                                                                                                                                                                        |
| ------------------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `userID`                  | string              | A unique string that identifies and tracks users across various systems.                                                                                                                                           |
| `lastUpdatedAt`           | string              | Date at which the user profile was last updated.                                                                                                                                                                   |
| [`affinities`](#affinity) | array of affinities | Properties generated by Algolia's Advanced Personalization feature to provide insights into the user's preferences and interests. <br /> They're used to personalize the user's experience on your website or app. |

### Affinity

| Name            | Type             | Description                                                                                                                                                 |
| --------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name`          | string           | Name of the affinity.                                                                                                                                       |
| `value`         | string           | Value of the affinity.                                                                                                                                      |
| `indices`       | array of strings | Names of the Algolia indices associated with the affinity.                                                                                                  |
| `score`         | number           | Strength of the user's preference for that affinity. <br /> Each affinity has a `score` ranging from 1 to 20. A higher score signifies a stronger affinity. |
| `lastUpdatedAt` | timestamp        | Date of last update to this affinity.                                                                                                                       |

## See also

* [Fetching a user profile](/doc/guides/personalization/advanced-personalization/implement/guides/fetching-a-user-profile)
