Have you noticed:
LLMs are powerful, but when they do agent tasks, they often repeat the same mistakes—and what they learn today, they forget tomorrow?
Is there a way to make them continuously smarter without training model parameters, simply by writing better context? <<Agentic Context Engineering: Evolving Contexts for Self-Improving Language Models>>
This is exactly the problem ACE (Agentic Context Engineering) is meant to solve.
1. Background: Why Context Engineering Matters More Than Ever
Many companies and teams now use LLMs for:
- Automated agents (writing code, calling APIs, executing tasks)
- Vertical-domain assistants (finance/legal/healthcare)
- Multi-tool collaboration (RAG, databases, web pages, scripts, etc.)
But these systems generally share two pain points:
Pain Point A: Prompts Get Shorter and Emptier with Every Revision
Many prompt optimization methods lead to increasingly “generic” prompts:
“You are a professional assistant. Please reason carefully, step by step…”
It looks reasonable, but it doesn't help much with actual tasks. The authors call this brevity bias.
Pain Point B: Dynamic Context Rewrites Break Easily
Some methods rewrite the entire system prompt, and the result is:
- Detailed experience gets condensed away
- One update wipes out previously accumulated knowledge
- Performance drops right back to baseline
The authors call this context collapse.
2. ACE’s Core Idea: Treat Context as an Evolving Playbook
ACE doesn't treat context as “a prompt.” It treats it as something that can keep growing:
A playbook
The playbook isn't made of long essays. It's made of small, granular pieces of knowledge called bullets, for example:
- API pagination must use while True, not a hardcoded range(10)
- On a 401, refresh the token first
- What a certain field means in financial XBRL
Each bullet has:
id- content
- statistics: the number of times it was judged helpful/harmful
3. How ACE Works: A Three-Role Closed Loop for Model Self-Improvement
ACE is designed in a very engineering-minded way: it has the same LLM play three roles:
① Generator (executor)
- Reads the playbook
- Executes the task (writes code/calls APIs/reasons)
- Records which bullets it used (bullet_ids)
② Reflector (teacher)
After the task is done, the Reflector reviews what happened:
- Which step went wrong?
- Why was it wrong?
- What was the correct approach?
- What should be remembered this time?
And it labels the bullets used in this run:
- helpful / harmful / neutral
③ Curator (knowledge manager)
The Curator doesn't rewrite the whole playbook. It only makes incremental updates:
- Only writes “newly discovered lessons” as new bullets
- Appends them to the relevant section as ADD operations
- Avoids damaging old experience
4. Why ACE Works: The Key Is “Append Only, Don’t Rewrite”
ACE solves two big problems:
✅ Avoids brevity bias
Because it doesn't compress experience into a single sentence; it breaks it into many bullets.
The result: the context can be long, but every bullet is concrete and actionable.
✅ Avoids context collapse
Because it doesn't do one-size-fits-all rewrites; it grows incrementally.
It's like software engineering:
- You don't rewrite the entire system every time
- You keep submitting small patches + reviews
5. Grow-and-Refine: What If the Playbook Gets Too Long?
ACE also considers maintainability:
Grow
At the end of each task, add some bullets.
Refine
When the playbook gets too long:
- Use embedding similarity to merge duplicate bullets
- Downweight or delete entries with a high harmful count
It's like:
Experience keeps accumulating, but the “knowledge base” also gets cleaned up regularly
6. Results: Good Context Can Actually Narrow the Model Gap
The paper validates ACE on several tasks:
AppWorld (complex agent environment)
Using the open-source model DeepSeek-V3.1, ACE comes close to—and sometimes even beats—strong closed-source systems.
This suggests:
From an engineering perspective, “context + memory” can partially compensate for the model capability gap
Financial tasks (FiNER / Formula)
These tasks are highly sensitive to rule details, and ACE's long playbook is a particular advantage:
- Writes rules into the playbook round by round
- Clearly outperforms methods such as ICL / prompt search
7. Engineering Takeaways: ACE Is Really “Continuous Learning at the Context Level”
I think ACE is especially valuable for real-world engineering:
For enterprises: Turn production incidents into knowledge assets
Every time the model makes a mistake, that's actually a piece of “real data”:
- Error logs
- Tool-call records
- Unit test/environment feedback
ACE provides a mechanism to automatically turn these into usable playbook entries.
Over time:
The system gets more and more stable instead of repeating the same mistakes forever
For vertical domains: Long rules are more reliable than short prompts
Take finance/legal/healthcare, for example:
- Many rules
- Many exceptions
- Strict formats
None of this is suited to being compressed into a single “You are an expert.”
ACE's bullet-based knowledge is more like an “industry manual.”
8. Limitations: ACE Depends on Feedback Quality
ACE is not a silver bullet, and the paper explicitly points out:
- If there are no labels
- and no reliable execution feedback (for example, you don't even know whether the task was completed)
then the Reflector may “guess blindly,” and the Curator may write wrong lessons into the playbook:
Adaptation becomes “the more it learns, the worse it gets.”
So in real deployments, you have to take seriously:
- Unit tests/validators
- Automated evaluation signals
- Human review when necessary
9. One-Sentence Summary
ACE upgrades prompt engineering into a “closed loop of context engineering”:
Record experience in a playbook
Update experience through reflection
Maintain experience through refinement
Make LLM systems smarter with use, auditable, and rollback-friendly.