Adaptive context management in RAG systems for personalized AI assistants

Keywords: Retrieval-Augmented Generation, Large Language Models, adaptive context management,, user personalization

Abstract

Relevance. The development of artificial intelligence systems based on large language models (LLMs) highlights the problem of effective dialogue context management, as conventional history storage mechanisms often lead to context overload and a reduction in response generation quality. This problem is particularly acute in Retrieval-Augmented Generation (RAG) systems, where dialogue memory is combined with dynamic retrieval of external knowledge, creating an additional burden on the model's limited context window. Existing approaches to context management do not provide an adaptive mechanism for dialogue context formation that accounts for individual user characteristics and domain specificity. Goal. Development and testing of an Adaptive Context Management System (ACMS) for personalized RAG assistants, which combines a sliding window of recent messages, compressed summaries of long-term history, and personalized knowledge retrieval from the database. Research methods. A microservice architecture has been developed, including an AI Orchestrator for coordinating the RAG process, a vector search service based on PostgreSQL with pgvector extension, and a central ACMS component for context management. The proposed approach synthesizes three strategies: sliding window to preserve the last N messages, LLM-based compression of old history fragments into thematic summaries, and a personalization layer for weighting relevance based on user vector profiles. Final context formation is performed through adaptive mixing of dialogue history and relevant knowledge from the database, taking into account individual user profiles. Results. The experimental evaluation demonstrated significant advantages of the adaptive system compared to the baseline approach. In pairwise comparisons, the adaptive system proved superior in 62% of cases (Answer Win-Rate = 0.62). The key factor for improvements was the personalization layer, which reduces repetitions and off-topic content from dialogue history, provides targeted amplification of relevant documents, and enables flexible regulation of the balance between history and knowledge. Conclusions. The developed adaptive context management system provides effective dialogue context management in RAG systems for personalized AI assistants. The integration of compression strategies, adaptive window, and user personalization enabled a 14% increase in response relevance and a 22% optimization of context volume. Experimental validation confirmed the practical feasibility of the proposed approach across different subject domains, as well as system scalability when working with large volumes of historical data.

Downloads

Download data is not yet available.

Author Biographies

Andrii Suprun, V.N. Karazin Kharkiv National University, Svobody Sq 4, Kharkiv, Ukraine, 61022

Master student

Nina Bakumenko, V.N. Karazin Kharkiv National University, Svobody Sq 4, Kharkiv, Ukraine, 61022

Associated Professor of Computer Systems and Robotics Department

References

/

References

Published
2025-12-22
How to Cite
Suprun, A., & Bakumenko, N. (2025). Adaptive context management in RAG systems for personalized AI assistants. Bulletin of V.N. Karazin Kharkiv National University, Series «Mathematical Modeling. Information Technology. Automated Control Systems», 68, 77-83. https://doi.org/10.26565/2304-6201-2025-68-08
Section
Статті