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

# How-To: Serve Personalized Recommendations

> Implement real-time recommendation serving for web and mobile product surfaces.

Use this guide to ship personalized recommendations in production surfaces such as home feed, product detail rails, and post-purchase modules.

## Setup

<Steps>
  <Step title="Create an API client">
    Create an API client in Console > SDK Credentials.
  </Step>

  <Step title="Exchange credentials">
    Exchange client credentials for an access token.
  </Step>

  <Step title="Serve from the backend">
    Store the token in your backend service and request recommendations from server-side code through the SDKs or Core API.
  </Step>
</Steps>

```bash theme={null}
curl -X POST https://auth.neuronsearchlab.com/oauth2/token \
  -H "Authorization: Basic <base64(client_id:client_secret)>" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=client_credentials"
```

## Common workflows

### Request recommendations for a known user

```bash theme={null}
curl -X GET "https://api.neuronsearchlab.com/v1/recommendations?user_id=user-123&context_id=101&limit=8" \
  -H "Authorization: Bearer <access_token>"
```

### Serve recommendations for anonymous traffic

Use a temporary user identifier (for example a session-scoped UUID) in `user_id` so traffic can still be tracked consistently.

### Roll out by surface using context IDs

Create separate context IDs for each surface (`101`, `205`, `309`) and pass the right `context_id` per request so ranking logic stays predictable.

## Example app journey: Home feed rollout

<Steps>
  <Step title="Define the home feed context">
    Product team defines context `101` for Home Feed in Console.
  </Step>

  <Step title="Request recommendations">
    Backend requests recommendations with `user_id`, `context_id=101`, and `limit=8`.
  </Step>

  <Step title="Render the rail">
    Frontend renders the top recommendations in a hero rail.
  </Step>

  <Step title="Submit feedback events">
    Click/view events are submitted to `/v1/events` to close the feedback loop.
  </Step>

  <Step title="Review engagement">
    Analytics is reviewed daily for serve volume and engagement lift.
  </Step>
</Steps>

## Next steps

* [How-To: Connect Catalog and Events](./how-to-connect-catalog-and-events)
* [How-To: Launch a New Context](./how-to-launch-a-new-context)
* [Recommendation endpoint reference](/api-reference/endpoint/get-recommendations)
