Skip to content

Interface: KBOptimizationConfig

@kortexya/reasoninglayer


@kortexya/reasoninglayer / KBOptimizationConfig

Defined in: src/types/optimize.ts:231

Configuration for KB-driven LP optimization.

Queries the knowledge base to discover decision variables and their coefficients, then solves the resulting LP problem automatically.

const result = await client.optimize.fromKnowledgeBase({
variables: { sort: 'product', nameFeature: 'name' },
objective: { direction: 'maximize', coefficientFeature: 'profit' },
resourceConstraints: [
{ costFeature: 'wood_cost', capacity: 12, label: 'wood' },
{ costFeature: 'labor_cost', capacity: 8, label: 'labor' },
],
nonNegative: true,
});

optional additionalConstraints?: LinearConstraint[]

Defined in: src/types/optimize.ts:246

Additional explicit constraints to add beyond those discovered from the KB.


optional nonNegative?: boolean

Defined in: src/types/optimize.ts:244

Whether all variables must be non-negative (default: false).


objective: object

Defined in: src/types/optimize.ts:235

Objective function configuration.

coefficientFeature: string

Feature name on variable terms containing the objective coefficient.

direction: OptimizationDirection

Optimization direction.


resourceConstraints: KBResourceConstraint[]

Defined in: src/types/optimize.ts:242

Resource constraints derived from variable term features.


variables: KBVariableSpec

Defined in: src/types/optimize.ts:233

How to discover decision variables from the knowledge base.