A method for efficiently generating new code data by categorizing user requirements and creating a library of result code data, and an AI agent using this method.
Patent Information
- Application Number
- JP2025255499
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2025-11-05
- Filing Date
- 2025-12-16
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2045-12-16
AI Technical Summary
【0028】 本発明は、ユーザーとAI(Artificial Intelligence)エージェントとの間のインタラクションを記録した少なくとも一つのチャットログデータが取得されると、AIエージェントが、少なくとも一つのチャットログデータをインタラクション単位ごとに分解してチャンクデータを生成し、大規模言語モデルを通じてチャンクデータのそれぞれに対する要求事項データのそれぞれおよび初期コードデータのそれぞれを抽出し、要求事項データのそれぞれを埋め込んで要求事項埋め込みベクトルのそれぞれを生成し、要求事項データのそれぞれ、初期コードデータのそれぞれ、および要求事項埋め込みベクトルのそれぞれをチャンクデータベースに格納し、チャンクデータベースに格納された要求事項埋め込みベクトルをクラスタリングして、少なくとも一つの要求事項ごとのクラスターを生成し、予め設定された閾値サイズ以上のいずれか一つのクラスターに含まれる第1要求事項埋め込みベクトルに対応する第1要求事項データないし第n要求事項埋め込みベクトルに対応する第n要求事項データ(前記nは2以上の整数である)をチャンクデータベースから取得し、大規模言語モデルを通じて、第1要求事項データないし第n要求事項データを包含する統合要求事項データを生成し、大規模言語モデルを通じて統合要求事項データに対する候補結果コードデータを生成し、大規模言語モデルを通じて第1要求事項データないし第n要求事項データを用いて候補結果コードデータを検証し、候補結果コードデータが検証されると、候補結果コードデータを統合要求事項データに対する統合結果コードデータとして生成し、統合要求事項データと統合結果コードデータとをコードライブラリに登録する効果がある。
Smart Images

