Skip to content

Interface: TemporalPlanRequest

@kortexya/reasoninglayer


@kortexya/reasoninglayer / TemporalPlanRequest

Defined in: src/types/reasoning.ts:373

Request for temporal planning with diversity constraints.

Selects a diverse set of terms from a sort, optionally using fuzzy scoring, proximity optimization, and field-based uniqueness constraints.

optional distanceMetric?: string | null

Defined in: src/types/reasoning.ts:387

Distance metric for proximity optimization.

Determines how distance between field values is computed:

  • "categorical" (default): exact string match (0.0 = same, 1.0 = different). Suitable for cuisine types, categories, or any discrete field.
  • "geographical": haversine GPS distance. Expects groupByField values to be "latitude,longitude" strings (e.g., "37.7749,-122.4194"). Normalised by maxDistanceKm (default 100 km).
  • "temporal": time difference in minutes.

When absent or null, defaults to "categorical" for backward compatibility.


optional fuzzyQuery?: QueryTerm | null

Defined in: src/types/reasoning.ts:392

Optional fuzzy query for automatic top-k scoring. If provided, performs fuzzy matching against all candidates and uses similarity scores.


optional groupByField?: string | null

Defined in: src/types/reasoning.ts:394

Optional field to group by for proximity optimization (e.g., “gps_location”).


optional maxDistanceKm?: number | null

Defined in: src/types/reasoning.ts:401

Maximum distance in kilometres for geographical distance normalisation.

Only used when distanceMetric is "geographical". Default: 100.0 (typical metropolitan area).


optional minDegree?: number | null

Defined in: src/types/reasoning.ts:403

Minimum similarity degree for fuzzy query (default: 0.0).


optional noRepeatFields?: string[] | null

Defined in: src/types/reasoning.ts:410

Optional fields that must have unique values across selections (e.g., [“cuisine”]). When empty or not provided, the plan has no diversity objective and the response carries no diversityScore. A plan never selects the same term twice, with or without this field.


numSelections: number

Defined in: src/types/reasoning.ts:415

Number of terms to select (e.g., 7 for weekly plan). More than the candidate pool holds is refused with 400.


optional proximityWeight?: number | null

Defined in: src/types/reasoning.ts:417

Weight for proximity optimization (0.0-1.0, default: 0.0 = no proximity).


optional sequenceByField?: string | null

Defined in: src/types/reasoning.ts:422

Optional field to sort results by (e.g., “prep_time” for ascending order). When provided, the selected terms will be ordered by this field’s value.


sortId: string

Defined in: src/types/reasoning.ts:424

Sort ID to select terms from (UUID).


optional topK?: Record<string, number> | null

Defined in: src/types/reasoning.ts:429

Optional quality scores for top-k selection (term_id to score mapping). When provided, selects highest-quality diverse candidates.