> ## 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.

# Contexts

> Understand how NeuronSearchLab models each recommendation surface.

A context is a named recommendation surface, such as a homepage feed, related articles rail, product detail page, checkout upsell, email digest, or video carousel.

Contexts are how NeuronSearchLab separates the intent of one surface from another. A homepage can optimize for discovery, a product page can optimize for similarity, and a checkout surface can optimize for conversion without forcing every request through the same ranking setup.

## Why contexts matter

A context gives operators one place to control the recommendation behavior for a surface:

* which model family and retrieval algorithm should be preferred
* which ranking recipe should shape candidate sources, signals, discovery, and guardrails
* which pipeline stages should run for that surface
* which hard pre-query filters should narrow the candidate pool
* which rules should reshape already-scored results
* which model is currently serving after fallback resolution

This is what turns NSL from a generic recommendation endpoint into a controllable ranking platform. Applications keep sending a stable `context_id`; operators can then tune the surface without changing application code every time.

## How context control fits together

| Layer          | Role                                                                                             |
| -------------- | ------------------------------------------------------------------------------------------------ |
| Context        | Names the product surface and stores its recommendation defaults.                                |
| Recipe         | Describes the ranking strategy for the surface.                                                  |
| Pipeline       | Controls the runtime stages candidates move through before results return.                       |
| Rules          | Applies post-scoring business logic such as boost, bury, pin, filter, cap, dedupe, and grouping. |
| Explainability | Shows why a user-item recommendation behaved the way it did.                                     |

## Where to go next

* [Console Contexts](/guides/contexts) for the operator workflow inside the context editor.
* [Launch a New Context](/guides/how-to-launch-a-new-context) for a staged rollout checklist.
* [Pipeline Config](/guides/pipeline-config) for runtime ranking stages.
* [Rules Engine](/guides/rules-engine) for post-scoring controls.
* [Recommendation Control Demo Path](/guides/recommendation-control-demo) for a buyer-facing proof path through contexts, rules, pipelines, and explainability.
