On one Approach to Building a Temporal Model of the Knowledge Base Volodymyr Burdaieva a Simon Kuznets Kharkiv National University of Economics, Nauky av. 9-A, Kharkiv, 61166, Ukraine Abstract The paper discusses the dynamic rules of the knowledge base for expert systems on the idea of bundles the knowledge base. The concept of constructing knowledge base models based on a hierarchical functional system and its implementation for integrating chat bots with expert systems is investigated. The properties of a hierarchical functional system are analyzed: connectivity (filtration of knowledge bases), complexity (hierarchy of levels of local knowledge bases), stability (adaptive behavior of a hierarchical functional system). An example of an online consultation of the @es_economy_karkas_bot chatbot in the financial subject area is given on the example of determining a borrower's creditworthiness assessment. The use of a hierarchical functional system for online consultation in mobile expert systems is discussed. Keywords 1 temporal knowledge base model, mobile application, chat bot, expert system, hierarchical functional system 1. Introduction In practice, a number of problems arise in building an adequate model, for example, the subject area has a structure, geometry and processes that cannot be completed in a limited period of time and adapt to disturbances. Consequently, the problem of revealing temporal knowledge is urgent in solving many problems in the field of artificial intelligence. There are several ways to solve it, for example, the traditional direction is the use of time in an explicit form for temporal models of knowledge bases [1 ‒ 4]. Another approach is the use of time implicitly on the idea of bundles the knowledge base [5]. The latter approach implies the representation of the dynamic properties of models of temporal knowledge that depend on external influences. A typical representative of this class of models are open dynamical systems defined by non-autonomous differential equations. However, possessing remarkable properties to describe the complex dynamics of nonlinear processes, they are poorly suited for revealing the features of this dynamics directly from data in the form of elements of a knowledge base due to the weak interpretational suitability of differential equations. In addition, open dynamical systems lose their advantages when working with poorly structured temporal data in conditions of a priori lack of information or when a significant part of it is available only in the form of expert-heuristic descriptions. The need to build dynamic models of the domain is one of the reasons for their use, both by people and by software agents. For example, the World Wide Web Consortium (W3C) is developing OWL (Ontology Web Language), with which a domain can be represented as an object-property model for software agents that search for information. In this sense, ontologies are intellectual tools for the development and improvement of the Internet [6 ‒ 8]. In the field of intelligent information systems, one of the main tasks is to build a dynamic model of the knowledge base that adequately reflects the processes. COLINS-2021: 5th International Conference on Computational Linguistics and Intelligent Systems, April 22–23, 2021, Kharkiv, Ukraine EMAIL: volodymyr.burdaiev@hneu.net (V.Burdaiev) ORCID: 0000-0001-9848-9059 (V.Burdaiev) ©️ 2021 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0). CEUR Workshop Proceedings (CEUR-WS.org) The Internet and information technology are linking their future with the intellectualization of computer applications. For example, the multi-agent technologies of the Internet make it possible to use not only distributed knowledge bases for interaction with the user and local applications, but also to enhance the interactivity of the dialogue with the user. 2. Formulation of the Problem Modern means of the Internet impose certain conditions on the architecture and use of expert systems. Many components of ES, such as a knowledge base (KB), an inference engine, an explanation subsystem, change their properties and functions under the influence of the Internet. An increasing role is now played not by static knowledge, but by dynamic, not superficial knowledge, but deep knowledge. The explanation subsystem is supplied with methods based on argumentation of the results obtained using irrelevant information. The inference engine is increasingly based on principles based on reasoning by association and analogy. And such systems should work in real time and on mobile devices. Information domains have a dynamic structure, such as the Internet, prediction of accidents and emergencies, distributed learning, and so on. Their features are: the presence of a huge number of autonomous entities with their specific subgoals (autonomy). Entities are subject to the influences of the external environment (openness), interact with each other (distribution). Entity knowledge bases are unique (locality) and form hierarchical coalitions (entity level hierarchy). To build models of knowledge bases of such subject areas, for example, both models of artificial neural networks and self- organizing open multi-agent systems are used. The problem of revealing temporal knowledge is essential in solving many problems in the field of artificial intelligence. There are several ways to solve it, for example, the traditional direction is to explicitly use time in temporal knowledge models. Another approach is to implicitly use time on knowledge base layering ideas. The paper [2] deals with the implementation of temporal reasoning (logical inference) for models based on the logic of branching time, as applied to intelligent decision support systems. The main attention is paid to the construction of a qualitative (interval) and quantitative (metric) model of branching times. The conclusion is reduced to solving the problem of satisfying time constraints, and the corresponding procedures (algorithms) are proposed. An example of practical application of the proposed methods in a prototype of an intelligent decision support system in real time is described. The "KARKAS" system is a toolkit for developing prototypes of knowledge bases for expert systems (ES) [9, 10]. Knowledge representation is based on a hierarchical functional system, which is generated by the "KARKAS" system based on the rules and frames. The inference engine uses a hierarchical functional system in consultation with the user. The user can select different modes of operation of the machine for inference: the use of direct inference, backward inference, indirect inference, Bayes' formula, criteria tables, when the consequent of rules is a list of parameters. The system is implemented using the Embarcadero Delphi 10.4 platform [11]. There are many communication programs - Skype, Viber, WhatsApp and others. But in the business environment, the free Telegram messenger is increasingly becoming the corporate communication standard. This is due to the following reasons: a high degree of data encryption in mute, stability of work, the ability to transfer large amounts of information, protocol openness, cross-platform. On the other hand, Telegram provides API-based library for working with chatbots. Chatbots can be developed on any a programming language that supports Web API technology, for example, Java, JavaScript, PHP, Python, C #, Delphi 10.4 and others. However, there is various frameworks (for example, platform Node.js) to build chatbots that implement simplest functions: send message, picture or return a response to the user. The future of chatbots can only be in the role of a natural language shell for expert systems, based on available services for creating conversational interfaces (Api.ai, Dialogflow, Wit.ai) and Microsoft's Cortana Intelligence platform. A chatbot can be viewed as a question-answer system (QA-system) with elements of machine learning, namely, with parsing functions natural language, inference machine and communication module with external applications. An urgent problem for chatbots QA systems is the creation of an inference engine that determines relevance of knowledge to a given question. In the traditional approach, the implementation of the interface in expert systems uses a limited natural language or various graphic controls. The emergence of chat bots allows the use of a language interface. The paradigm of integrating chat bots for working with expert systems is now becoming more and more urgent. Using Telegram as an interlocutor when working with ″ KARKAS ″ gives more opportunities promptly consult with the expert system via a smartphone, which, for example, is important for making effective decisions in various subject areas such as medicine, ecology, business. The "KARKAS" system using chat bots: @Ribs_karkas_bot, @es_test_karkas_bot, @es_economy_karkas_bot, @es_info_tech_karkas_bot, allows online consultation with users and testing students' knowledge. Embarcadero's cross-platform FireMonkey (FMX) framework is part of the RAD Studio development environment and is designed to build user interfaces. The framework allows you to use not only vector graphics, but also the native capabilities of mobile devices. In addition, there is another great property of the framework is that the application code can be compiled into machine code to run on different platforms: Windows, Android and iOS. Thus, using the FMX framework, you can quickly create prototypes of mobile applications for various mobile devices [12]. The global mobile app market will grow in the coming years. Let's note several advantages of a mobile application, for example, in the financial sector: • mobile applications are more convenient and faster than chat bots, sites provide access to native smartphone functions (for example, a video camera, GPS navigator, voice recognition functions) • mobile applications increase customer loyalty (high conversion), since the smartphone is always with the customer (for example, they increase the sales volume of an online store) • mobile applications effectively influence users by sending push notifications One of the main advantages of mobile applications in customer service is that interlocutors are free to ask questions that they would not ask a support representative or company manager. Taking into account current trends, an urgent problem is the development of mobile applications that perform the functions of expert systems. As there is a constant need to adapt them for use on mobile devices. 3. Analysis of Last Research and Publication The paper [13] considers an expert system that supports the assessment of the creditworthiness of economic entities. The expert system separately assesses the relevant points of view on the effectiveness of the organization's business: financial position, leverage, structure of income and expenses, profitability and profitability. For each group of indicators, separate expert systems were developed that allow users to assess, on the one hand, individual aspects that determine the creditworthiness, and on the other hand, the creditworthiness of the organization as a whole. The expert systems link only offers an assessment of the selected business aspect, but does not provide an assessment of the overall creditworthiness. This is the main drawback of the presented method for combining expert systems into a functional block. The system is implemented on the Exsys Corvid shell. This article [14] focuses on developing an expert system model (CREES) for assessing credit risk by analyzing the knowledge bank of credit rating experts. CREES uses a soft computing technique called evolutionary neuro-fuzzy logic. The authors have developed a credit rating framework (CRF) that includes a large number of risk parameters such as financial, business, industry and management areas. CREES expert system was developed and implemented using Dream Viewer, eclipse and fuzzy jess tools. The paper [15] presents an Expert System for Evaluating and Supporting Credit Decisions on the Banking sector (ESESCDB) uses the credit rating weights for each factor that affecting the decision of the credit. As a result of this work, an expert system tool has been created that helps decision makers to make the right decision through a familiar and easy-to-use interface. In this work [16], the main goal of the author's research was to develop a computer tool (CreditExpert) to support the management of the process of evaluating loan applications using artificial intelligence methods. The system of indicators for credit scoring is analyzed. In [13 - 16] describe methods and procedures for implementing ES components that help banks for credit decision. 4. Formulating the Purpose of the Article Analysis of the concept of building knowledge base models based on the bundles of knowledge base and the implementation algorithm of a hierarchical functional system with an expert system based on a chat bot and a mobile application. 5. Main Material In the theory of complex dynamical systems, one of the problems is making decisions with many goals. A dynamic system is characterized by the fact that its components and parameters are explicitly or implicitly dependent on time. The evolution of a dynamical system is specified either by differential equations, or by the graph of its states, or by other laws. In the case when a dynamical system is specified by a state graph, then it has such important properties as connectivity, complexity, stability, integrity, hierarchy and behavior goals, which are poorly formalized. From the point of view of object-oriented programming, the basic concept in ontology is a class, which is characterized by properties and methods. The properties of a class are set by the values of its fields, and the methods solve certain problems. A class is a template from which instances of a class are created. Thus, an ontology can also be represented as a collection of interacting objects. The presence of instances of classes, objects, attributes, and inference rules in an ontology transforms it from a conceptual schema of a domain into a knowledge base. 5.1. Bundles the knowledge base and hierarchical functional system A functional system is a system formed to achieve a given useful result (objective function) in the course of its functioning. Its backbone factor is a specific result. In other words, the goal is seen as a given result, and constraints - as the degree of freedom necessary to achieve the result. In this work, the knowledge base model is considered as a hierarchical functional system in which the result has an organizing effect on all stages of ontology formation. Classes and connections between them can be viewed as a logical construct of a functional system. For example, FS can be considered as a set of functions with a certain set of operations, applied to these functions. The role of functions is played by KB rules, and the main operations are matching an attribute with a pattern and determining the conditions for applying the rules. Objects (or rather, goals and subgoals of FS) do not exist separately from each other. There are real relationships between them, and they should be reflected in the knowledge base model of the subject area. When identifying relationships, the emphasis is on fixing relationships and their characteristics. A relationship is a connection between two or more objects, which forms the KB filtering. Each relationship is realized through the values of the object's attributes. Let a triple of objects (𝑀, 𝑝, 𝐵) form a bundle, where 𝑝 ∶ 𝑀 → 𝐵 is the projection, 𝐵 is the base of the bundle, 𝑋 = 𝑝−1 (𝑏) is the layer of the bundle. For example, we have two domains of attributes 𝑉1 and 𝑉2 and consider the trivial bundle 𝑝𝑟2 ∶ 𝑉1 × 𝑉2 → 𝑉2 . Let's select in 𝑉2 the object 𝑏 ≔ 𝑔11 , which will determine the goal of achieving during the operation of the FS system. Then the section of the indicated bundle can be represented as a graph 𝑏 → (𝑏, 𝑠(𝑏)), where 𝑏 ∈ 𝑉2 and 𝑝𝑟2 °𝑠(𝑏) = 𝑏. And the section itself is interpreted, as a rule, for example, if the attribute 𝑎1 takes the value 𝑣11 ∈ 𝑉1, then the target 𝑏 takes the value 𝑔11 (rule 1: if 𝑎1 = 𝑣11 (antecedent), then 𝑏 = 𝑔11 (consequent), 𝑐𝑓 = 1) with a confidence factor of 𝑐𝑓 equal to 1, trivial bundle form (1). 𝑉1 × 𝑉2 𝑝𝑟2 ↓ ↑ 𝑠 (1) 𝑉2 To create rules with one goal 𝑏 = 𝑔11 in the antecedent, we iterate over all possible pairs 𝑎1 = 𝑣1𝑖 (𝑖 = 1, … , 𝑚), therefore, we get 𝑚 different rules (cloning rules). The expert selects among these rules only those that he considers necessary to achieve the goal of the FS system. This procedure for creating rules will be called the vertical disturbance of rule 1. If the domain 𝑉2 consists of a single target, then the definition of vertical disturbances coincides with the usual definition of the disturbance rules. This version of the presentation of the decision making rule can be extended to the case when there are n attributes characterizing the goal of achieving the FS of the system. The bundle base in this case is interpreted as the set of the main goals of the FS system. Let each of the 𝑛 attributes of the subject area take 𝑚𝑛 values, respectively, then for the target object 𝑔0 ∈ 𝑉𝑛 it is possible to obtain the number 𝑚𝑛 × 𝑛 of all possible rules to achieve the goal (2). 𝑉1 × … × 𝑉𝑛 𝑝𝑟2 ↓ ↑ 𝑠 (2) 𝑉𝑛 In other words, a complete knowledge base is presented to determine the achievement of the goal of the FS system. It is clear that among these rules there are those that do not allow achieving the goal of the FS system. Therefore, the expert selects from this set of rules only those rules that correspond to the goal of the FS system, and the rest of the rules can be marked for deletion, and they will not be used further in the system to achieve the goal. If in some domain 𝑉𝑘 an expert selects a subgoal gk, then arguing similarly as above, we obtain that a bundle with a base 𝑉𝑘 , which has a second level to achieve the goal of the FS system (3). 𝑉𝑙 × 𝑉1 × … × 𝑉𝑘 … × 𝑉𝑛 𝑝𝑟𝑘 ↓ ↑ 𝑠𝑘 𝑉1 × … × 𝑉𝑘 … × 𝑉𝑛 (3) 𝑝𝑟2 ↓ ↑ 𝑠 𝑉𝑛 Thus, a hierarchical structure bundle of the knowledge base is built, which is inherited by the hierarchical functional system (IFS). The mathematical model of a IFS system is represented by a composition of sections 𝑠0 ° 𝑠1 ° … °𝑠𝑘 of the bundle chain (3). In other words, each section of the bundle chain has the form of a digraph of the target object under study for a fixed 𝑏 ∈ 𝐵, in other words, the state of a hierarchical FS is described at a given moment in time. The change in the section (KB rules) of the prototypes of the stratification chain of the knowledge base (IFS) during their processing by the inference machine in dynamics is shown in Figure 1. 𝑋𝑘 – level is the subgoals 𝐺𝑘 , 𝐵𝑘 -- KB 𝑋1 – level is the subgoals 𝐺1 , 𝐵1 -- KB Bundle base 𝑋0 – level is the main goals 𝐺0 , 𝐵0 -- KB Figure 1: Change in the cross-section (IFS) bundles of the knowledge base chain when processed by an output agent: t0 – green layers IFSt0, t1 – yellow layers IFSt1, t2 – red layers IFSt2, etc. IFS is characterized by the following properties: • connectivity - a chain of bundles of the knowledge base • complexity - the hierarchy of levels of local knowledge bases • stability (adaptive behavior of the system) - the structure of the FS digraph does not change under vertical disturbances of the rules. The IFS connectivity is expressed in filtering the knowledge base. Let 𝐵𝑖 be a local knowledge base, that is, it contains rules for determining the subgoal 𝐺𝑖 , which is at the 𝑖-th level in the FS hierarchy. Knowledge base filtering is the ultimate local knowledge base system 𝐵𝑖 , 𝐵0 ≼ 𝐵1 ≼ ⋯ ≼ 𝐵𝑘 partially ordered (≼) as follows: the consequent of each rule from 𝐵𝑖 is contained in the antecedent of a rule from 𝐵𝑖+1 . To build a filtering of the knowledge base, it is enough to indicate the chain of IFS rules to achieve the main goal. Then, using a recursive algorithm, other rules for local IFS knowledge bases are constructed by generating rules during consultation with an expert. The expert analyzes the rules provided by the IFS inference agent and can place the created rules in the local knowledge base at the appropriate level of the FS hierarchy or prohibit its use or allow its use for a certain time. Thus, using the database filtering algorithm, both the replenishment of local knowledge bases and their adaptation to the subject area are carried out. The number of local knowledge bases corresponds to the levels of the hierarchical FS. The physical model of the knowledge base stores instances of classes, objects, values of object attributes and logical connections between classes, objects. Consider the structure of the ES prototype knowledge base for determining the creditworthiness class of a borrower. Assessment of creditworthiness is of particular interest to banks, since their profitability and liquidity largely depend on the financial condition of their clients. Reliability and financial stability of clients reduce banking risks and help the bank to receive higher income. Purpose of the ES prototype: advising on the assessment of the creditworthiness of an enterprise for the bank to issue a loan and reduce the risk. Scope of application: banks, commercial institutions. Purpose: to determine the creditworthiness class of the borrower. Expected results: to determine the value of the creditworthiness class of the borrower depending on financial and quality indicators, then it will be taken into account by the employees of the bank or other commercial organization when granting a loan to the borrower. Input data: • for the analysis of financial indicators: the value of absolute, current, total liquidity; capital structure; capital turnover; provision of own sources of financing • for the analysis of qualitative indicators: analysis and assessment of the borrower's credit history, assessment of the borrower's market position, assessment of the liquidity of the collateral, assessment of management efficiency and business qualities of the manager. The boundary values of the indicators, namely the range of values for their assessment are given in table 1. Table 1 Boundary values of indicators for five-point assessment The name of indicators Score 5 Score 4 Score 3 Score 2 Score 1 current liquidity ratio 2..2.5 1..1.99 0.7..0.99 0.5..0.69 <0.5 total liquidity ratio 1..10 0.7..0.99 0.4..69 0.2..0.39 <0.2 absolute liquidity ratio 0.2..10 0.15..0.19 0.1..0.14 0.06..0.1 <0.06 capital structure ratio 0.7..0.8 0.6..0.69 0.5..0.59 0.4..0.49 <0.39 (independence) capital turnover ratio 0.5..0.55 0.3..0.49 0.2..0.29 0.1..0.19 <0.01 the ratio of provision with 0.6..0.8 0.5..0.59 0.3..0.49 0.1..0.29 <0.01 own sources of financing To assess the qualitative indicators of the borrower's activities, the following indicators are used: • analysis and assessment of the borrower's credit history in terms of the history of his relationship with the bank • assessment of the borrower's market position • assessment of the effectiveness of management and business qualities of the leader • assessment of the liquidity of the collateral. To determine the values of the listed indicators, it is used also a five point system. Rating "5": a) the borrower's credit history is impeccable; b) the borrower's market position is active, which makes it possible to flexibly respond to changes in market conditions, increase its own competitiveness, and reduce the risk of loan defaults; c) the senior management of the borrower has an excellent business reputation; d) the provision of a credit operation is beyond doubt. Rating "4": a) the borrower's credit history indicates deterioration of certain economic indicators; b) the borrower's market position is characterized by minor flaws, which raises doubts about the stability of obtaining a positive financial result of its activities; c) the senior management of the borrower has a good business reputation; d) the provision of a credit operation is beyond doubt. Rating "3": a) the borrower's credit history indicates deterioration of certain economic indicators; b) the market position of the borrower is characterized by real shortcomings, which indicates the likelihood of untimely repayment of accounts payable in full and within the time frame stipulated by the contract, if the shortcomings are not eliminated; c) the senior management of the borrower has an average business reputation; d) there are problems with the availability of documents on the liquidity of the collateral. Rating "2": a) the borrower's credit history is characterized by instability throughout the year; b) the borrower's market position is inactive, which leads to the risk of significant losses, to a low probability of full repayment of credit debt and interest; c) the senior management of the borrower has a negative business reputation; d) the security of the credit operation is doubtful. Rating "1": a) the borrower's credit history is characterized by negative and unstable trends; b) the market position of the borrower is passive, which indicates the lag in the likelihood of the borrower fulfilling its obligations; c) the senior management of the borrower has a negative business reputation; d) the credit operation is not secured by liquid collateral. For the aggregate of points calculated in assessing the financial condition and quality indicators of activity, the borrower belongs to the appropriate class of creditworthiness. The implementation of the procedure for establishing the creditworthiness class of the borrower allows you to classify potential borrowers to issue a loan to them, as well as borrowers in the course of the concluded loan agreements. The assignment of the borrower to a certain class is carried out according to the obtained comprehensive assessment of his financial position and the assessment of the qualitative indicators of his activities. In total, 5 creditworthiness classes have been established: A, B, C, D, E. Class "A": a) the financial condition of the borrower is assessed at "5" - the financial performance is very good, which indicates the ability to repay debt on credit operations on time, including the repayment of the principal and interest on it in accordance with the terms of the loan agreement; economic indicators within the established values; b) quality indicators are rated at "5" Class "B": a) the financial condition of the borrower is assessed at "4" - financial performance is good, some economic indicators have minor deviations from the minimum acceptable values. The borrower demands more attention through potential weaknesses that jeopardize the sufficiency of the funds raised to service the debt; b) quality indicators are rated at "4" Class "C": a) the financial condition of the borrower is assessed at "3" - financial performance is satisfactory, some economic indicators do not meet the minimum acceptable value and require more detailed control. This indicates the likelihood of untimely non-repayment of the credit debt in full and within the time frame stipulated by the contract, if the deficiencies are not eliminated; b) quality indicators are rated at "3". Class "D": a) the financial condition of the borrower is assessed at "2" - financial performance is unsatisfactory, economic indicators do not meet the established value;b) quality indicators are rated at "2" Class "E": a) the financial condition of the borrower rated at "1" - financial activity is unsatisfactory, there are losses, economic indicators do not meet the established value; b) quality indicators are rated at "1" Since the set of criteria for assessing creditworthiness is not the same in different commercial banks, one of such sets is proposed in the work. According to the aggregate of points accrued in assessing the financial condition and quality indicators of activity, the borrower belongs to the corresponding class of creditworthiness. As a result of such a comprehensive assessment of the borrower, a balanced management decision should be made on the advisability of issuing or refusing a loan to this particular borrower. In the knowledge base, classes are highlighted, which are presented in Table 2. Table 2 Classes knowledge base Class KB Number of instances of the Level of class KB hierarchy class KB Creditworthiness of class 26 1 Score of quality indicators 6 2 Score of financial condition 17 2 Here is one instance (rule) from each class of the knowledge base. The rationale for the credit rating is given in the knowledge base rules. The rule from the class: creditworthiness of class. Rule 11_. IF A & B # A Score of quality indicators = 5 B Score of financial condition = 5 THEN Creditworthiness of class = А. Argumentation. The financial performance is very good, which indicates the ability to repay debt on credit operations on time, including the repayment of the principal and interest on it in accordance with the terms of the loan agreement; economic indicators within the established values. The rule from the class: Score of quality indicators. Rule 6_. IF A & B & C & D #. A Analysis and assessment of the borrower's credit history = History is impeccable B Assessment of the market position of the borrower = Position active C Assessment of the liquidity of the collateral = The security of the credit operation is beyond doubt D Evaluation of management effectiveness and business qualities of the leader = Excellent business reputation THEN Score of quality indicators = 5. The rule from the class: Score of financial condition. Rule 36_. IF A & B & C & D & E & F #. A Absolute liquidity ratio = 0.15..0.19 B Current liquidity ratio = 2..2.5 C Total liquidity ratio = 1..10 D Capital turnover ratio = 0.5..0.55 E Capital structure = 0.7..0.8 F Coefficient of provision with own sources of financing = 0.6..0.8 THEN Score of financial condition = 5. In the process of searching for solutions in the knowledge base, the inference engine uses a hierarchical functional system to put forward and refute hypotheses. The movement of hypotheses is illustrated in Fig. 1. 5.2. Using chat bots for online consultation with expert systems Chat bot @es_economy_karkas_bot messenger TELEGRAM, uses instant messenger like interface for the online user to communicate with the system "KARKAS" for effective decision-making in the economic and financial sphere. To integrate the "KARKAS" system with the @es_economy_karkas_bot chatbot, a consultation agent and a dialogue agent are used. Integration of the chatbot with the consultation module of the "KARKAS" system consists in the exchange of messages between them, that is, in the transmission and reception of requests for working with the TELEGRAM servers. The module of online consultation (interlocutor) of the "KARKAS" system allows to exchange messages with knowledge bases via the Internet by means of the TELEGRAM messenger. Consultation and dialogue agents exchange messages with each other to perform the following operations: • pressing: buttons, check boxes, radio buttons • transmission and reception of messages between visual objects on the form. Thus, the above modules perform the functions of agents and in this sense, the implemented chatbot @es_economy_karkas_bot in the system "KARKAS" can be considered as a multi-agent system. Transmission and reception of consultation agent messages. For example, when you select the /creditworthiness command, in @es_economy_karkas_bot the following operations are performed: • the creditworthiness.knb knowledge base is downloaded from the website https://it- karkas.com.ua • the consultation module is executed and the machine of the conclusion of expert system is started the dialogue module is activated • the result of the expert system consultation is transmitted to the bot via a broadcast protocol. Thus, the algorithm of the chatbot @es_economy_karkas_bot consists of the following steps: Step 1. Activate the chatbot @es_economy_karkas_bot in the TELEGRAM messenger. Step 2. Select the commands: /help or /start, then, the command /creditworthiness calls the ES prototype to select the borrower's credit class. Step 3. The bot launches the consulting agent of the "KARKAS" system. Step 4. The inference engine of the "KARKAS" system is activated. Step 5. A hierarchical functional system is formed for dialogue with the user. Step 6. The dialog agent is activated, which sends a message to the bot with the text of the question and answers. The bot receives the message as a JSON object, performs its parsing, displays the message in the chat and waits for the user's response. Step 7. The user in the chatbot selects or enters the answer. The bot sends the inference engine to the expert system's conclusion. Step 8. The expert system consulting agent receives the message and transmits it to the inference engine, which transmits the message to the dialogue agent. The purpose of the consultation is specified, based on a hierarchical functional system, during the dialogue with the user. Step 9. The iterative consultation process continues until the conclusion inference engine receives the result from the expert system. The user can terminate the consultation with the /quit command at any time. 6. Conclusions The paper considers a mathematical model for building a temporal knowledge base based on a hierarchical functional system, in which the knowledge base model is associated with a chain of knowledge base bundles. The algorithm of interaction of chatbot and agents of expert system in the online mode is considered. The results of the study allow real-time monitoring of changing information using the "KARKAS" computer system and the chat bots of the Telegram messenger integrated with it. The development of using this approach for mobile applications for Android and IOS platforms has been carried out. References [1] S. Russell, P. Norvig, Artificial Intelligence: A Modern Approach, 4nd. ed., 2020. [2] A. P. Eremeev, I. E. Kurilenko, An implementation of inference in temporal branching time models. J. Comput. Syst. Sci. Int., 56 (2017) 105 – 124. [3] A. N. Vinogradov, G. S. Osipov, L. U. Zhilyakova, Dynamic Intelligent Systems, vol. 1: Knowledge Representation and Fundamental Algorithms, Izv. Acad. Nauk, Ser.: Teor. i sistemy upravleniya, 1 (2002) 119–127. [4] G. S. Osipov, Intelligent dynamic systems, Scientific and Technical Information Processing 37 (2010) 259–264. [5] V. P. Burdaev, Complexity of dynamical systems, Saarbrucken: Lap Lambert Academic Publishing, 2015. [6] W3C, 2021, URL: https://www.w3.org/standards/. [7] V. Lytvyn, V. Vysotska, W. Wojcik, D. Dosyn, A method of construction of automated basic ontology, In: 1st International Conference Computational Linguistics and Intelligent Systems, COLINS, 2017, pp. 75–83. [8] V. Lytvyn, O. Oborska, V. Vysotska, D. Dosyn, A. Demchuk, Y. Burov, P. Kravets, N. Oleksiv, Problems of ontology structure and meaning optimization and theirs solution methods, In: 4st International Conference Computational Linguistics and Intelligent Systems, COLINS, 2020, pp. 21–40. [9] J. C. Giarratano, G. D. Riley, Expert Systems: Principles and Programming, 4th. ed., 2007. [10] Сomputer system "KARKAS", 2012, URL: https://it-karkas.com.ua. [11] Delphi 10.4 Sydney Professional (Embarcadero), 2021, URL: https://www.embarcadero.com/ru/products/rad-studio. [12] Android Mobile Application Development, 2014, URL: http://docwiki.embarcadero.com/RADStudio/XE6/en/Android_Mobile_Application_Developme nt. [13] O. Grljević, Z. Bošnjak. Development of Creditworthiness Expert System, Proceedings of the 21st Central European Conference on Information and Intelligent Systems, CECIIS, Varaˇzdin Croatia, 2010, pp. 407 – 413. [14] D. K. Sreekantha, R. V. Kulkarni R. V, Credit risk evaluation using knowledge mining, International Journal of Knowledge Engineering, 3 (2012), 178-183. [15] M. Mahmoud, N. Algadi, A. Ali, Expert system for banking credit decision, Proceedings of the International Conference on Computer Science and Information Technology, ICCSIT, 2008, pp. 813 -819. [16] A. Jasiński, Credit expert – expert system for credit applications evaluation, Journal of Interdisciplinary Research, 1 (2011) 107 – 110.