# Interface IFeedbackIntegration

Interface for feedback integration.

interface IFeedbackIntegration {
recordRoutingDecision(
decision: CompositeRoutingDecision,
traceId?: string,
): string;
recordStepOutcome(
routingDecisionId: string,
stepResult: StepResult,
durationMs: number,
tokenUsage: number,
): void;
recordOutcome(params: RecordOutcomeParams): void;
getStats(): FeedbackLoopStats;
onOutcomeProcessed(callback: OutcomeProcessedCallback): () => void;
registerCompositeRouter(router: ICompositeRouter): void;
reset(): void;
evictStaleEntries(): number;
getEvictedEntryCount(): number;
getDecisionMapSize(): number;
}

#### Implemented by

- FeedbackIntegration

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

##### Index

### Methods

recordRoutingDecision
recordStepOutcome
recordOutcome
getStats
onOutcomeProcessed
registerCompositeRouter
reset
evictStaleEntries
getEvictedEntryCount
getDecisionMapSize

## Methods

### recordRoutingDecision

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

  Record a routing decision from CompositeRouter

  #### Parameters

  - decision: CompositeRoutingDecision
  - `Optional` traceId: string

  #### Returns string

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

### 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

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

### recordOutcome

- recordOutcome(params: RecordOutcomeParams): void

  Record a generic task outcome

  #### Parameters

  - params: RecordOutcomeParams

  #### Returns void

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

### getStats

- getStats(): FeedbackLoopStats

  Get feedback statistics

  #### Returns FeedbackLoopStats

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

### onOutcomeProcessed

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

  Subscribe to outcome processed events

  #### Parameters

  - callback: OutcomeProcessedCallback

  #### Returns () => void

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

### registerCompositeRouter

- registerCompositeRouter(router: ICompositeRouter): void

  Register CompositeRouter for bi-directional feedback

  #### Parameters

  - router: ICompositeRouter

  #### Returns void

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

### reset

- reset(): void

  Reset all collected data

  #### Returns void

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

### evictStaleEntries

- evictStaleEntries(): number

  Evict stale entries from decision map that exceed TTL

  #### Returns number

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

### getEvictedEntryCount

- getEvictedEntryCount(): number

  Get total count of evicted entries since creation or last reset

  #### Returns number

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

### getDecisionMapSize

- getDecisionMapSize(): number

  Get current size of decision map

  #### Returns number

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