A framework that provides AI Agents with a persistent learning loop, enabling self-improvement from experience via strategy injection without fine-tuning or vector databases.
ACE (Agentic Context Engine) is an open-source framework that addresses the inability of AI Agents to learn persistently from experience. Its core mechanism distills success and failure patterns from Agent execution traces into reusable text strategies stored in a Skillbook, which are automatically retrieved via BM25 and injected into prompts for subsequent tasks — achieving behavioral improvement purely through in-context learning.
The learning loop is driven by three roles: the Agent executes tasks enhanced by strategies; the Reflector programmatically analyzes traces in a sandbox to extract insights; the SkillManager manages the strategy lifecycle with generalization gating and deduplication. Built on PydanticAI + LiteLLM, it supports 100+ LLM providers. The Pipeline engine is framework-agnostic, connecting steps via requires/provides contracts with immutable context and error isolation.
Multiple Runner adapters are provided (ACELiteLLM, ACE, TraceAnalyser, BrowserUse, LangChain, ClaudeCode), covering scenarios from simple Q&A to browser automation and code migration. Achieves 2× pass⁴ consistency on τ2-bench and ~49% token reduction in browser automation. MIT licensed, Python >= 3.12, currently in Beta (v0.12.0). Kayba.ai also offers a hosted SaaS solution.
Install: uv add ace-framework
Quick start:
from ace import ACELiteLLM
agent = ACELiteLLM(model="gpt-4o-mini")
answer = agent.ask("Is there a seahorse emoji?")
agent.learn_from_feedback("There is no seahorse emoji in Unicode.")
answer = agent.ask("Is there a seahorse emoji?") # strategy applied
print(agent.get_strategies())
Optional extras: browser-use, langchain, logfire, mcp, deduplication, all.
CLI commands: ace setup (interactive config), ace models <query> (search models), ace validate <model> (test connection), ace config (show config), ace-mcp (MCP server).
Unconfirmed: specific ACE paper arXiv/DOI link, PyPI page URL, public docs site URL, "Dynamic Cheatsheet" source.