# Class StrategyDistiller

Distills outcome patterns into routing rules.

Subscribe to OutcomeFeedbackCollector.onOutcomeProcessed() and call onOutcome() for each processed outcome. Distillation triggers automatically every `triggerThreshold` outcomes.

#### Hierarchy (View Summary)

- StrategyDistiller
  - PersistentStrategyDistiller

- Defined in packages/nexus-agents/src/learning/strategy-distiller.ts:178

##### Index

### Constructors

constructor

### Methods

onOutcome
distill
getRules
getStats
promote
loadRules

## Constructors

### constructor

- new StrategyDistiller(
  outcomeStore: OutcomeStore,
  logger?: ILogger,
  config?: Partial<DistillerConfig>,
  ): StrategyDistiller

  #### Parameters

  - outcomeStore: OutcomeStore
  - `Optional` logger: ILogger
  - `Optional` config: Partial<DistillerConfig>

  #### Returns StrategyDistiller

  - Defined in packages/nexus-agents/src/learning/strategy-distiller.ts:186

## Methods

### onOutcome

- onOutcome(): void

  Called for each processed outcome. Triggers distillation at threshold.

  #### Returns void

  - Defined in packages/nexus-agents/src/learning/strategy-distiller.ts:193

### distill

- distill(): void

  Run distillation on current OutcomeStore data.

  #### Returns void

  - Defined in packages/nexus-agents/src/learning/strategy-distiller.ts:202

### getRules

- getRules(status?: RuleStatus): readonly DistilledRule[]

  Get rules filtered by status.

  #### Parameters

  - `Optional` status: RuleStatus

  #### Returns readonly DistilledRule[]

  - Defined in packages/nexus-agents/src/learning/strategy-distiller.ts:233

### getStats

- getStats(): DistillerStats

  Get distiller statistics.

  #### Returns DistillerStats

  - Defined in packages/nexus-agents/src/learning/strategy-distiller.ts:240

### promote

- promote(routingMemory: IRoutingMemory): number

  Promote high-confidence rules to RoutingMemory. Rules must be active, non-tainted, with sufficient observations and confidence.

  #### Parameters

  - routingMemory: IRoutingMemory

  #### Returns number

  - Defined in packages/nexus-agents/src/learning/strategy-distiller.ts:262

### `Protected` loadRules

- loadRules(rules: readonly DistilledRule[]): void

  Load pre-existing rules (e.g., from disk). Used by PersistentStrategyDistiller.

  #### Parameters

  - rules: readonly DistilledRule[]

  #### Returns void

  - Defined in packages/nexus-agents/src/learning/strategy-distiller.ts:291