ACEOptimizer
Agentic Context Engineering optimizer: improves an agent by curating an ACEPlaybook of bullet insights instead of editing its prompt directly.
For each training item the agent is run and its full trajectory captured; a reflector LLM diagnoses the trajectory into TrajectoryInsights (also tagging which existing bullets helped or hurt), and a curator LLM turns those insights into DeltaUpdates that grow and refine the playbook. The resulting playbook is injected into the agent's system prompt at run time via ACEPlaybookFeature.
Early implementation. This is a non-official re-implementation that deviates from the original ACE algorithm (https://arxiv.org/abs/2510.04618) and may underperform the paper. Validate on your own task before relying on it; closing the gap is future work.
Parameters
Where the optimized ACEPlaybook is read from and written to.
How to handle a playbook already present at playbookStoragePath; see OnExistingPlaybookAction.
Model used to diagnose trajectories into insights.
Model used to convert insights into playbook deltas.
Extracts the ground-truth label string for a dataset item, fed to the reflector.
Constructors
Types
Structured curator output: the playbook mutations derived from a batch of reflector insights.
A single playbook mutation as returned by the curator LLM, convertible to a DeltaUpdate via toDeltaUpdate.
Structured reflector output: the TrajectoryInsights diagnosed from a single agent trajectory.
A single diagnosis of an agent trajectory produced by the reflector.
Functions
Trains the agent using the provided session, which gives access to a TrainingSession.use block where the training scope (agent, dataset, tracked execution methods) is available.