Skip to content

Interface: KBOptimizationConfig

@kortexya/reasoninglayer


@kortexya/reasoninglayer / Optimize / KBOptimizationConfig

Interface: KBOptimizationConfig

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

Configuration for KB-driven LP optimization.

Remarks

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

Example

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,
});

Properties

additionalConstraints?

optional additionalConstraints: LinearConstraint[]

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

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


nonNegative?

optional nonNegative: boolean

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

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


objective

objective: object

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

Objective function configuration.

coefficientFeature

coefficientFeature: string

Feature name on variable terms containing the objective coefficient.

direction

direction: OptimizationDirection

Optimization direction.


resourceConstraints

resourceConstraints: KBResourceConstraint[]

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

Resource constraints derived from variable term features.


variables

variables: KBVariableSpec

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

How to discover decision variables from the knowledge base.