Skip to main content

ACE Patterns Guide

This guide documents how Aegis implements patterns from two breakthrough research papers:
  1. ACE Paper (Stanford/SambaNova): “Agentic Context Engineering” - treats contexts as evolving playbooks that accumulate strategies over time
  2. Anthropic’s Long-Running Agent Harnesses: Solving the multi-context-window problem for agents that work across sessions
Key Insight: Both papers demonstrate that structured, incremental context evolution dramatically outperforms static prompts or monolithic rewrites. ACE achieved +17.1% improvement on agent benchmarks.

The Problems These Patterns Solve

When an LLM rewrites its entire context, it can collapse valuable accumulated knowledge:
Aegis Solution: Incremental delta updates that never rewrite the full context.
Prompt optimizers compress away domain-specific heuristics for “concise” instructions, losing critical task-specific knowledge.Aegis Solution: Memory types (reflection, strategy) that preserve detailed insights.
Agents declare tasks complete without proper verification.Aegis Solution: Feature tracking with explicit pass/fail status.
Each new context window starts fresh with no memory of previous work.Aegis Solution: Session progress tracking that persists between context windows.

Pattern 1: Memory Voting

ACE’s key insight: track which memories were helpful vs harmful for completing tasks.

Why It Works

Memories with positive effectiveness scores consistently improve task performance. By voting on memories, agents learn what strategies actually work.

Querying by Effectiveness

Pattern 2: Incremental Delta Updates

ACE’s breakthrough: never rewrite the full context. Use atomic, localized updates.

Why It Works

Monolithic rewrites cause “context collapse.” Delta updates:
  • Only modify what needs to change
  • Preserve accumulated knowledge
  • Enable parallel updates
  • Reduce latency by 86.9%

Pattern 3: Reflection Memories

Extract actionable insights from task trajectories.

Pattern 4: Session Progress Tracking

Anthropic’s claude-progress.txt pattern, structured and queryable.

Pattern 5: Feature Tracking

Prevent premature victory with explicit verification.

Pattern 6: ACE Run Tracking

Track agent runs end-to-end and automatically feed outcomes back into the memory system.

Why It Works

Without run tracking, there’s no feedback loop. Memories get voted on manually (if at all), and agents keep making the same mistakes. Run tracking closes the loop automatically: memories used in successful runs get reinforced, and failures generate reflections.

Pattern 7: Curation Cycle

Periodically clean up your memory playbook by promoting effective entries, flagging harmful ones, and identifying duplicates.

Semantic consolidation (real merge)

Beyond surfacing candidates, Aegis can merge embedding-similar memories via POST /memories/ace/consolidate (SDK: client.consolidate_memories(...)). This is a real merge, not prefix matching: the higher-effectiveness memory is kept, the other is soft-deprecated (is_deprecated=True, superseded_by set) and a memories_consolidated event is emitted.
The endpoint accepts a use_llm flag, but LLM-assisted merging is not configured in the open-source distribution — passing use_llm=true returns HTTP 501. The heuristic (non-LLM) consolidation above is fully supported.

Performance Impact

Based on the ACE paper’s benchmarks:

Quick Reference

Memory Types

ACE Loop Endpoints

Effectiveness Score

References

  1. ACE Paper: Zhang et al. “Agentic Context Engineering” (arXiv:2510.04618, Oct 2025)
  2. Anthropic Blog: “Effective Harnesses for Long-Running Agents” (2025)