Skip to main content

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.

A context is a named configuration that shapes what the recommendation engine retrieves for a specific surface. Create one context per placement, such as a homepage feed, product detail page, or email digest, and reference its numeric console ID in recommendation calls for that surface. This guide covers the controls that belong in the current context editor.

Create a context

1

Open the context editor

Open Console > Contexts and click New context.
2

Name the context

Give it a descriptive name such as “Homepage Feed” or “Post-purchase Sidebar”.
3

Document its purpose

Add an optional description so teammates understand its purpose.
4

Select the model

Select the model this context draws recommendations from.
5

Choose the model family

Choose the recommendation type / model family, such as General, Similar Items, Watch Next, Trending, or Email Digest, depending on which model families are enabled for your tenant.
6

Save and record the ID

Save the context and note its ID, such as 101. Your engineering team will pass this ID in context_id on recommendation requests.

Retrieval settings

Contexts control the retrieval defaults for a surface:
  • Embedding model decides which representation is used to compare users and items.
  • Recommendation type decides whether the request is user-driven or item-driven.
  • Pre-query filters decide which candidates are even allowed into the scoring stage.
If the question is “what pool should the model search?”, the answer usually belongs in the context.

Filters

Filters restrict which items are eligible before scoring. Only items that pass the active filters are considered by the ranking pipeline. To add a filter:
1

Add a filter

In the Advanced tab, click Add Filter.
2

Select a metadata field

Select a metadata field from your catalog, such as category, in_stock, or price.
3

Choose an operator

Choose an operator: =, !=, LIKE, NOT LIKE, >, <, >=, <=, IN, NOT IN.
4

Enter a comparison value

Enter the value to compare against.
5

Combine conditions

Add more conditions and combine them with AND or OR as needed.
Example: Restrict a context to in-stock items in the Electronics category:
FieldOperatorValueLogic
in_stock=true
category=ElectronicsAND
Use context filters for durable eligibility rules such as inventory, country, brand, or catalog partitioning.

What now belongs in Rules Engine

Contexts are no longer the place for post-scoring merchandising controls. If you need to change how scored results are promoted, suppressed, ordered, or grouped, use Rules Engine.
Use caseConfigure in
Promote or demote matching itemsRules Engine with boost or bury
Remove items after scoringRules Engine with filter
Limit list share or enforce varietyRules Engine with cap, diversity, or dedupe
Pin, reorder, randomize, or protect top slotsRules Engine with pin, reorder, randomize, or ensure_top
Return grouped resultsRules Engine with group_by
Reweight by user topic affinityRules Engine with weighted_topic
If the question is “how should already-scored candidates be reshaped?”, the answer belongs in the Rules Engine.

Iterate over time

As your product evolves, return to the context editor to refine retrieval settings and eligibility filters. When you need to change ranking behaviour after scoring, pair those context changes with explicit rules rather than overloading the context itself.