# Agentic Context Engine The Agentic Context Engine (ACE) is an open-source ([[Apache 2.0 License]]) framework from Kayba AI that lets [[AI Agents]] learn from experience across sessions, without fine-tuning or an external vector database. The premise: agents normally repeat the same mistakes every session, forget what worked, and ignore what failed. ACE fixes this by accumulating reusable strategies in a persistent "Skillbook", making it a concrete implementation of [[Context Engineering]]. ## How It Works A three-role learning loop: - **Agent**: executes tasks, augmented with learned strategies - **Reflector**: analyzes execution traces to extract what worked and what failed - **SkillManager**: curates the Skillbook: adds, refines, and removes strategies The Skillbook is the evolving store of strategies injected back into the agent's context. A **Recursive Reflector** writes and runs Python in a sandbox to programmatically search execution traces for patterns, rather than doing single-pass summarization. ## Foundations - Based on the ACE paper (Stanford & SambaNova) and the Dynamic Cheatsheet research - Learning happens in-context (strategies as text), not via weight updates, an alternative to fine-tuning and RL for agent improvement ## Technical Stack - Python; built on PydanticAI agents with structured-output validation - Routes through [[LiteLLM]] to 100+ LLM providers ([[OpenAI]], [[Anthropic]], Google, Bedrock, Groq, …) - Batteries-included `ACELiteLLM` class with `.ask()`, `.learn()`, `.save()` - Integrations: browser-use, [[LangChain]] wrapping, [[Claude Code]] CLI, and an [[Model Context Protocol (MCP)|MCP]] server ## Reported Results - Doubles pass^4 on the Tau2 airline benchmark using 15 learned strategies (no reward signals) - Cuts browser-automation costs nearly in half - ~$1.50 learning cost to translate 14,000 lines via Claude Code with zero build errors ## References - https://github.com/kayba-ai/agentic-context-engine - https://www.kayba.ai/ - https://x.com/KaybaAI - https://www.linkedin.com/company/kayba-ai/ ## Related - [[AI Agents]] - [[Context Engineering]] - [[Agentic Engineering]] - [[LiteLLM]] - [[LangChain]] - [[Claude Code]] - [[Model Context Protocol (MCP)]] - [[Large Language Models (LLMs)]] - [[Apache 2.0 License]]