File size: 4,151 Bytes
116524e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# How ACE Works

**Agentic Context Engineering (ACE)** enables AI agents to learn from their own execution feedback. Instead of updating model weights (expensive, slow, opaque), ACE evolves a **skillbook** of strategies based on what actually works.

!!! info "Research"
    ACE was introduced in [*Agentic Context Engineering: Evolving Contexts for Self-Improving Language Models*](https://arxiv.org/abs/2510.04618) by researchers at Stanford University and SambaNova Systems.


## The Learning Loop

Three collaborative roles share the same base LLM:

```mermaid

graph LR

    S[Sample] --> A[Agent]

    A --> E[Environment]

    E -->|feedback| R[Reflector]

    R -->|analyzes| SM[SkillManager]

    SM -->|updates| SK[Skillbook]

    SK -.->|context| A

```

1. The **Agent** executes a task using strategies from the skillbook
2. The **Environment** evaluates the result (correct/incorrect, feedback)
3. The **Reflector** analyzes what worked and what failed
4. The **SkillManager** updates the skillbook with new strategies

The **Skillbook** accumulates strategies across runs, making every subsequent agent call smarter.

## Three Roles

| Role | Responsibility | Key Class |
|------|---------------|-----------|
| **Agent** | Executes tasks using skillbook strategies | `Agent` |
| **Reflector** | Analyzes execution results (what worked, what failed) | `Reflector` |
| **SkillManager** | Transforms reflections into skillbook updates | `SkillManager` |

All three roles use the same LLM — the intelligence comes from the specialized prompts each role receives.

See [Three Roles](roles.md) for details on each role's inputs and outputs.

## Two Architecture Patterns

### Full ACE Pipeline

Use when building a new agent from scratch.

```mermaid

graph LR

    S[Sample] --> A[Agent]

    A --> E[Environment]

    E --> R[Reflector]

    R --> SM[SkillManager]

    SM --> SK[Skillbook]

```

All three roles participate. The Agent produces answers, the Environment evaluates them, and the learning pipeline updates the skillbook.

```python

from ace import ACE, Agent, Reflector, SkillManager, SimpleEnvironment



runner = ACE.from_roles(

    agent=Agent("gpt-4o-mini"),

    reflector=Reflector("gpt-4o-mini"),

    skill_manager=SkillManager("gpt-4o-mini"),

    environment=SimpleEnvironment(),

)

results = runner.run(samples, epochs=3)

```

### Integration Pattern

Use when wrapping an existing agent (browser-use, LangChain, Claude Code).

```mermaid

graph LR

    EA[External Agent] -->|executes| R[Reflector]

    R -->|analyzes trace| SM[SkillManager]

    SM -->|updates| SK[Skillbook]

```

No ACE Agent — the external framework handles execution. ACE only learns from the results.

Three steps: **INJECT** skillbook context, **EXECUTE** with external agent, **LEARN** from results.

```python

from ace import BrowserUse



runner = BrowserUse.from_model(

    browser_llm=ChatOpenAI(model="gpt-4o"),

    ace_model="gpt-4o-mini",

)

results = runner.run("Find the top post on Hacker News")

```

See [Integration Pattern](../guides/integration.md) for building custom integrations.

## How It Compares

| Approach | Updates | Speed | Interpretability |
|----------|---------|-------|-----------------|
| **Fine-tuning** | Model weights | Slow (hours) | Low (opaque) |
| **RAG** | External documents | Medium | Medium |
| **ACE** | Skillbook context | Fast (real-time) | High (readable strategies) |

ACE strategies are human-readable, auditable, and transferable between models.

## Performance

| Benchmark | Improvement | Notes |
|-----------|-------------|-------|
| AppWorld Agent | **+17.1 pp** | Complex multi-step tasks with tool use |
| FiNER (Finance) | **+8.6 pp** | Financial reasoning tasks |
| Adaptation Latency | **-86.9%** | vs. existing context-adaptation methods |

## What to Read Next

- [The Skillbook](skillbook.md) — how strategies are stored and evolve
- [Three Roles](roles.md) — Agent, Reflector, and SkillManager in detail
- [Quick Start](../getting-started/quick-start.md) — run your first agent