Skip to content
rrahimi-uci edited this page Jun 30, 2026 · 2 revisions

ACE — Agentic Context Engineering

Evolving, self-improving context playbooks for LLM agents.

ACE is a clean, dependency-light, fully tested implementation of the ICLR 2026 paper "Agentic Context Engineering: Evolving Contexts for Self-Improving Language Models", with first-class OpenAI Agents SDK support.

Stop re-prompting. Let your agent write its own playbook from experience.


The idea in one paragraph

LLM agents increasingly improve through context adaptation — editing their inputs (instructions, strategies, evidence) instead of their weights. Two common approaches fail: prompt optimizers suffer brevity bias (they collapse to short, generic instructions and discard hard-won detail), and letting an LLM rewrite the whole context every step causes context collapse (a lossy summary that craters accuracy). ACE fixes both by treating context as an evolving playbook of small, itemized bullets that accumulate, refine, and organize over time — via a modular Generator → Reflector → Curator loop with incremental delta updates and a deterministic grow-and-refine step.


Wiki contents

Page What's on it
Quickstart Install, run the headline demo (no API key), 10-line Python example
How It Works The Generator/Reflector/Curator loop, deltas, grow-and-refine, offline vs. online
Architecture Full diagram set, data model, module map, runtime data flow
OpenAI Agents SDK wrap_agent / ACEAgent: drop-in self-improving memory
Custom Tasks and Feedback Bring your own Task and label-free feedback_fn
Cookbook 10 short, runnable recipes (7 need no API key)
Configuration ACEConfig knobs, backends, embedders, curation modes
Results Reproducible offline numbers + paper benchmarks
FAQ Design decisions, when ACE is (and isn't) worth it
Glossary Key terms in one place

At a glance

Prompt optimizers (GEPA, MIPRO) Monolithic memory (full rewrite) ACE
Keeps domain detail ❌ brevity bias ⚠️ erodes over time ✅ accumulates
Survives long horizons ⚠️ ❌ context collapse ✅ incremental deltas
Update cost 🐢 full re-optimization 🐢 full re-ingest each step ⚡ tiny deltas, non-LLM merge
Works without labels ⚠️ ✅ execution feedback
Interpretable / editable ⚠️ ⚠️ ✅ inspectable bullets

Links

This repository is an independent, open-source reproduction for research and educational use. All credit for the ACE method belongs to the original authors.

Clone this wiki locally