AxACE
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/dsp/optimizers/ace.ts#L139
AxACE implements the Agentic Context Engineering loop (Generator → Reflector → Curator). The implementation mirrors the paper’s architecture while integrating with the Ax optimizer ergonomics (unified optimized program artifacts, metrics, and checkpointing).
Extends
Constructors
Constructor
new AxACE(args: Readonly<AxOptimizerArgs>, options?: Readonly<AxACEOptions>): AxACE;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/dsp/optimizers/ace.ts#L151
Parameters
| Parameter | Type |
|---|---|
args | Readonly<AxOptimizerArgs> |
options? | Readonly<AxACEOptions> |
Returns
AxACE
Overrides
Methods
applyOnlineUpdate()
applyOnlineUpdate(args: Readonly<{
example: AxExample;
feedback?: string;
prediction: unknown;
}>): Promise<undefined | AxACECuratorOutput>;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/dsp/optimizers/ace.ts#L454
Apply ACE updates after each online inference. Mirrors the online adaptation flow described in the paper; can be called by user-land code between queries.
Parameters
| Parameter | Type |
|---|---|
args | Readonly<{ example: AxExample; feedback?: string; prediction: unknown; }> |
Returns
Promise<undefined | AxACECuratorOutput>
compile()
compile<IN, OUT>(
program: Readonly<AxGen<IN, OUT>>,
examples: readonly AxTypedExample<IN>[],
metricFn: AxMetricFn,
options?: AxACECompileOptions): Promise<AxACEResult<OUT>>;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/dsp/optimizers/ace.ts#L195
Abstract method that must be implemented by concrete optimizers
Type Parameters
| Type Parameter |
|---|
IN |
OUT extends AxGenOut |
Parameters
| Parameter | Type |
|---|---|
program | Readonly<AxGen<IN, OUT>> |
examples | readonly AxTypedExample<IN>[] |
metricFn | AxMetricFn |
options? | AxACECompileOptions |
Returns
Promise<AxACEResult<OUT>>
Overrides
compilePareto()
compilePareto<IN, OUT>(
program: Readonly<AxGen<IN, OUT>>,
examples: readonly AxTypedExample<IN>[],
metricFn: AxMultiMetricFn,
options?: AxCompileOptions): Promise<AxParetoResult<OUT>>;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/dsp/optimizer.ts#L1561
Multi-objective optimization using Pareto frontier Default implementation that leverages the single-objective compile method
Type Parameters
| Type Parameter |
|---|
IN |
OUT extends AxGenOut |
Parameters
| Parameter | Type | Description |
|---|---|---|
program | Readonly<AxGen<IN, OUT>> | The program to optimize |
examples | readonly AxTypedExample<IN>[] | Training examples |
metricFn | AxMultiMetricFn | Multi-objective metric function that returns multiple scores |
options? | AxCompileOptions | Optional configuration options |
Returns
Promise<AxParetoResult<OUT>>
Pareto optimization result with frontier of non-dominated solutions
Inherited from
compileStream()
compileStream<IN, OUT>(
program: Readonly<AxGen<IN, OUT>>,
examples: readonly AxTypedExample<IN>[],
metricFn: AxMetricFn,
options?: AxCompileOptions): AsyncIterableIterator<AxOptimizationProgress>;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/dsp/optimizer.ts#L1448
Optimize a program with real-time streaming updates
Type Parameters
| Type Parameter |
|---|
IN |
OUT extends AxGenOut |
Parameters
| Parameter | Type | Description |
|---|---|---|
program | Readonly<AxGen<IN, OUT>> | The program to optimize |
examples | readonly AxTypedExample<IN>[] | Training examples |
metricFn | AxMetricFn | Evaluation metric function |
options? | AxCompileOptions | Optional configuration options |
Returns
AsyncIterableIterator<AxOptimizationProgress>
Async iterator yielding optimization progress
Inherited from
configureAuto()
configureAuto(level: "light" | "medium" | "heavy"): void;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/dsp/optimizers/ace.ts#L178
Parameters
| Parameter | Type |
|---|---|
level | "light" | "medium" | "heavy" |
Returns
void
getStats()
getStats(): AxOptimizationStats;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/dsp/optimizer.ts#L2494
Get current optimization statistics
Returns
Current optimization statistics
Inherited from
reset()
reset(): void;
Defined in: https://github.com/ax-llm/ax/blob/d2df625e2c2fd70a090d6321c042579c2819f0d1/src/ax/dsp/optimizers/ace.ts#L168
Reset optimizer state for reuse with different programs
Returns
void