# Class FeedbackIntegration

Learning exports - Closed-loop feedback and routing improvement Split from index.ts for file size compliance (Issue #285)

#### Implements

- IFeedbackIntegration

- Defined in packages/nexus-agents/src/learning/feedback-integration.ts:157

##### Index

### Constructors

constructor

### Methods

recordRoutingDecision
recordStepOutcome
recordOutcome
getStats
onOutcomeProcessed
registerCompositeRouter
reset
evictStaleEntries
getEvictedEntryCount
getDecisionMapSize

## Constructors

### constructor

- new FeedbackIntegration(
  config?: Partial<FeedbackIntegrationConfig>,
  collector?: OutcomeFeedbackCollector,
  ): FeedbackIntegration

  #### Parameters

  - `Optional` config: Partial<FeedbackIntegrationConfig>
  - `Optional` collector: OutcomeFeedbackCollector

  #### Returns FeedbackIntegration

  - Defined in packages/nexus-agents/src/learning/feedback-integration.ts:174

## Methods

### recordRoutingDecision

- recordRoutingDecision(
  decision: CompositeRoutingDecision,
  traceId?: string,
  ): string

  Record a routing decision from CompositeRouter

  #### Parameters

  - decision: CompositeRoutingDecision
  - `Optional` traceId: string

  #### Returns string

  Implementation of IFeedbackIntegration.recordRoutingDecision

  - Defined in packages/nexus-agents/src/learning/feedback-integration.ts:193

### recordStepOutcome

- recordStepOutcome(
  routingDecisionId: string,
  stepResult: StepResult,
  durationMs: number,
  tokenUsage: number,
  ): void

  Record a step outcome from workflow execution

  #### Parameters

  - routingDecisionId: string
  - stepResult: StepResult
  - durationMs: number
  - tokenUsage: number

  #### Returns void

  Implementation of IFeedbackIntegration.recordStepOutcome

  - Defined in packages/nexus-agents/src/learning/feedback-integration.ts:259

### recordOutcome

- recordOutcome(params: RecordOutcomeParams): void

  Record a generic task outcome

  #### Parameters

  - params: RecordOutcomeParams

  #### Returns void

  Implementation of IFeedbackIntegration.recordOutcome

  - Defined in packages/nexus-agents/src/learning/feedback-integration.ts:277

### getStats

- getStats(): FeedbackLoopStats

  Get feedback statistics

  #### Returns FeedbackLoopStats

  Implementation of IFeedbackIntegration.getStats

  - Defined in packages/nexus-agents/src/learning/feedback-integration.ts:363

### onOutcomeProcessed

- onOutcomeProcessed(callback: OutcomeProcessedCallback): () => void

  Subscribe to outcome processed events

  #### Parameters

  - callback: OutcomeProcessedCallback

  #### Returns () => void

  Implementation of IFeedbackIntegration.onOutcomeProcessed

  - Defined in packages/nexus-agents/src/learning/feedback-integration.ts:367

### registerCompositeRouter

- registerCompositeRouter(router: ICompositeRouter): void

  Register CompositeRouter for bi-directional feedback

  #### Parameters

  - router: ICompositeRouter

  #### Returns void

  Implementation of IFeedbackIntegration.registerCompositeRouter

  - Defined in packages/nexus-agents/src/learning/feedback-integration.ts:371

### reset

- reset(): void

  Reset all collected data

  #### Returns void

  Implementation of IFeedbackIntegration.reset

  - Defined in packages/nexus-agents/src/learning/feedback-integration.ts:376

### evictStaleEntries

- evictStaleEntries(): number

  Evicts stale entries from decisionMap that exceed the configured TTL. Called on every recordRoutingDecision (throttled) and on reset.

  #### Returns number

  Implementation of IFeedbackIntegration.evictStaleEntries

  - Defined in packages/nexus-agents/src/learning/feedback-integration.ts:388

### getEvictedEntryCount

- getEvictedEntryCount(): number

  Gets the total number of evicted entries since creation or last reset.

  #### Returns number

  Implementation of IFeedbackIntegration.getEvictedEntryCount

  - Defined in packages/nexus-agents/src/learning/feedback-integration.ts:416

### getDecisionMapSize

- getDecisionMapSize(): number

  Gets the current size of the decision map (for testing/monitoring).

  #### Returns number

  Implementation of IFeedbackIntegration.getDecisionMapSize

  - Defined in packages/nexus-agents/src/learning/feedback-integration.ts:423