Figure 0007909336000001_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method for efficiently generating code by classifying user requirements and libraryizing result codes, and an AI agent using the same.
Background Art
[0002] Conventional AI agent systems have operated in a manner that, when a user's natural language request is input, generates code for processing it and executes the generated code. In recent years, as the coding function of large language models (LLMs) has advanced by leaps and bounds, the coding function of AI agent systems based on large language models has also tended to improve.
[0003] However, conventional AI agent systems operate in such a way that every time the same or similar requests are repeatedly input, new code is generated each time, resulting in problems such as unnecessary cost generation and response speed reduction. More specifically, when the same or similar requests are repeatedly input, conventional AI agent systems: (i) consume unnecessary tokens and incur unnecessary costs because they generate new code for the same or similar functions to respond to this; (ii) have a problem of reduced response speed because they generate new code every time they respond to the same or similar requests; (iii) there is a problem that different codes may be generated for the same request, lacking response consistency; and (iv) when the length or complexity of the code to be generated is large, depending on the performance of the large language model, there is a problem that code generation sometimes fails.
[0004] Therefore, the applicant proposes a method that can solve all of the above-mentioned problems by embedding and clustering chat logs to derive major request types, generating and verifying generalized code based on these types and registering it in a library, and then, when a similar request is entered by a user, immediately utilizing the verified code registered in the library using a large-scale language model, instead of generating new code. [Overview of the project] [Problems that the invention aims to solve]
[0005] The purpose of this invention is to solve all of the problems mentioned above.
[0006] Furthermore, in this invention, when at least one chat log data recording an interaction between a user and an AI (Artificial Intelligence) agent is acquired, the AI agent decomposes the at least one chat log data into interaction units to generate chunk data, extracts each of the requirement data and initial code data for each of the chunk data through a large-scale language model, embeds each of the requirement data to generate each of the requirement embedding vectors, stores each of the requirement data, each of the initial code data, and each of the requirement embedding vectors in a chunk database, clusters the requirement embedding vectors stored in the chunk database to generate clusters for at least one requirement, and sets a preset threshold size. Another objective is to obtain first requirement data corresponding to the first requirement embedding vector contained in any one of the above clusters, or the nth requirement data corresponding to the nth requirement embedding vector (wherein n is an integer of 2 or more), from the chunk database; generate integrated requirement data encompassing the first requirement data or the nth requirement data through a large-scale language model; generate candidate result code data for the integrated requirement data through the large-scale language model; verify the candidate result code data using the first requirement data or the nth requirement data through the large-scale language model; once the candidate result code data is verified, generate the candidate result code data as integrated result code data for the integrated requirement data; and register the integrated requirement data and integrated result code data in the code library.
[0007] Furthermore, the present invention also aims to enable the AI agent, upon obtaining new requirement data from a specific user, to obtain specific integrated result code data from a code library through a large-scale language model that corresponds to specific integrated requirement data similar to the new requirement data, to generate new result code data by referencing the new requirement data and the specific integrated result code data, and to generate response data for the new requirement data using the new result code data and provide it to the specific user. [Means for solving the problem]
[0008] According to one embodiment of the present invention, in a method for efficiently generating new code data by categorizing user requirements and creating a library of result code data, (a) when at least one chat log data recording an interaction between a user and an AI (Artificial Intelligence) agent is acquired, the AI agent decomposes the at least one chat log data into interaction units to generate chunk data, extracts each of the requirement data and each of the initial code data for each of the chunk data through a large-scale language model, embeds each of the requirement data to generate each of the requirement embedding vectors, and stores each of the requirement data, each of the initial code data, and each of the requirement embedding vectors in a chunk database; (b) the AI agent clusters the requirement embedding vectors stored in the chunk database to generate clusters for at least one requirement, and pre-configure The steps include: obtaining first requirement data corresponding to a first requirement embedding vector contained in any one cluster of threshold size or larger, or nth requirement data corresponding to an nth requirement embedding vector (where n is an integer of 2 or greater), from the chunk database; generating integrated requirement data encompassing the first requirement data to the nth requirement data through the large-scale language model; generating candidate result code data for the integrated requirement data through the large-scale language model; verifying the candidate result code data using the first requirement data to the nth requirement data through the large-scale language model; generating integrated result code data for the integrated requirement data once the candidate result code data has been verified; and registering the integrated requirement data and the integrated result code data in the code library;Furthermore, a method is provided which includes (c) when new requirement data is obtained from a specific user, the AI agent, through the large-scale language model, obtains specific integrated result code data from the code library corresponding to specific integrated requirement data similar to the new requirement data, generates new result code data by referencing the new requirement data and the specific integrated result code data, generates response data for the new requirement data using the new result code data, and provides it to the specific user;
[0009] In one example, in step (b) above, the AI agent, through the large-scale language model, checks whether it is possible to respond to each of the first requirement data to the n requirement data using the candidate result code data, and determines that the candidate result code data will be verified if the number of cases where it is not possible to respond is less than a predetermined percentage, and determines that the candidate result code data will not be verified if the number of cases where it is not possible to respond is equal to or greater than the predetermined percentage.
[0010] In one example, in step (b), if the candidate result code data is not validated, the AI agent generates improved requirement data through the large language model that corresponds to at least one improvement data for the unresponsive case (the improvement data is generated by the large language model when the candidate result code data is validated), and then regenerates and validates the candidate result code data using the improved requirement data through the large language model.
[0011] In one example, the AI agent inputs the integrated requirements data and the improvement data into the large-scale language model, and uses the large-scale language model to generate the improved requirements data by referring to the improvement data and the integrated requirements data.
[0012] In one example, in step (b), the AI agent inputs the integrated requirements data, the first requirements data to the nth requirements data, and the first initial code data to the nth initial code data corresponding to the first requirements data into the large-scale language model, and uses the large-scale language model to generate the candidate result code data for the integrated requirements data by referring to the first requirements data, the first initial code data to the nth requirements data, and the nth initial code data.
[0013] In one example, in step (b), the AI agent uses the large-scale language model to extract multiple text words from each of the first requirement data to the n requirement data, selects at least one specific text word from the multiple text words whose number is greater than or equal to a preset threshold, and generates the integrated requirement data by referring to the at least one specific text word.
[0014] In one example, in step (a) above, the AI agent generates chunk data by decomposing the chat log data turn by turn if the chat log data was generated by multiple turns, and generates chunk data by decomposing the chat log data loop by loop if the chat log data was generated by multiple loops.
[0015] In one example, in step (b), the AI agent performs clustering of the requirement embedding vectors when the number of requirement embedding vectors stored in the chunk database exceeds a predetermined number.
[0016] In one example, in step (b), the AI agent places each of the requirement embedding vectors on a reference vector space, arbitrarily generates a predetermined number of initial center points for initial clusters (the predetermined number being the total number of clusters for each requirement) on the reference vector space, calculates the distance between each of the initial center points and each of the requirement embedding vectors, generates the predetermined number of initial clusters by matching each of the requirement embedding vectors with the initial center point that is closest to each of the requirement embedding vectors among the initial center points, calculates the average value of each coordinate of each embedding vector included in each of the initial clusters, determines each of the cluster center points for each of the initial clusters, and generates each of the clusters for each requirement by matching each of the requirement embedding vectors with the cluster center point that is closest to each of the requirement embedding vectors among the cluster center points.
[0017] In one example, the clusters for each requirement are generated using one of the following: a k-means clustering algorithm, a k-medoid algorithm, a k-medians clustering algorithm, a hierarchical clustering algorithm, a mean-shift clustering algorithm, and a density-based nonparametric clustering algorithm (density-based spatial clustering of applications with noise, DBSCAN).
[0018] Furthermore, according to another embodiment of the present invention, in an AI agent that efficiently generates new code data by categorizing user requirements and creating a library of result code data, the agent includes one or more memories for storing instructions; and one or more processors configured to execute the instructions, wherein the processor (I) when at least one chat log data recording an interaction between the user and the AI agent is acquired, it decomposes the at least one chat log data into interaction units to generate chunk data, extracts each of the requirement data and each of the initial code data for each of the chunk data through a large-scale language model, embeds each of the requirement data to generate each of the requirement embedding vectors, and stores each of the requirement data, each of the initial code data, and each of the requirement embedding vectors in a chunk database; (II) the chunk data A process that clusters the requirement embedding vectors stored in a database to generate clusters for at least one requirement; retrieves from the chunk database first requirement data corresponding to a first requirement embedding vector or nth requirement data corresponding to an nth requirement embedding vector (where n is an integer of 2 or greater) included in any one cluster of a predetermined threshold size or greater; generates integrated requirement data encompassing the first requirement data or nth requirement data through the large-scale language model; generates candidate result code data for the integrated requirement data through the large-scale language model; verifies the candidate result code data using the first requirement data or nth requirement data through the large-scale language model; if the candidate result code data is verified, generates the candidate result code data as integrated result code data for the integrated requirement data; and registers the integrated requirement data and the integrated result code data in a code library;Furthermore, (III) when new requirement data is obtained from a specific user, an AI agent is provided that performs the following process: through the large-scale language model, obtains specific integrated result code data from the code library corresponding to specific integrated requirement data similar to the new requirement data; generates new result code data by referencing the new requirement data and the specific integrated result code data; and uses the new result code data to generate response data for the new requirement data and provides it to the specific user.
[0019] In one example, in the process described in (II), the processor, through the large-scale language model, uses the candidate result code data to determine whether each of the first requirement data to the n requirement data is responsive or not, and determines that the candidate result code data will be verified if the number of non-responsive cases is less than a predetermined percentage, and determines that the candidate result code data will not be verified if the number of non-responsive cases is equal to or greater than the predetermined percentage.
[0020] In one example, in the process described in (II), if the candidate result code data is not validated, the processor generates improved requirement data through the large language model corresponding to at least one improvement data for the unresponsive case (the improvement data is generated by the large language model when the candidate result code data is validated), and then regenerates and validates the candidate result code data using the improved requirement data through the large language model.
[0021] In one example, the processor inputs the integrated requirements data and the improvement data into the large-scale language model, and uses the large-scale language model to generate the improved requirements data by referring to the improvement data and the integrated requirements data.
[0022] In one example, the process (II) above is characterized in that the processor inputs the integrated requirements data, the first requirements data to the nth requirements data, and the first initial code data to the nth initial code data corresponding to the first requirements data into the large language model, and uses the large language model to generate the candidate result code data for the integrated requirements data by referring to the first requirements data, the first initial code data to the nth requirements data, and the nth initial code data.
[0023] In one example, in process (II), the processor uses the large-scale language model to extract each of a plurality of text words from each of the first requirement data to the n requirement data, selects at least one specific text word from the plurality of text words whose number is greater than or equal to a preset threshold, and generates the integrated requirement data by referring to the at least one specific text word.
[0024] In one example, in the process described in (I), the processor generates chunk data by decomposing the chat log data turn by turn if the chat log data was generated by multiple turns, and generates chunk data by decomposing the chat log data loop by loop if the chat log data was generated by multiple loops.
[0025] In one example, in the process described in (II), the processor performs clustering of the requirement embedding vectors when the number of requirement embedding vectors stored in the chunk database exceeds a predetermined number.
[0026] In one example, in the (II) process, the processor arranges each of the claim embedding vectors on a reference vector space, arbitrarily generates initial central points for a predetermined number (the predetermined number is the total number of clusters for each claim) of initial clusters on the reference vector space, calculates each distance between each of the initial central points and each of the claim embedding vectors, and matches each of the claim embedding vectors with the corresponding initial central point located at the closest distance from each of the claim embedding vectors among the initial central points to generate the predetermined number of initial clusters. Then, the average value of each coordinate of each embedding vector included in each of the initial clusters is calculated for each of the initial clusters to determine each cluster central point of each of the initial clusters, and each of the claim embedding vectors is matched with the corresponding cluster central point located at the closest distance from each of the claim embedding vectors among the cluster central points to generate each of the clusters for each claim.
[0027] In one example, the cluster for each claim is generated by using any one of a k-means clustering algorithm, a k-medoids algorithm, a k-medians clustering algorithm, a hierarchical clustering algorithm, a mean-shift clustering algorithm, and a density-based spatial clustering of applications with noise (DBSCAN).
Advantages of the Invention
[0028] When at least one chat log data recording the interaction between a user and an AI (Artificial Intelligence) agent is acquired, the AI agent decomposes the at least one chat log data into chunks for each interaction unit to generate chunk data, extracts respective requirement data and respective initial code data for each of the chunk data through a large language model, embeds each of the requirement data to generate respective requirement-embedded vectors, stores each of the requirement data, each of the initial code data, and each of the requirement-embedded vectors in a chunk database, clusters the requirement-embedded vectors stored in the chunk database to generate clusters for each of at least one requirement, and acquires from the chunk database the first requirement data corresponding to the first requirement-embedded vector included in any one cluster having a preset threshold size or more to the nth requirement data corresponding to the nth requirement-embedded vector (where n is an integer of 2 or more), generates integrated requirement data including the first requirement data to the nth requirement data through a large language model, generates candidate result code data for the integrated requirement data through a large language model, verifies the candidate result code data using the first requirement data to the nth requirement data through a large language model, and when the candidate result code data is verified, generates the candidate result code data as integrated result code data for the integrated requirement data, and registers the integrated requirement data and the integrated result code data in a code library.
[0029] Further, when new requirement data is acquired from a specific user, the AI agent of the present invention acquires specific integrated result code data corresponding to specific integrated requirement data similar to the new requirement data from a code library through a large language model, generates new result code data by referring to the new requirement data and the specific integrated result code data, generates response data for the new requirement data using the new result code data, and provides it to the specific user. [Brief explanation of the drawing]
[0030] The following drawings, attached for use in describing embodiments of the present invention, represent only a portion of the embodiments, and a person with ordinary skill in the art to which the present invention pertains (hereinafter referred to as "ordinary art") can obtain other drawings based on these drawings without performing any inventive work.
[0031] [Figure 1] This figure shows a schematic configuration of an AI agent for efficiently generating new code data by categorizing user requirements and creating a library of result code data according to one embodiment of the present invention. [Figure 2] This flowchart illustrates the sequence of steps for efficiently generating new code data by categorizing user requirements and creating a library of result code data according to one embodiment of the present invention. [Figure 3a] This diagram shows a series of processes: (i) breaking down a single chat log data to generate chunk data, (ii) extracting each of the requirement data and initial code data for each of the chunk data through a large-scale language model, (iii) embedding each of the requirement data to generate each requirement embedding vector, and (iv) storing each of the requirement data, initial code data, and requirement embedding vector in a chunk database. [Figure 3b] This diagram illustrates a series of processes: (i) retrieving each requirement data corresponding to each requirement embedding vector in a cluster from a chunk database; (ii) generating integrated requirement data by referencing each of the requirement data; and (iii) generating candidate result code data for the integrated requirement data. [Figure 3c] This diagram shows the series of processes for verifying candidate result code data. [Figure 3d]This diagram illustrates a series of processes that generate new result code data for new requirement data obtained from a specific user, by referencing specific integrated result code data stored in a code library. [Modes for carrying out the invention]
[0032] The detailed description of the present invention, as described below, refers to the accompanying drawings illustrating specific embodiments in which the present invention may be carried out. These embodiments are described in sufficient detail to enable a person of the ordinary skill to carry out the present invention. It should be understood that the various embodiments of the present invention are different from one another but do not need to be mutually exclusive. For example, certain shapes, structures and characteristics described herein can be realized by modifying one embodiment to another without departing from the spirit and scope of the present invention. It should also be understood that the position or arrangement of individual components within each embodiment can be modified without departing from the spirit and scope of the present invention. Therefore, the detailed description described below should not be taken as restrictive, and the scope of the present invention should be understood to encompass the scope claimed in the claims and all equivalent scopes thereto. In the drawings, similar reference numerals indicate identical or similar components in various aspects.
[0033] In the following, several preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings, so that a person with ordinary skill in the art to which the present invention pertains can easily implement the present invention.
[0034] Figure 1 shows a schematic configuration of an AI agent 100 for efficiently generating new code data by categorizing user requirements and creating a library of result code data according to one embodiment of the present invention.
[0035] As shown in Figure 1, the AI agent 100 of the present invention may include a memory 110, a processor 120, a large-scale language model 200, and a chat history 300 (e.g., a chat log data storage unit).
[0036] Here, memory 110 can store instructions to be executed by processor 120, specifically, instructions which are code generated for the purpose of enabling the AI agent 100 to function in a particular manner, and which can be stored in computer-accessible or computer-readable memory intended for a computer or other programmable data processing equipment. The instructions can carry out processes for performing the functions described in the specification of the present invention.
[0037] The processor 120 may also include hardware components such as an MPU (Micro Processing Unit) or CPU (Central Processing Unit), cache memory, and a data bus. Furthermore, the AI agent 100 may also include an operating system and software components for applications that perform specific purposes.
[0038] The large-scale language model 200 is a machine learning model designed for natural language processing tasks. Commercially available services such as OpenAI's GPT series, Google DeepMind's Gemini, and Meta AI's LLaMa can be used as the large-scale language model 200 according to one embodiment of the present invention, but the present invention is not limited to these. Furthermore, since it is desirable for the AI agent 100 according to one embodiment of the present invention to operate based on the large-scale language model 200, it is desirable that the large-scale language model 200 be included in the AI agent 100. However, the invention is not limited to this, and in some cases, the large-scale language model 200 may be configured separately from the AI agent 100.
[0039] The chat history 300 is configured to include at least one chat log data that records past interactions between the user and the AI agent 100 (for example, single-turn or multi-turn conversations between the user and the AI agent). Here, each of the at least one chat log data can be interpreted differently depending on the manner in which the past interaction between the user and the AI agent 100 took place, and a specific explanation of this will be given later.
[0040] Furthermore, the AI agent 100 can interact with the chunk database 400 and the code library 500. A detailed explanation of the chunk database 400 and the code library 500 will be provided later.
[0041] A method using the AI agent 100 according to one embodiment of the present invention, configured as described above, will be explained with reference to Figure 2 as follows.
[0042] Figure 2 is a flowchart illustrating the sequence of steps for efficiently generating new code data by categorizing user requirements and creating a library of result code data according to one embodiment of the present invention.
[0043] First, referring to step S201 in Figure 2, an AI agent 100 according to one embodiment of the present invention, upon acquiring at least one chat log data recording an interaction between the user and the AI agent 100, can decompose the at least one chat log data into interaction units to generate chunk data, extract each of the requirement data and each of the initial code data for each of the chunk data through a large-scale language model 200, embed each of the requirement data to generate each of the requirement embedding vectors, and store each of the requirement data, each of the initial code data, and each of the requirement embedding vectors in a chunk database 400.
[0044] To provide a detailed explanation of step S201 mentioned above, please refer to Figure 3a.
[0045] Figure 3a shows a series of processes that (i) decompose at least one chat log data to generate chunk data, (ii) extract each requirement data and each initial code data for each chunk data through a large language model, (iii) embed each requirement data to generate each requirement embedding vector, and (iv) store each requirement data, each initial code data, and each requirement embedding vector in a chunk database.
[0046] Referring to Figure 3a, the AI agent 100 can obtain at least one chat log data 310 recording the interaction with the user from the chat history 300.
[0047] Here, it is desirable that each of at least one chat log data 310 is generated by either a multi-turn or multiple loops, where a loop means that in response to a single request input by the user, the AI agent 100 internally performs iterative self-feedback in order to respond to the single request. Examples in which part of the at least one chat log data 310 is generated by a multi-turn, and examples in which other part of the at least one chat log data 310 is generated by multiple loops, will be described sequentially below.
[0048] First, if at least one chat log data 310 is generated by multi-turn interaction, the AI agent 100 needs to continue remembering previous conversations with the user and interact with the user one at a time. Therefore, each of the portions of the at least one chat log data 310 may contain each of the conversation records exchanged between the user and the AI agent 100 for each of the main conversation themes.
[0049] On the other hand, if at least one chat log data 310 is generated by multiple loops, the AI agent 100 needs to go through the loop many times to generate a satisfactory response to the first request entered by the user. Therefore, each of the other parts of the at least one chat log data 310 may include each of the first requests entered by the user and each of the multiple response data generated by the AI agent 100 in each loop for each of the first requests.
[0050] On the other hand, while it was explained above that it is desirable for each of at least one chat log data 310 to be generated by a multi-turn method or a loop method, the present invention is not limited to this.
[0051] Thus, once at least one chat log data 310 is obtained, the AI agent 100 can generate chunk data 311 by decomposing at least a portion of the at least one chat log data 310 into interaction units.
[0052] For example, if a portion of at least one chat log data 310 is generated by a multi-turn process, the AI agent 100 can decompose each portion of the chat log data 310 turn by turn to generate chunk data 311. In this case, each chunk data 311 decomposed turn by turn may include each of the request data input by the user and each of the response data in which the AI agent 100 responds to each of the request data. For example, the Chunk#1 data may include the Chunk#1 request data input by the user (for example, "Recommend me a travel destination abroad") and the Chunk#1 response data which is the response data (for example, "I recommend a trip to America").
[0053] As another example, if at least one portion of the chat log data 310 is generated by multiple loops, the AI agent 100 can decompose each of the other portions of the chat log data 310 for each loop to generate chunk data 311. In this case, each chunk data 311 decomposed for each loop may include each of the response data for each loop, specifically, each of the request data input by the user and each of the response data generated by the AI agent 100 by running at least one loop for each of the request data. For example, (i) Chunk#1 data may include Chunk#1 request data entered by the user (for example, "Please recommend a travel destination abroad") and Chunk#1 response data generated by the AI agent 100 by running a loop through the Chunk#1 request data once (for example, "I recommend traveling to Japan"), and (ii) Chunk#2 data may include Chunk#2 response data generated by the AI agent 100 by running another loop once (for example, "We have received a request to recommend a travel destination abroad, so if you tell us your nationality, we will guide you to a travel destination abroad that is popular among people of your nationality").
[0054] In this manner, once the chunk data 311 is generated, the AI agent 100 inputs the chunk data 311 into the large-scale language model 200, and the large-scale language model 200 uses this model to extract the respective requirement data and initial code data 312 for each of the chunk data 311.
[0055] Here, initial code data refers to the code data used by the AI agent to generate response data.
[0056] As an example, let's assume a user inputs the request, "Please tell me the weather in New York tomorrow." Since AI agent 100 cannot predict the weather in New York tomorrow using only the data it possesses, it can generate tool call code data to call a tool to retrieve tomorrow's weather information for New York from the U.S. National Weather Service database, and then generate weather information request code data to use that tool to request tomorrow's weather information for New York from the U.S. National Weather Service database. In other words, in the above example, the call code data and the weather information request code data may be included in the initial code data.
[0057] Next, the AI agent 100 can generate each of the requirement embedding vectors 313 by embedding each of the requirement data for each of the chunk data 311. Since the embedding technique is a well-known technique, a detailed explanation is omitted here. Once each of the requirement embedding vectors 313 is generated, the AI agent 100 can store each of the requirement data, each of the initial code data 312, and each of the requirement embedding vectors 313 in the chunk database 400.
[0058] Next, the AI agent 100 can cluster the requirement embedding vectors stored in the chunk database 400 to generate clusters for at least one requirement, which will be explained again with reference to Figure 2 for a more detailed explanation.
[0059] Referring to step S202 in Figure 2, the AI agent 100 clusters the requirement embedding vectors 313 stored in the chunk database 400 to generate clusters for at least one requirement, retrieves the first requirement data and the nth requirement data corresponding to each of the first requirement embedding vectors and nth requirement embedding vectors (where n is an integer greater than or equal to 2) contained in any one cluster (e.g., the largest cluster) that is greater than or equal to a preset threshold size, generates integrated requirement data encompassing the first requirement data and the nth requirement data through the large-scale language model 200, generates candidate result code data for the integrated requirement data through the large-scale language model 200, verifies the candidate result code data using the first requirement data and the nth requirement data through the large-scale language model 200, and once the candidate result code data is verified, generates the candidate result code data as integrated result code data for the integrated requirement data, and can register the integrated requirement data and integrated result code data in the code library (S202).
[0060] Referring to step S202, after each of the 313 request embedding vectors generated from at least one chat log data is stored in the chunk database 400, the AI agent 100 can cluster the request embedding vectors stored in the chunk database 400 to select which requests were frequently requested by the user, thereby generating at least one cluster for each request. Here, the clusters for each request are generated by classifying the requests input by the user by dialogue theme through a clustering algorithm (a specific explanation of the clustering algorithm will be given later). For example, if the user has previously input requests related to the weather theme, requests related to the tourism theme, and requests related to the business theme through the AI agent 100, then one of the clusters for each request will contain request embedding vectors related to the weather theme, another will contain request embedding vectors related to the tourism theme, and yet another will contain request embedding vectors related to the business theme.
[0061] Furthermore, it is desirable that the aforementioned clustering be performed when the number of requirement embedding vectors stored in the chunk database 400 is equal to or greater than a predetermined number. It is also desirable that the clustering be performed using one of the following: k-means clustering algorithm, k-medoid algorithm, k-medians clustering algorithm, hierarchical clustering algorithm, mean-shift clustering algorithm, and density-based spatial clustering of applications with noise (DBSCAN). However, the present invention is not limited thereto, and other conventional algorithms capable of clustering embedded vectors may be selected and implemented in addition to the aforementioned clustering algorithms.
[0062] The following is an example of generating clusters for at least one requirement using the k-means clustering algorithm, one of the clustering algorithms mentioned above.
[0063] First, the AI agent 100 can position each of the requirement embedding vectors on a reference vector space and arbitrarily generate initial center points for a predetermined number of initial clusters on the reference vector space. It is desirable that the reference vector space be multidimensional. The predetermined number is the total number of clusters for each requirement to be generated.
[0064] Once the initial center points are arbitrarily generated, the AI agent 100 calculates the distance between each of the initial center points and each of the requirement embedding vectors, and by referring to the calculated distances, matches each of the requirement embedding vectors with the initial center points that are closest to each of the requirement embedding vectors, thereby generating a predetermined number of initial clusters.
[0065] In this way, once a predetermined number of initial clusters are generated, the AI agent 100 calculates the mean of each coordinate of each embedding vector contained in each initial cluster for each initial cluster, and determines the cluster center point for each initial cluster. Then, by matching each requirement embedding vector with the corresponding cluster center point that is closest to each requirement embedding vector among the cluster center points, the AI agent can generate each cluster for each requirement.
[0066] Next, step S202 will be explained with further reference to Figure 3b.
[0067] Figure 3b illustrates a series of processes: (i) retrieving each of the requirement data corresponding to each requirement embedding vector in a cluster from the chunk database; (ii) generating unified requirement data by referencing each of the requirement data; and (iii) generating candidate result code data for the unified requirement data.
[0068] Referring to Figure 3b, after a cluster for each requirement is generated, the AI agent 100 can retrieve from the chunk database 400 the first requirement data and first initial code data corresponding to the first requirement embedding vector, or the nth requirement data and nth initial code data 321 corresponding to the nth requirement embedding vector (where n is an integer greater than or equal to 2), which are contained in any one cluster 320 of a predetermined threshold size or larger. At this time, the cluster 320 may be, but is not limited to, the largest cluster among the clusters for each requirement (where the largest cluster means the cluster that contains the most embedding vectors among all the clusters for each requirement).
[0069] Next, the AI agent 100 can generate an integrated requirements data generation command prompt 322, which is an input prompt that causes the large-scale language model 200 to generate an integrated requirements data 323 to be obtained as a representative by referring to the first requirements data to the nth requirements data. At this time, as shown in Figure 3b, the integrated requirements data generation command prompt 322 may include (i) the first requirements data to the nth requirements data and (ii) an integrated requirements data generation request data (for example, "Please summarize the requirements including all of the following requirements in a concise form") that requests the large-scale language model 200 to generate an integrated requirements data 323 by referring to the first requirements data to the nth requirements data. When the integrated requirements data generation command prompt 322 is generated, the AI agent 100 can input it to the large-scale language model 200 and cause the large-scale language model 200 to generate an integrated requirements data 323 based on the integrated requirements data generation request data.
[0070] Herein lies a specific example of how the large-scale language model 200 generates the aforementioned integrated requirements data 323. First, when the integrated requirements data generation command prompt 322 is input to the large-scale language model 200, the large-scale language model 200 extracts each of the multiple text words from each of the first requirements data to the n requirements data contained in the integrated requirements data generation command prompt 322, selects at least one specific text word from among the multiple text words whose number is greater than or equal to a preset threshold, and generates the integrated requirements data 323 by referring to the at least one specific text word.
[0071] As an example, let's assume that n is 3, the first requirement data includes the sentence "Please plot the sales breakdown for the 12 months in a time-series graph," the second requirement data includes the sentence "Please plot the sales distribution up to yesterday in a pie chart," and the third requirement data includes the sentence "Please predict the sales breakdown for this month by combining the sales distribution up to yesterday, and plot it in a pie chart." At this time, the large-scale language model 200 extracts each of the text words included in the first requirement data (e.g., "December", "Sales", "Breakdown", "Time Series", "Graph", "Please draw"), the text words included in the second requirement data (e.g., "Yesterday", "Sales", "Distribution", "Graph", "Please draw"), and the text words included in the third requirement data (e.g., "Yesterday", "Sales", "Distribution", "This month", "Sales", "Breakdown", "Forecast", "Graph", "Please draw"), and from all the extracted text words, it can generate integrated requirement data 323 (e.g., "Please draw a graph of sales data including all of the following requirements") by referring to at least a portion of at least one specific text word (e.g., "Sales", "Yesterday", "Graph", "Please draw") whose number is equal to or greater than a predetermined threshold (assuming the threshold is "2").
[0072] Once the integrated requirements data 323 is generated by the large-scale language model 200 as described above, the AI agent 100 can generate a candidate result code data generation command prompt 324 that instructs the large-scale language model 200 to generate candidate result code data 325. At this time, the candidate result code data generation command prompt 324 may include, as shown in Figure 3b, (i) integrated requirements data 323, (ii) candidate result code data generation request data (for example, "Please create data that can handle all of the following requirements") that requests the large-scale language model 200 to generate candidate result code data 325 by referring to the integrated requirements data 323, (iii) first requirement data to nth requirement data, and (iv) first initial code data to nth initial code data. When the candidate result code data generation command prompt 324 is generated, the AI agent 100 can input it to the large-scale language model 200, which can then use the large-scale language model 200 to generate candidate result code data 325 for the integrated requirements data 323 by referring to the candidate result code data generation command prompt 324. Once the candidate result code data 325 is generated as described above, the AI agent 100 can verify whether the generated candidate result code data 325 was generated appropriately, and this will be explained with reference to Figure 3c for a specific explanation.
[0073] Figure 3c shows the sequence of processes for validating candidate result code data.
[0074] Referring to Figure 3c, the AI agent 100 can generate a verification request prompt 326, which is an input prompt that instructs the AI agent 200 to verify the candidate result code data 325 using the large-scale language model 200. At this time, the verification request prompt 326 may include, as shown in Figure 3c, (i) candidate result code data 325, (ii) verification request data that instructs the AI agent 200 to verify the candidate result code data 325 using the large-scale language model 200 (for example, "Please use the above code data to confirm whether a response is possible or not for each of the first requirement data to the nth requirement data"), (iii) improvement data generation request items (for example, "If it is not possible, please also tell us how to improve it"), and (iv) first requirement data to the nth requirement data. A specific explanation of the improvement data generation request items will be given later. When the verification request command prompt 326 is generated, the AI agent 100 inputs it to the large-scale language model 200 and uses the large-scale language model 200 to verify the candidate result code 325 by checking whether a response is possible or not for each of the first requirement data to the n requirement data, based on the verification request data and using the candidate result code data 325.
[0075] In this case, if the number of unresponsive cases is less than a predetermined percentage, the large-scale language model 200 can determine that the candidate result code data 325 will be validated, and if the number of unresponsive cases is equal to or greater than the predetermined percentage, it can determine that the candidate result code data 325 will not be validated. Below, we will sequentially provide a detailed explanation of the cases in which the candidate result code data 325 has not been validated, and a detailed explanation of the cases in which the candidate result code data 325 has been validated.
[0076] First, when it is determined that the candidate result code data 325 is unverified, the AI agent 100 can generate an improved requirements data generation command prompt 328, which is an input prompt that causes the large-scale language model 200 to generate improved requirements data 329 using the improved data 327 and integrated requirements data 323 that the large-scale language model 200 has generated based on the improved data generation request. At this time, the improved requirements data generation command prompt 328 may include, as shown in Figure 3c, (i) integrated requirements data 323, (ii) improved data 327, and (iii) improved requirements data generation request data (for example, "Please extend the existing requirements based on the improved data and write them in a format that can be input into the LLM") that causes the large-scale language model 200 to generate improved requirements data 329 based on the integrated requirements data 323 and the improved data 327. When the improved requirements data generation command prompt 328 is generated, the AI agent 100 can input it to the large-scale language model 200, causing the large-scale language model 200 to generate improved requirements data 329 based on the improved requirements data generation request data.
[0077] Thus, once the improved requirements data 329 is generated, the AI agent 100 can use the large-scale language model 200 to regenerate and validate candidate result code data using the improved requirements data 329. This validation process for candidate result code data is repeated until it is determined that the regenerated candidate result code data is validated.
[0078] Next, we will specifically describe the case in which the candidate result code data 325 is validated. Once the candidate result code data 325 is validated, the AI agent 100 can generate the candidate result code data 325 as integrated result code data for the integrated requirements data 323, and register the integrated requirements data 323 and the integrated result code data in the code library 500. In addition, the AI agent 100 can also, through the large-scale language model 200, pair the integrated requirements data 323 and the integrated result code data in a searchable form and register this pair in the code library 500.
[0079] The integrated requirement data 323 and integrated result code data registered in the code library 500 may later be used to generate response data for new requirement data entered by a specific user, more specifically, to generate new result code data for generating response data, and this will be explained with reference to Figure 3d for a specific explanation.
[0080] Figure 3d illustrates a series of processes that generate new result code data for new requirement data obtained from a specific user, by referencing specific integrated result code data stored in a code library.
[0081] As shown in Figure 3d, when a specific user inputs new request data 331 (for example, "I want a pie chart of yesterday's sales"), the AI agent 100 can, through the large-scale language model 200, retrieve specific integrated result code data from the code library 500 that corresponds to specific integrated request data similar to the new request data 331. Then, using the specific integrated result code data and the new request data 331, the AI agent 100 can generate a new result code data generation command prompt 332, which is an input prompt that causes the large-scale language model 200 to generate new result code data 333. At this time, the new result code data generation command prompt 332 may include (i) the new request data 331 and (ii) the specific integrated result code data, as shown in Figure 3d. Once the new result code data generation command prompt 332 is generated, the AI agent 100 can input it into the large-scale language model 200 and cause the large-scale language model 200 to generate the new result code data 333.
[0082] In this way, once the new result code data 333 is generated, the AI agent 100 can use the new result code data 333 to generate response data for the new request data 331 and provide it to a specific user.
[0083] The embodiments of the present invention described above are implemented in the form of program instructions that can be executed through various computer components and may be recorded on a computer-readable recording medium. The computer-readable recording medium may include program instructions, data files, data structures, etc., individually or in combination. The program instructions recorded on the computer-readable recording medium may be specially designed and configured for the present invention, or they may be known and available to those skilled in the art in the field of computer software. Examples of computer-readable recording media include magnetic media such as hard disks, floppy disks, and magnetic tapes, optical recording media such as CD-ROMs and DVDs, magneto-optical media such as floptical disks, and hardware devices specially configured to store and execute program instructions, such as ROMs, RAMs, and flash memory. Examples of program instructions include not only machine code, such as that produced by a compiler, but also high-level language code that can be executed by a computer using an interpreter or the like. The hardware devices may be configured to operate as one or more software modules to perform the processing according to the present invention, and vice versa.
[0084] Although the present invention has been described above with specific details such as concrete components, and with limited embodiments and drawings, these are provided only to aid in a more overall understanding of the invention, and the invention is not limited to the above embodiments. A person with ordinary skill in the art to which the invention pertains can make various modifications and variations from this description.
[0085] Therefore, the concept of the present invention should not be limited to the embodiments described above, and all modifications equivalent to or equivalent to the claims described below shall also fall within the scope of the concept of the present invention.
Claims
1. A method for efficiently generating new code data by a Technical Intelligence (AI) agent comprising at least one memory and at least one processor connected to the memory, through categorization of user requirements and creation of a library of result code data, (a) When at least one chat log data recording an interaction between the user and the AI agent is obtained, the processor decomposes the at least one chat log data into interaction units to generate chunk data, extracts each of the requirement data and each of the initial code data for each of the chunk data through a large language model, embeds each of the requirement data to generate each of the requirement embedding vectors, and stores each of the requirement data, each of the initial code data, and each of the requirement embedding vectors in a chunk database. (b) The processor clusters the requirement embedding vectors stored in the chunk database to generate at least one cluster for each requirement, retrieves from the chunk database first requirement data corresponding to a first requirement embedding vector to nth requirement data corresponding to an nth requirement embedding vector (where n is an integer of 2 or more) that are included in any one cluster of a preset threshold size or larger, generates integrated requirement data encompassing the first requirement data to the nth requirement data through the large-scale language model, generates candidate result code data for the integrated requirement data through the large-scale language model, verifies the candidate result code data using the first requirement data to the nth requirement data through the large-scale language model, and, once the candidate result code data has been verified, generates the candidate result code data as integrated result code data for the integrated requirement data, and registers the integrated requirement data and the integrated result code data in the code library. (c) When new requirement data is obtained from a specific user, the processor obtains specific integrated result code data from the code library through the large language model that corresponds to specific integrated requirement data similar to the new requirement data, generates new result code data by referencing the new requirement data and the specific integrated result code data, generates response data for the new requirement data using the new result code data, and provides it to the specific user. A method that includes this.
2. In step (b) above, The method according to claim 1, characterized in that the processor, through the large-scale language model, checks whether each of the first requirement data to the nth requirement data is responsive or not using the candidate result code data, determines that the candidate result code data will be verified if the number of unresponsive cases is less than a preset percentage, and determines that the candidate result code data will not be verified if the number of unresponsive cases is equal to or greater than the preset percentage.
3. In step (b) above, The method according to claim 2, characterized in that, if the candidate result code data is not validated, the processor generates improved requirement data corresponding to at least one improvement data for the unresponsive case (the improvement data is generated by the large-scale language model when the candidate result code data is validated) through the large-scale language model, and regenerates and validates the candidate result code data using the improved requirement data through the large-scale language model.
4. The method according to claim 3, characterized in that the processor inputs the integrated requirements data and the improvement data into the large-scale language model, and uses the large-scale language model to generate the improved requirements data by referring to the improvement data and the integrated requirements data.
5. In step (b) above, The method according to claim 1, characterized in that the processor inputs the integrated requirements data, the first requirements data to the nth requirements data, and the first initial code data to the nth initial code data corresponding to the first requirements data into the large language model, and uses the large language model to generate the candidate result code data for the integrated requirements data by referring to the first requirements data, the first initial code data to the nth requirements data, and the nth initial code data.
6. In step (b) above, The method according to claim 1, characterized in that the processor uses the large-scale language model to extract each of a plurality of text words from each of the first requirement data to the n requirement data, selects at least one specific text word from the plurality of text words whose number is greater than or equal to a preset threshold, and generates the integrated requirement data by referring to the at least one specific text word.
7. In step (a) above, The method according to claim 1, characterized in that, if the chat log data is generated by multiple turns, the processor decomposes the chat log data turn by turn to generate the chunk data, and if the chat log data is generated by multiple loops, the processor decomposes the chat log data loop by loop to generate the chunk data.
8. In step (b) above, The method according to claim 1, characterized in that the processor performs clustering on the requirement embedding vectors when the number of requirement embedding vectors stored in the chunk database exceeds a predetermined number.
9. In step (b) above, The method according to claim 1, characterized in that the processor places each of the requirement embedding vectors on a reference vector space, arbitrarily generates a predetermined number of initial center points for initial clusters (the predetermined number being the total number of clusters for each requirement) on the reference vector space, calculates the distance between each of the initial center points and each of the requirement embedding vectors, generates the predetermined number of initial clusters by matching each of the requirement embedding vectors with each of the initial center points that are closest to each of the requirement embedding vectors by referring to the calculated distances, calculates the average value of each coordinate of each embedding vector included in each of the initial clusters for each of the initial clusters, determines each of the cluster center points for each of the initial clusters for each of the initial clusters, and generates each of the clusters for each requirement by matching each of the requirement embedding vectors with each of the cluster center points that are closest to each of the requirement embedding vectors.
10. The method according to claim 1, characterized in that the clusters for each requirement are generated using one of the following: a k-means clustering algorithm, a k-medoid algorithm, a k-medians clustering algorithm, a hierarchical clustering algorithm, a mean-shift clustering algorithm, and a density-based nonparametric clustering algorithm (DBSCAN).
11. In an AI agent that efficiently generates new code data by categorizing user requirements and creating a library of result code data, One or more memory locations for storing instructions, Includes one or more processors configured to execute the aforementioned instructions, in which case, (I) When the processor obtains at least one chat log data recording an interaction between a user and an AI agent, it decomposes the at least one chat log data into interaction units to generate chunk data, extracts each of the requirement data and initial code data for each of the chunk data through a large-scale language model, embeds each of the requirement data to generate each of the requirement embedding vectors, and stores each of the requirement data, each of the initial code data, and each of the requirement embedding vectors in a chunk database; (II) Clusters the requirement embedding vectors stored in the chunk database to generate at least one cluster for each requirement, obtains from the chunk database the first requirement data corresponding to the first requirement embedding vector or the nth requirement data corresponding to the nth requirement embedding vector (where n is an integer of 2 or more) that is included in any one cluster of a preset threshold size or larger, and the large-scale language model (III) An AI agent that performs the following processes: (III) when new requirement data is obtained from a specific user, it obtains specific integrated requirement code data from the code library that corresponds to specific integrated requirement data similar to the new requirement data through the large language model, it obtains new result code data by referring to the new requirement data and the specific integrated result code data, and it obtains response data for the new requirement data using the new result code data and it obtains response data for the new requirement data using the new result code data.
12. In the above process (II), The AI agent according to claim 11, characterized in that the processor, through the large-scale language model, checks whether a response is possible or not for each of the first requirement data to the nth requirement data using the candidate result code data, determines that the candidate result code data will be verified if the number of unresponsive cases is less than a preset percentage, and determines that the candidate result code data will not be verified if the number of unresponsive cases is equal to or greater than the preset percentage.
13. In the above process (II), The AI agent according to claim 12, characterized in that, if the candidate result code data is not validated, the processor generates improved request data corresponding to at least one improvement data for the unresponsive case (the improvement data is generated by the large-scale language model when the candidate result code data is validated) through the large-scale language model, and regenerates and validates the candidate result code data using the improved request data through the large-scale language model.
14. The AI agent according to claim 13, characterized in that the processor inputs the integrated requirements data and the improvement data to the large-scale language model, and uses the large-scale language model to generate the improved requirements data by referring to the improvement data and the integrated requirements data.
15. In the above process (II), The AI agent according to claim 11, characterized in that the processor inputs the integrated requirements data, the first requirements data to the nth requirements data, and the first initial code data to the nth initial code data corresponding to the first requirements data into the large language model, and uses the large language model to generate the candidate result code data for the integrated requirements data by referring to the first requirements data, the first initial code data to the nth requirements data, and the nth initial code data.
16. In the above process (II), The AI agent according to claim 11, characterized in that the processor uses the large-scale language model to extract each of a plurality of text words from each of the first requirement data to the n requirement data, selects at least one specific text word from the plurality of text words whose number is greater than or equal to a preset threshold, and generates the integrated requirement data by referring to the at least one specific text word.
17. In the above process (I), The AI agent according to claim 11, characterized in that, if the chat log data is generated by multiple turns, the processor decomposes the chat log data turn by turn to generate the chunk data, and if the chat log data is generated by multiple loops, the processor decomposes the chat log data loop by loop to generate the chunk data.
18. In the above process (II), The AI agent according to claim 11, characterized in that the processor performs clustering of the request embedding vectors when the number of request embedding vectors stored in the chunk database exceeds a predetermined number.
19. In the above process (II), The AI agent according to claim 11, characterized in that the processor places each of the requirement embedding vectors on a reference vector space, arbitrarily generates a predetermined number of initial center points for initial clusters (the predetermined number being the total number of clusters for each requirement) on the reference vector space, calculates the distance between each of the initial center points and each of the requirement embedding vectors, generates the predetermined number of initial clusters by matching each of the requirement embedding vectors with each of the initial center points that are closest to each of the requirement embedding vectors by referring to the calculated distances, calculates the average value of each coordinate of each embedding vector included in each of the initial clusters for each of the initial clusters, determines each of the cluster center points for each of the initial clusters for each of the initial clusters, and generates each of the clusters for each requirement by matching each of the requirement embedding vectors with each of the cluster center points that are closest to each of the requirement embedding vectors.
20. The AI agent according to claim 11, characterized in that the clusters for each requirement are generated using one of the following: a k-means clustering algorithm, a k-medoid algorithm, a k-medians clustering algorithm, a hierarchical clustering algorithm, a mean-shift clustering algorithm, and a density-based nonparametric clustering algorithm (DBSCAN).
Citation Information
Patent Citations
Parameter collection and automatic dialog generation in dialog systems
US20200111486A1
Generative content service with multi-path content pipeline
US20250217371A1
Systems and methods for large language model based device and network management and automation
US20250307542A1