Application of finite state machines as a control model in agent-based RAG systems for corporate knowledge bases: a systems approach and formalization
R.S. Rozum, A.S. Kuznetsov
Abstract. This research article, from a systems analysis perspective, examines in detail the application of finite automata theory as a control model in agent-based RAG systems for managing corporate knowledge bases. Key requirements for these systems in terms of accuracy, predictability, and controllability are outlined. The application of the finite automata method, which allows for the introduction of stable states into the system and the organization of control, is discussed. Practical examples of the application of finite automata in RAG systems are provided. A formalized description of the application of an FSM agent in corporate systems is created. An agent in the system is considered a controlled object, formalized as a finite automaton with a discrete set of states, taking into account environmental events and a formulated set of transition conditions. A mathematical model of the FSM agent, based on the mathematical function of describing sets, is presented. A diagram of the FSM-RAG system components is constructed, reflecting the architectural solution that can be used as a basis for implementation in corporate information systems. A visual diagram of the FSM-RAG state transitions is presented in the form of a transition graph. The framework and model presented in the article provide a foundation for the implementation of more robust agents. They will be verifiable and formalizable in a business environment.
Aim. The study is to formalize the process of managing an agent-based RAG system of a corporate knowledge based on a deterministic finite state machine and to develop a mathematical model of an FSM agent as a control subsystem.
The research methodology includes methods of system analysis and synthesis, comparative analysis of formal control models, construction of a mathematical model of a Moore machine, architectural modeling and a state transition graph.
Results. A formal model of an FSM agent for a RAG system was proposed; an FSM-RAG architecture was developed with the identification of states, events, and transition functions; a component diagram and state graph were constructed; and the applicability of the model to corporate knowledge bases with unstructured data was demonstrated.
Conclusions. Using a deterministic finite state machine as a control model improves the predictability, observability, and formal verifiability of RAG system behavior; provides controlled multi-stage request processing; enables scenario termination and algorithm complexity analysis; creates the basis for implementing controlled RAG agents in corporate information systems.
Keywords: finite state machine method, control models, large language models, agent-based systems, knowledge bases, systems approach, formalization
For citation. Rozum R.S., Kuznetsov A.S. Application of finite state machines as a control model in agent-based RAG systems for corporate knowledge bases: a systems approach and formalization. News of the Kabardino-Balkarian Scientific Center of RAS. 2026. Vol. 28. No. 2. Pp. 11–24. DOI: 10.35330/1991-6639-2026-28-2-11-24
© Rozum R.S., Kuznetsov A.S., 2026

Content is available under license Creative Commons Attribution 4.0 License
References
- Namiot D.E., Eugene E.A. On cyber risks of generative artificial intelligence. International Journal of Open Information Technologies. 2024. Vol. 12. No. 10. 109–119. EDN:JZCUQS. (In Russian)
- Namiot D.E., Ilyushin E.A. Architecture of LLM agents. International Journal of Open Information Technologies. 2025. Vol. 13. No. 1. Pp. 67–74. EDN: VIMKYB. (In Russian)
- FSM Group Chat – User-specified agent transitions. https://microsoft.github.io/autogen/0.2/blog/2024/02/11/FSM-GroupChat (accessed: 13/11/2025)
- Nesterov L.A. Methods for synthesis and analysis of discrete finite automata. Resour. Technol. 2001. No. 3. URL: https://cyberleninka.ru/article/n/metody-sinteza-i-analiza-diskretnyhkonechnyh-avtomatov (accessed: 11/13/2025). (In Russian)
- Can large language models help developers with robotic finite state machine modification. https://arxiv.org/html/2412.05625v1 (accessed: 13/11/2025)
- Kupriyanovsky V.P., Alenkov V.V., Sokolov I.A. et al. Smart infrastructure, physical and information assets, Smart Cities, BIM, GIS and IoT. International Journal of Open Information Technologies. 2017. Vol. 5. No. 10. Pp. 55–86. EDN: ZISODV. (In Russian)
- Youssef Maklad, Fares Wael, Wael Elsersy, Ali Hamdi. Retrieval augmented generation based LLM evaluation for protocol state machine inference with chain-of-thought reasoning. https://arxiv.org/abs/2502.15727 (accessed: 13/11/2025)
- MetaAgent: Automatically constructing Multi-Agent Systems based on finite state machines. https://arxiv.org/abs/2507.22606 (accessed: 13/11/2025)
- What OpenAI ChatGPT Pro Means for AI Agents and Agentic AI. https://www.teneo.ai/blog/what-openai-chatgpt-pro-means-for-ai-agents-and-agentic-ai Retrieved: Dec, 2024
- Rozum R.S., Kuznetsov A.S. A systems approach to assessing the effectiveness of clustering methods and their software implementations. Reflection. 2025. No. 2. Pp. 87–91. EDN: XASNUX. (In Russian)
- Rozum R.S., Kuznetsov A.S. Architecture of an automated information system for processing and semantic analysis of requests to real-time service systems. Trends in the Development of Science and Education. 2024. No. 115–15. Pp. 101–107. DOI: 10.18411/trnio-11-2024-709. EDN: DOSWGC. (In Russian)
- Kuznetsov A.S. Informatsionnoye modelirovaniye ob”yektov, protsessov i sistem: printsipy formalizatsii, klassifikatsii i verifikatsii [Information modeling of objects, processes and systems: principles of formalization, classification and verification: monograph]. St. Petersburg: Scientia, 106 p. ISBN-13 (15) 978-5-907902-76-3. (In Russian)
Information about the authors
Roman S. Rozum, Postgraduate Student, Department of Information Technology, Artificial Intelligence and Public and Social Technologies of the Digital Society, Russian State Social University;
4, Wilhelm Pieck street, building 1, Moscow, 129226, Russia;
romanrozum@yandex.ru, ORCID: https://orcid.org/0000-0002-2276-842X, SPIN-code: 2190-5760
Andrey S. Kuznetsov, Candidate of Engineering Sciences, Associate Professor, Associate Professor of the Department of Information Technologies, Artificial Intelligence and Social Technologies of Digital Society, Russian State Social University;
4, Wilhelm Pieck street, building 1, Moscow, 129226, Russia;
askgoogle@internet.ru, ORCID: https://orcid.org/0000-0003-1569-4765, SPIN-code: 8442-7210
Funding
The study was performed without external funding.











