logo
Agentic Context Engineering (ACE) in RAG Pipelines: How Can AI Systems Improve Autonomously in Operation?

November 16, 2026


Author: Marina Baumgartner, Data Scientist at msg life
Read the original German version here

Executive Summary

A curated knowledge base is essential for the successful deployment of AI agents. But how can agentic AI systems continue to improve autonomously while in operation? This question was the focus of our joint project with the Technical University of Munich (TUM) on “Agentic Context Engineering (ACE) in RAG Pipelines.” The findings show that ACE provides a structured approach to integrating and managing learning processes in AI systems. In the long term, this represents an important step toward continuously learning AI assistants whose development remains transparent and traceable, particularly in light of regulatory requirements in the insurance industry.

How Can AI Systems Learn and Improve During Operation?

A growing number of companies are deploying AI agents that can independently plan and execute complex, multi-step workflows. A well-maintained, curated knowledge base is essential for their success. But how can these agents expand that knowledge and learn from new experience while performing their tasks? With msg.ask:it, we have developed a successful agent-based knowledge platform that delivers high-quality, reliable information and gives convenient access to technical documentation, regulatory frameworks, and internal knowledge resources in the insurance industry. For an agentic AI system such as msg.ask:it to deliver lasting value to an organization, it must evolve and improve over time. Large language models (LLMs) are highly capable, but they remain static in day-to-day operation. Established approaches such as manual prompt engineering, retrieval-augmented generation (RAG), and agentic systems address important aspects of this challenge, but on their own they do not enable AI systems to learn autonomously.

Joint Project with the Technical University of Munich: ACE in a RAG Pipeline

How can an AI system learn from its own mistakes in operation, without retraining the underlying model or manually adjusting its prompts? This was the central question of a joint project between msg life and the Munich Data Science Institute (MDSI) at the Technical University of Munich. As part of the TUM Data Innovation Lab, students developed a prototype implementation of Agentic Context Engineering (ACE) within a RAG pipeline. Rather than optimizing model weights, ACE improves the context in which a model or agent operates. Successful strategies, common errors, and effective problem-solving approaches are recorded in a text-based playbook, which serves as a working guide and is refined progressively over time.

ACE Replaces Static Prompting with an Evolving, Text-Based Playbook

Instead of relying on static system prompts, ACE uses a self-improving playbook [1]. The playbook continuously collects and refines proven strategies, so that existing domain knowledge is expanded over time. The approach also systematically incorporates both human and machine-generated feedback, which helps prevent recurring errors and supports sustained improvement:

  • The playbook grows as the system completes additional tasks.
  • It is human-readable, so its contents are transparent and easy to review.
  • It highlights areas where agents repeatedly struggle.

To achieve this, the ACE framework uses three specialized agents:

  • Generator: Solves tasks using the playbook, which is initially empty, and produces detailed logs of the steps taken and the reasoning followed (reasoning trajectories). These make decisions and results traceable.
  • Reflector: Analyzes the outcomes, the available feedback signals, and the reasoning trajectories to identify successful strategies and recurring errors.
  • Curator: Distills these findings into concise updates, ensuring that new knowledge is incorporated into the playbook in a structured and lasting way.

The result is an evolving context that lets the AI system improve incrementally through experience.

Experimental Setup: Comparing Three Approaches

The students applied this methodology to a dataset of question-and-answer pairs. The agent had to answer the questions using information retrieved from Wikipedia articles through a RAG pipeline. The agent had access to several search tools and had to decide independently which search strategies to use, when to use them, and how often to search. The questions were deliberately designed to require complex, multi-step reasoning rather than a single search query. This type of task is known as multi-hop reasoning [2]. To investigate whether ACE could improve performance on these complex retrieval tasks, the project compared three approaches:

  • Static Retrieval: A fixed search step that is executed identically before every request.
  • Agentic Retrieval: An agent that dynamically decides which search tools to use.
  • ACE Pipeline: The same agent, supplemented by a trained playbook in which successful search strategies and errors have been systematically recorded.
Key Findings from the Project

The project showed that a sophisticated approach such as ACE can be implemented successfully in a pipeline that mirrors real-world use cases. In particular, it showed that an AI system can learn from its own mistakes. On a second run, the agent, drawing on the expanded playbook, successfully answered questions it had failed to resolve on its first attempt. This demonstrates the potential for learning from experience without retraining the underlying models. The approach also reduced the need for manual prompt engineering. Instead of refining individual inputs and system prompts by hand, ACE establishes a clearly defined optimization process that makes improvements reproducible. However, given the limited scope of the project, the comparison of the three approaches does not support statistically significant conclusions about performance gains.
The results of the original ACE experiments give an indication of the approach’s potential. On the AppWorld benchmark, which evaluates complex agentic tasks, ACE improved performance by an average of 10.6 percentage points compared with the other methods evaluated in that study [3]. These findings suggest that an agent can become substantially more capable solely through systematic improvement of the context in which it operates. Because the original research used a different benchmark, its results cannot be transferred directly to the experimental setup of the TUM project. Nevertheless, they are consistent with our observation that a trained playbook can improve an agent’s problem-solving capabilities. Analyzing the strategies collected in the playbook also yielded valuable insights that improve the transparency and traceability of the overall AI system:

  • Complex queries and recurring errors became easier to identify.
  • Quality issues in the training data were detected.
  • Weaknesses in the design of the search tools and evaluation procedures were identified.

ACE therefore gives developers deeper insight into how their AI processes work and where potential weaknesses lie.

Conclusion

ACE is an important building block for the continued improvement of AI assistants:

  • From research to practice: Findings from the TUM Data Innovation Lab are directly informing the further development of our AI solutions, including msg.ask:it and other agentic systems for the insurance industry.
  • A structured approach to continuous learning: ACE provides a methodological framework for integrating and managing learning processes within AI systems.
  • Transparency and regulatory accountability: In the long term, ACE is an important step toward continuously learning AI assistants whose development remains traceable, particularly in light of regulatory requirements for insurers. Because the evolving playbook is human-readable, it can also be reviewed and audited.

The student project not only demonstrated how ACE can be implemented in a practical pipeline but also provided valuable guidance for its use in real-world insurance applications.
One potential application is straight-through processing of customer inquiries, where insights from actual processing errors and feedback can be used to develop domain-specific best practices. These, in turn, can make automated processing more robust and transparent.

References

[1] Q. Zhang, C. Hu, S. Upasani, B. Ma, F. Hong, V. Kamanuru, J. Rainton, C. Wu, M. Ji, H. Li, U. Thakker, J. Zou, and K. Olukotun, “Agentic Context Engineering: Evolving Contexts for Self-Improving Language Models,” 2025, arXiv:2510.04618.

[2] Xanh Ho et al. “Constructing a Multi-hop QA Dataset for Comprehensive Evaluation

of Reasoning Steps”. In: Proceedings of the 28th International Conference on

Computational Linguistics (COLING). 2020.

[3] Q. Zhang, C. Hu, S. Upasani, B. Ma, F. Hong, V. Kamanuru, J. Rainton, C. Wu, M. Ji, H. Li, U. Thakker, J. Zou, and K. Olukotun, “Agentic Context Engineering: Evolving Contexts for Self-Improving Language Models,” 2025, arXiv:2510.04618.