# Interface IAbTestTracker

A/B test tracker interface.

interface IAbTestTracker {
createExperiment(
definition: Omit<
ExperimentDefinition,
"status"
| "startedAt"
| "endedAt",
>,
): ExperimentDefinition;
startExperiment(experimentId: string): void;
pauseExperiment(experimentId: string): void;
completeExperiment(experimentId: string): void;
assignVariant(
experimentId: string,
traceId: string,
): ExperimentVariant | null;
recordOutcome(outcome: ExperimentOutcome): void;
getSummary(experimentId: string): ExperimentSummary | null;
listExperiments(
filter?: { status?: ExperimentStatus; tags?: readonly string[] },
): readonly ExperimentDefinition[];
getExperiment(experimentId: string): ExperimentDefinition | null;
exportData(): ExperimentExport;
}

#### Implemented by

- AbTestTracker

- Defined in packages/nexus-agents/src/learning/ab-test-types.ts:127

##### Index

### Methods

createExperiment
startExperiment
pauseExperiment
completeExperiment
assignVariant
recordOutcome
getSummary
listExperiments
getExperiment
exportData

## Methods

### createExperiment

- createExperiment(
  definition: Omit<
  ExperimentDefinition,
  "status"
  | "startedAt"
  | "endedAt",
  >,
  ): ExperimentDefinition

  Create a new experiment.

  #### Parameters

  - definition: Omit<ExperimentDefinition, "status" | "startedAt" | "endedAt">

  #### Returns ExperimentDefinition

  - Defined in packages/nexus-agents/src/learning/ab-test-types.ts:131

### startExperiment

- startExperiment(experimentId: string): void

  Start an experiment (sets status to running).

  #### Parameters

  - experimentId: string

  #### Returns void

  - Defined in packages/nexus-agents/src/learning/ab-test-types.ts:138

### pauseExperiment

- pauseExperiment(experimentId: string): void

  Pause a running experiment.

  #### Parameters

  - experimentId: string

  #### Returns void

  - Defined in packages/nexus-agents/src/learning/ab-test-types.ts:143

### completeExperiment

- completeExperiment(experimentId: string): void

  Complete an experiment.

  #### Parameters

  - experimentId: string

  #### Returns void

  - Defined in packages/nexus-agents/src/learning/ab-test-types.ts:148

### assignVariant

- assignVariant(experimentId: string, traceId: string): ExperimentVariant | null

  Assign a variant for a given trace ID (deterministic assignment).

  #### Parameters

  - experimentId: string
  - traceId: string

  #### Returns ExperimentVariant | null

  - Defined in packages/nexus-agents/src/learning/ab-test-types.ts:153

### recordOutcome

- recordOutcome(outcome: ExperimentOutcome): void

  Record an outcome for an experiment.

  #### Parameters

  - outcome: ExperimentOutcome

  #### Returns void

  - Defined in packages/nexus-agents/src/learning/ab-test-types.ts:158

### getSummary

- getSummary(experimentId: string): ExperimentSummary | null

  Get experiment summary with statistics.

  #### Parameters

  - experimentId: string

  #### Returns ExperimentSummary | null

  - Defined in packages/nexus-agents/src/learning/ab-test-types.ts:163

### listExperiments

- listExperiments(
  filter?: { status?: ExperimentStatus; tags?: readonly string[] },
  ): readonly ExperimentDefinition[]

  List all experiments.

  #### Parameters

  - `Optional` filter: { status?: ExperimentStatus; tags?: readonly string[] }

  #### Returns readonly ExperimentDefinition[]

  - Defined in packages/nexus-agents/src/learning/ab-test-types.ts:168

### getExperiment

- getExperiment(experimentId: string): ExperimentDefinition | null

  Get experiment by ID.

  #### Parameters

  - experimentId: string

  #### Returns ExperimentDefinition | null

  - Defined in packages/nexus-agents/src/learning/ab-test-types.ts:176

### exportData

- exportData(): ExperimentExport

  Export all experiment data.

  #### Returns ExperimentExport

  - Defined in packages/nexus-agents/src/learning/ab-test-types.ts:181