Skip to main content

Division Seed

The divisionSeed parameter lets the client hint which product division (e.g. Women's, Men's, Kids) the user is browsing from. The LLM uses this to default its search filters to that division without the user needing to state it explicitly.

Supported Endpoints

EndpointParameterEffect
/agentic-search/conversedivisionSeed in payloadInjected into system prompt as division context
/agentic-search/conversation-startersdivision query paramGenerates division-specific conversation starters

/agentic-search (non-conversational) does not support divisionSeed. Division filtering on that endpoint relies on the client-provided filter in searchSettings, or the LLM inferring division from query context when autofilters are enabled.

Allowed Values

The global allowlist is defined in division-utils.ts:

men, mens, women, womens, kid, kids, beauty

Any value not in this list returns a 400 error.

Division Maps (Per-Store Normalization)

Stores can define a division map that translates the allowed input values to store-specific canonical tag values. For example, Fashion Nova maps:

InputCanonical Value
women / womensWomens
men / mensMens
kid / kidsKids
beautyBeauty

These maps live in components/agentic_search/src/converse/custom-contexts/ and are registered in catalog-context.ts under DIVISION_MAPS.

When no division map exists for a store, the remembered logical division value is used as-is.

How It Works

  1. Client sends divisionSeed: "womens" in the converse payload
  2. normalizeConversationDivision() validates the input against the allowlist and stores the logical division in the remembered conversation profile (e.g. "women")
  3. The current conversation profile is injected into the converse prompt on every turn:
    • Tells the LLM the user started browsing from that division
    • Shows the exact per-store division filter mappings when one exists (e.g. women -> tags:(Womens))
    • Tells the LLM to carry the remembered division into both its queries and filters
    • Allows the LLM to switch divisions if the user's request clearly indicates a different one
    • Once switched, the LLM keeps the new division for subsequent searches

Edge Cases

User explicitly requests a different division

If the divisionSeed is "womens" but the user asks "show me men's jackets", the LLM is instructed to switch to the appropriate division filter (tags:(Mens)). Once switched, the LLM keeps using the new division until the conversation context indicates otherwise — it does not revert to the original seed.

Interaction with client-provided filter

When inject_filter_context is enabled and the client provides a filter in searchSettings (e.g. tags:(WOMENS)), both the filter context and division seed are injected into the prompt. The LLM is instructed to defer to the active filter and not add a conflicting division filter from the seed. The active (client-provided) filter takes priority because it is applied server-side to every search — if the LLM emitted a conflicting auto-filter (e.g. tags:(Mens) when the client filter is tags:(WOMENS)), the merged filter would be (tags:(WOMENS)) AND (tags:(Mens)) which returns zero hits.

In practice, when autofilters are enabled, it is better to use divisionSeed instead of a hardcoded client filter for division scoping. This allows the LLM to override the division naturally when the user's intent changes, rather than being locked to a server-side filter that cannot be overridden.

Interaction with autofilters (filter_facets)

When both divisionSeed and filter_facets are enabled, the LLM receives:

  1. The division seed context (default to this division)
  2. The available filter fields and values from facets

The LLM uses the facet values to construct valid filter expressions. For example, with divisionSeed: "womens" and a tags facet field, the LLM will emit tags:(WOMENS) as the filter for the first search, using the exact value from the facet/description list.

No division seed provided

When divisionSeed is omitted, the system prompt does not include a current division, but stores with a division map still include the generic division mapping guidance. The LLM does not default to any division and only adds one when the user or conversation context makes it appropriate.

Code References

  • Validation and normalization: components/agentic_search/src/converse/division-utils.ts
  • Prompt injection: components/agentic_search/src/converse/prompts.ts
  • Division maps: components/agentic_search/src/converse/catalog-context.ts
  • Per-store maps: components/agentic_search/src/converse/custom-contexts/
  • Conversation starters: components/agentic_search/src/conversation-starters/conversation-starters.ts