Using external tool invocation, a system and method for dynamic context expansion and knowledge structure construction of a large language model agent
The system addresses LLM limitations by dynamically expanding context using external tool calls, enhancing semantic interpretation and information extraction accuracy through continuous knowledge management.
Patent Information
- Application Number
- KR1020250210312
- Authority / Receiving Office
- KR · KR
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2025-12-26
- Publication Date
- 2026-11-05
- Estimated Expiration
- 2045-12-26
AI Technical Summary
Large Language Models (LLMs) face limitations in knowledge recency and context due to reliance on pre-trained data, failing to reflect new information and struggle with domain-specific semantic relationships, leading to inaccurate and incomplete inference results.
A system and method for dynamic context expansion using external tool calls, including an input interface, agent control unit, tool calling unit, and context expansion unit, and knowledge system constructor, which actively invoke external tool calls to supplement context and construct a structured knowledge system.
Enhances semantic interpretation and information extraction accuracy by integrating external tools, ensuring knowledge recency and domain adaptability, improving response quality and efficiency through continuous knowledge accumulation and management.
Smart Images

Figure 112025147078211-PAT00001_ABST
Abstract
Description
Technology Field
[0001] The present invention relates to a system and method for dynamic context expansion and knowledge system construction of a large-scale language model agent using external tool calls. Background Technology
[0003] With the recent advancements in Natural Language Processing (NLP) and Large Language Models (MLM), technologies for automatically extracting product attributes or metadata from unstructured text are becoming widespread. However, Large Language Models (LMs) suffer from limitations in knowledge recency, failing to reflect the latest information since the time of training, and a lack of context due to short, fragmentary inputs. Furthermore, in specialized domains such as e-commerce, healthcare, and law, it is difficult to accurately interpret complex semantic relationships using only a single model.
[0004] For this reason, the static processing method relying solely on LLM has limitations, and a new approach is needed to dynamically expand context and supplement knowledge by utilizing external tools such as web search or database queries.
[0005] The information described above disclosed in the background technology of this invention is intended only to enhance understanding of the background of the present invention and may therefore include information that does not constitute prior art. The problem to be solved
[0007] The technical problem that the present invention aims to solve is to provide a system and method for dynamic context expansion and knowledge system construction that improves the semantic interpretation capability and information extraction accuracy of text-based data by having an LLM agent actively call external tools such as web search, database query, API call, and file analyzer to dynamically expand the incomplete context of input text and construct the expanded context into a structured knowledge system.
[0008] However, the technical problems that the present invention aims to solve are not limited to those described above, and other unmentioned problems can be clearly understood by those skilled in the art from the description of the invention below. means of solving the problem
[0010] A system for dynamic context expansion and knowledge system construction of a large-scale language model agent using external tool calls according to an embodiment of the present invention for solving the above technical problem comprises: an input interface unit that receives a query in text form; an agent control unit that interprets the intent of the query and establishes a tool selection and execution plan; a tool calling unit that calls an external tool to obtain information; a context expansion unit that constructs a context by combining the query and the call result of the external tool; a knowledge system construction unit that stores the expansion result of the context; and a task execution unit that generates and outputs metadata using the expansion result of the context and the constructed knowledge.
[0011] In one embodiment, the input interface unit performs preprocessing to remove at least one of unnecessary symbols, special characters, and formal noise included in the query and to unify the language expression.
[0012] In one embodiment, the input interface unit converts the query into a standardized input format in JSON format.
[0013] In one embodiment, the input interface unit analyzes the expression pattern and contextual features of the query and classifies them into task types for information retrieval, fact verification, attribute extraction, and summarization.
[0014] In one embodiment, the agent control unit selects the type of the external tool by considering the subject of the query, domain characteristics, and whether there is a need for recency.
[0015] In one embodiment, the agent control unit establishes an execution plan including the order of calling each external tool and the method of combining the call results when calling a plurality of external tools.
[0016] In one embodiment, the agent control unit records and manages intermediate results and final results generated during the query processing process on a session basis.
[0017] In one embodiment, the tool calling unit calls at least one of a search engine API, a public data API, a database API, and a functional aid tool.
[0018] In one embodiment, the tool calling unit normalizes information obtained from the external tool into an integrated format including content, source, and time information.
[0019] In one embodiment, the context extension unit calculates the relevance of the call result of the external tool using a weighting model that reflects semantic similarity, source reliability, recency, and information growth.
[0020] In one embodiment, the context extension unit removes or summarizes information with low relevance and assigns tags corresponding to product name, brand, function, and period to the core concept.
[0021] In one embodiment, the knowledge system constructor stores the expansion result of the context as an object-unit knowledge snapshot.
[0022] In one embodiment, the knowledge system constructor converts the expanded result of the context into a vector form to enable semantic similarity-based search and stores it, and manages the association relationships between tags in a graph-shaped indexing structure.
[0023] A method for dynamic context expansion and knowledge system construction of a large-scale language model agent using external tool calls according to an embodiment of the present invention comprises: (a) receiving a query in text form and determining the purpose of the query by analyzing the expression pattern and contextual features of the query; (b) selecting an external tool that needs to be called based on the purpose of the query and establishing an execution plan including the order of calling the external tool and a method of combining the call results; (c) calling the external tool according to the execution plan to obtain external information corresponding to the query; (d) applying a weighting model reflecting semantic similarity, source reliability, recency, and information growth amount to the external information to calculate the relevance of the information and expanding the context of the query based on the evaluation result; (e) converting the expanded context into object-unit knowledge snapshots and vector-based representations and storing them, and constructing a knowledge system including association relationships between tags; and (f) generating metadata using the expanded context and the constructed knowledge system and outputting the generated result in a structured form.
[0024] In one embodiment, step (a) performs preprocessing to remove unnecessary symbols, special characters, and formal noise included in the query and to unify the language expression.
[0025] In one embodiment, step (b) selects the external tool by considering the domain characteristics of the query, whether recency is required, and the level of specificity of the information.
[0026] In one embodiment, step (b) establishes a multi-stage execution plan in which whether to call a subsequent tool or the order of calls is determined based on the result of calling a preceding tool.
[0027] In one embodiment, step (d) quantitatively calculates the contribution of newly acquired information by comparing the context before and after the external tool call.
[0028] In one embodiment, step (e) assigns a tag corresponding to at least one of a product name, brand, function, and period to the extended context, and stores the association relationships between the tags in the form of a graph.
[0029] In one embodiment, step (f) structures the metadata into JSON format and provides it to an external system. Effects of the invention
[0031] According to the present invention, since the LLM is not limited to internal training data but can acquire information by directly calling various external tools such as web searches, public APIs, and databases, it can effectively overcome the limitations associated with the model's knowledge update timeline (cutoff date). Accordingly, it can generate more accurate responses regarding new data, new terms, and information on new products, and can provide highly reliable results even in domains where timeliness is critical, such as product information, news, and policies.
[0032] Furthermore, the present invention enables the interpretation of information within a broader contextual scope by expanding the context through the combination of input queries and the results of external tool calls. Rather than simply generating responses based on input text, it simultaneously improves semantic consistency and inference accuracy by considering auxiliary information obtained from external sources. As a result, it becomes possible to provide responses utilizing rich background knowledge even for incomplete or ambiguous inputs that existing LLMs could not fully understand.
[0033] According to the present invention, information collected from the outside is evaluated based on complex criteria such as relevance, reliability, recency, and information growth, thereby performing a refined knowledge integration process rather than simple information merging. As a result, noise data or redundant information is effectively removed, and only substantially meaningful information is reflected in the expanded context. Consequently, the quality of the context itself is improved, and the reliability of the information accumulated in the knowledge repository can be continuously maintained.
[0034] According to the present invention, efficient context management and reusability are ensured by storing and managing extended contexts in object units, such as products, people, and topics, rather than making them dependent on a single query. Accordingly, existing contexts can be reused when querying the same target repeatedly, significantly improving processing efficiency and response consistency. Furthermore, knowledge search and reference speeds are improved through a tag-based management structure, and memory usage and token consumption can be effectively reduced.
[0035] According to the present invention, by reflecting task performance results or user feedback in a knowledge repository, an autonomous performance enhancement structure is formed in which an LLM agent improves its context selection method or tool utilization strategy. Based on this structure, the system becomes able to perform progressively more sophisticated information selection and reasoning over time, and the overall response quality is continuously improved.
[0036] According to the present invention, it is not limited to a specific domain and can be widely applied to various business environments, such as product metadata extraction, document summarization, question and answer, fact verification, and report generation. In particular, the tool calling unit and the context extension unit are designed to easily add new APIs or data sources, thereby providing excellent scalability and maintainability of the system.
[0037] The present invention fundamentally improves upon the knowledge limitations, inefficiencies, and accuracy issues inherent in existing static language model-based systems by integrally implementing a structure for ensuring the knowledge recency of LLM, expanding context and enhancing interpretability, managing information quality, improving knowledge reuse efficiency, and enhancing autonomous performance. Through this, the present invention provides a technical foundation as an intelligent knowledge-expanding LLM agent system that simultaneously improves the quality and efficiency of large-scale text-based data processing.
[0038] However, the effects obtainable through the present invention are not limited to those described above, and other unmentioned technical effects will be clearly understood by those skilled in the art from the description of the invention below. Brief explanation of the drawing
[0040] The following drawings attached to this specification illustrate embodiments of the present invention and serve to further enhance understanding of the technical concept of the present invention together with the detailed description of the invention provided below; therefore, the present invention should not be interpreted as being limited only to the matters described in such drawings. FIG. 1 illustrates a system for dynamic context expansion and knowledge system construction of a large-scale language model agent using external tool calls according to an embodiment of the present invention. FIG. 2 illustrates a method for dynamic context expansion and knowledge system construction of a large-scale language model agent using an external tool call according to an embodiment of the present invention. FIG. 3 is a block diagram showing a computer system for implementing a method according to an embodiment of the present invention. Specific details for implementing the invention
[0041] An embodiment of the present invention will be described in detail below with reference to the attached drawings. Prior to this, terms and words used in this specification and claims should not be interpreted as being limited to their ordinary or dictionary meanings. Instead, based on the principle that the inventor can appropriately define the concept of a term to best describe their invention, they should be interpreted in a meaning and concept consistent with the technical spirit of the present invention. Therefore, the embodiments described in this specification and the configurations illustrated in the drawings are merely partial embodiments of the present invention and do not represent all of the technical spirit of the present invention. It should be understood that various equivalents and modifications capable of replacing them may exist at the time of filing this application.
[0042] Additionally, as used herein, “comprise, include” and / or “comprising, including” specify the presence of the mentioned features, numbers, steps, actions, parts, elements, and / or groups thereof, and do not exclude the presence or addition of one or more other features, numbers, actions, parts, elements, and / or groups.
[0043] Additionally, to aid in understanding the invention, the attached drawings are not drawn to actual scale, and the dimensions of some components may be exaggerated. Furthermore, the same reference numerals may be assigned to identical components in different embodiments.
[0044] Although terms such as "first," "second," etc., are used to describe various components, it goes without saying that these components are not limited by these terms. These terms are used merely to distinguish one component from another, and unless specifically stated otherwise, the first component may also be the second component.
[0045] Throughout the specification, unless specifically stated otherwise, each component may be singular or plural.
[0046] As used herein, the term “and / or” includes any and all combinations of one or more of the associated listed items. Additionally, the use of “may” when describing embodiments of the invention relates to “one or more embodiments of the invention.” Expressions such as “one or more” and “one or more” preceding a list of elements modify the entire list of elements and do not modify individual elements of the list.
[0047] Throughout the specification, "A and / or B" means A, B, or A and B unless specifically stated otherwise, and "C to D" means C or more and D or less, unless specifically stated otherwise.
[0048] When syntax such as "at least one of A, B, and C", "at least one of A, B, or C", "at least one selected from the group of A, B, and C", or "at least one selected from A, B, and C" is used to specify a list of elements A, B, and C, the syntax can refer to any suitable combination.
[0049] The term "use" may be considered synonymous with the term "utilize." As used herein, terms such as "substantially," "about," and similar terms are used as terms of approximation rather than degree, and are intended to account for the inherent variation of a measured or calculated value that would be recognized by a person skilled in the art.
[0050] The terms used in this specification are for describing embodiments of the invention and are not intended to limit the invention.
[0052] Below, the background of the proposed invention is explained, and embodiments of the invention are described.
[0053] With the recent rapid advancement of Natural Language Processing (NLP) technology, data analysis, information extraction, and knowledge processing techniques utilizing Large Language Models (LLMs) are being widely employed across various industries. In particular, there are active attempts to automatically extract structured metadata from unstructured text data, such as product descriptions, user reviews, news articles, reports, and contracts; this metadata includes product attributes, SKU information, categories, key features, and brand information. This approach is attracting attention for providing much more flexible and general-purpose processing capabilities compared to conventional rule-based systems or model approaches optimized for a single purpose.
[0054] However, existing LLM-based approaches contain structural and fundamental limitations. First, large-scale language models face fundamental constraints on their limited knowledge horizon due to their reliance on pre-trained data. Since most LLMs are trained using data collected up to a specific point in time, they fail to reflect information regarding new products, concepts, terms, policies, or trends that have emerged since training. Consequently, problems frequently arise in tasks such as extracting information on new products, analyzing current issues, and identifying attributes requiring timeliness, leading to the generation of inaccurate or incomplete inference results.
[0055] Furthermore, existing LLM-based processing methods rely heavily on the amount of information contained in the input text itself, leading to frequent context deficiency issues. In many cases, input text is provided in a very short or fragmentary form, making it difficult to obtain sufficient semantic clues from such text alone. For instance, text like "Galaxy S24 Ultra" alone does not contain key meta-information such as detailed product specifications, release date, product category, or positioning. In such cases, extracting complete and reliable information is virtually impossible without combining external knowledge sources, such as web search results, product databases, and brand information.
[0056] Furthermore, while large-scale language models possess strengths in general language comprehension, they have limitations in domain adaptability for specific industrial sectors or specialized domains. In fields such as e-commerce, healthcare, law, and finance, technical terms, domain-specific concepts, and inter-document reference relationships are often intricately intertwined, and there are limitations to accurately interpreting these structures using only a single text input. In particular, existing standalone LLM structures fail to deliver sufficient performance when grasping deep semantic relationships in text-based data or comprehensively interpreting information scattered across multiple documents.
[0057] For this reason, static processing methods relying solely on large-scale language models have limitations in fully interpreting the deep context of text data and reliably extracting high-quality metadata. Therefore, a new mechanism is required that enables LLM to actively utilize various external knowledge sources. For instance, an approach is needed that supplements insufficient information by invoking external tools such as web search, database queries, document navigation, and API queries, and based on this, expands and reconstructs the context of the input text.
[0058] Ultimately, existing technologies have limitations in that LLMs lack the ability to interact with the external environment and independently search for and utilize necessary information; therefore, as a technological advancement to overcome these limitations, a new approach to dynamic context expansion and knowledge utilization structures through the invocation of external tools is required.
[0060] Preferred embodiments of the present invention will be described in detail below with reference to the attached drawings. The present invention relates to the field of knowledge expansion and utilization technology based on a Large Language Model (LLM), and more specifically, to a system and method that enables an LLM to supplement incomplete context inherent in input text and dynamically acquire new knowledge by actively calling external tools such as web search, database query, API call, and file analyzer. Furthermore, the present invention provides a technology that does not limit the use of the context expanded through the calling of external tools to simple one-time information, but rather structures it to build and manage it as a knowledge system, thereby making it reusable for various downstream tasks such as information extraction, classification, summarization, and metadata generation.
[0061] According to an embodiment of the present invention, a large-scale language model (LLM) agent improves semantic interpretation capabilities and information extraction accuracy for text-based data by actively calling various external tools, such as web search, database query, API request, and file analyzer, to overcome inherent limitations such as lack of knowledge recency, limitations in contextual understanding, and reduced domain adaptability, dynamically expanding the incomplete context of the input text based on the acquired information, and constructing and managing the expanded context into a structured knowledge system.
[0062] In addition, the LLM agent according to an embodiment of the present invention does not stop at generating a simple one-time response to information obtained through external tool calls, but accumulates and manages it in the form of an internal knowledge graph or vector-based repository to form a reusable knowledge system, and operates as an autonomous knowledge expansion agent that continuously produces consistent and highly reliable results even in domain-specific environments by utilizing the knowledge system thus constructed for various tasks such as product metadata extraction, document summarization, and information classification.
[0064] FIG. 1 illustrates a system for dynamic context expansion and knowledge system construction of a large-scale language model agent using external tool calls according to an embodiment of the present invention. According to an embodiment of the present invention, a large-scale language model (LLM) agent actively calls an external tool to supplement the incomplete context of an input text and constructs the expanded context into a structured knowledge system, thereby enabling the performance of various tasks.
[0065] A system for dynamic context expansion and knowledge system construction of a large-scale language model agent using external tool calls according to an embodiment of the present invention comprises an input interface unit (100), an agent control unit (200), a tool call unit (300), a context expansion unit (400), a knowledge system construction unit (500), and a task execution unit (600).
[0066] The input interface unit (100) is a component that receives a text-based query from a user or an external system and provides a starting point for processing according to the present invention, and operates on the premise of input in the minimum unit, such as a single sentence, a combination of keywords, or a brief name. The input interface unit (100) is not limited to input in the form of an entire document or a paragraph, but is designed to enable subsequent processing even for short and incomplete text inputs. To this end, it removes unnecessary symbols, special characters, redundant expressions, or formal noise included in the received query and performs a minimal preprocessing process to unify the language expression. The preprocessed query is converted into a standardized input format, such as JSON format or a prompt structure, so that the LLM can interpret it stably thereafter, and a semantic preservation-based conversion may be applied so that the core meaning of the query is not lost during this process. In addition, the input interface unit (100) analyzes the contextual characteristics and expression patterns of the query to automatically classify what type of task the query corresponds to, such as information search, fact verification, attribute extraction, or summarization, and transmits the classification result to the agent control unit (200). Accordingly, the agent control unit (200) can pre-set a tool calling strategy and processing flow suitable for the purpose of the query, and the present invention provides a technical effect that improves the efficiency and accuracy of subsequent context expansion and knowledge building processes beyond simple input collection through such query purpose classification function.
[0067] The agent control unit (200) comprehensively analyzes the query transmitted from the input interface unit (100) and the purpose classification result for the query to interpret the semantic intent and processing purpose of the query. The agent control unit (200) does not stop at merely grasping the surface meaning of the query, but also considers the scope of information required by the query, the level of accuracy, whether recency is required, and domain characteristics to determine whether an external tool call is necessary, and if necessary, determines what type of external tool to use. At this time, the agent control unit (200) can perform tool selection by combining predefined rule-based judgment logic, past query processing history, or inference results from LLM, and can dynamically generate different tool call strategies depending on the situation even for the same type of query. In addition, if it is necessary to use multiple external tools, the agent control unit (200) controls multi-stage inference and information expansion flow rather than a single-stage call by establishing an execution plan that includes the order in which each tool is called and how each call result is combined. Accordingly, the present invention features an autonomous control structure in which external tool calls do not remain merely auxiliary functions but are flexibly adjusted according to the purpose and context of the query, thereby substantially improving the consistency and efficiency of the context expansion and knowledge system construction processes.
[0068] The agent control unit (200) first analyzes the subject and purpose of the input query in detail and automatically selects the most suitable external tool to process the query. The agent control unit (200) performs tool selection by comprehensively considering the core keywords, domain characteristics, temporal requirements, and the level of specificity of information included in the query. For example, for a query such as "weekly temperature change in Seoul," it can control the selection of a public weather information API by reflecting information characteristics that require recency and reliability. On the other hand, for a query such as "key specifications of a newly released product," it is configured to call a search engine API or a product database, thereby enabling the acquisition of the latest product information from multiple sources. This tool selection process may be performed based on predefined rules, or, in cases where the complexity or uncertainty of the query is high, it may be determined dynamically by reflecting the inference results within the LLM. Accordingly, the agent control unit (200) can flexibly apply different tool calling strategies depending on the situation even for the same type of query, and the present invention improves the accuracy and efficiency of utilizing external information simultaneously through this adaptive tool selection structure.
[0069] Additionally, the agent control unit (200) performs an execution plan function that pre-designs the order in which a plurality of selected external tools will be called and how the results obtained from each tool call will be combined and utilized. The agent control unit (200) automatically generates a multi-stage processing flow rather than a single call by considering the complexity of the query, the step-by-step dependency relationship of the required information, and the form of subsequent tasks. For example, it can dynamically establish a step-by-step processing procedure such as "Search → Summarize → Structure," which involves first obtaining relevant information through a search engine, summarizing the search results, and then restructuring the summarized content to organize it into a knowledge form. Such an execution plan is not limited to a fixed scenario, and the order of calls or processing steps can be flexibly changed according to the nature of the query or the intermediate processing results. Through this, the present invention implements a sequential context expansion structure that reflects the inference flow, rather than limiting the external tool calls to simple parallel processing.
[0070] Furthermore, the agent control unit (200) performs a session management function that records and manages intermediate and final results generated during the query processing process on a session basis. By grouping tool call history, intermediate inference results, extended context state, and final response for each query into a single session, the agent control unit (200) maintains the continuity and consistency of information occurring within the same query flow. Accordingly, when repeated or similar requests occur within the same session, previously generated results can be referenced or reused to reduce unnecessary external tool calls or redundant operations. Additionally, through this session management function, the agent control unit (200) can adjust the processing strategy for subsequent queries based on previous processing results and generate more consistent and stable responses even in a continuous interaction environment where the context between queries is maintained. Thus, the present invention improves both efficiency and response quality simultaneously, going beyond a one-time query processing structure to continuous conversation or repetitive analysis scenarios.
[0071] The tool calling unit (300) operates under the control of the agent control unit (200) and serves as an interface that interacts with various external tools so that the LLM can directly acquire external knowledge or data, rather than being limited to internal knowledge. The tool calling unit (300) is configured to integrally support multiple tools with different characteristics and purposes, such as search engine APIs, public data APIs, internal database or knowledge repository (510) APIs, calculators, and functional auxiliary tools such as translators. Through this, the LLM can selectively perform various forms of external processing, such as searching for the latest information, querying structured data, performing numerical calculations, and language conversion, depending on the nature of the query. Each tool call is made through a standardized request structure such as JSON-RPC or REST format, and the tool calling unit (300) abstracts differences in communication methods or response formats for each tool, enabling the LLM and upper modules to utilize external tools in a consistent manner. In addition, responses received from each external tool are normalized into an integrated result format including "content," "source," and "time information" and transmitted to the context expansion unit (400). During this process, the source identification information and time information of the response are maintained together, so that they can be utilized later for evaluating information reliability or determining recency. Accordingly, the present invention configures the external tool call to function not merely as a means of acquiring information, but as a core data input path for context expansion and knowledge system construction, thereby simultaneously ensuring consistency and scalability in the utilization of external information.
[0072] The context expansion unit (400) performs the function of constructing an expanded context that the LLM can utilize by combining external information obtained through the input query and the tool call unit (300). The context expansion unit (400) does not simply list external information or mechanically merge it, but rather includes a process of quantitatively and qualitatively evaluating the value and reliability of each collected piece of information and reconstructing it into semantic units. To this end, the context expansion unit (400) first integrates results collected from multiple external tools, removes duplicate information with identical or similar content and information with low direct relevance to the purpose of the query, and records source information and the chronological order according to the time of acquisition for each piece of information. This source and time information is subsequently used as a standard for judging information reliability and evaluating recency.
[0073] The context expansion unit (400) applies a weight-based evaluation model that reflects semantic similarity, source reliability, recency, and information increase amount to evaluate the usefulness of each piece of information. For example, relevance can be calculated in the form of Relevance = α·Semantic Similarity + β·Source Reliability + γ·Recency + δ·Information Increase Amount, where each weight α, β, γ, and δ can be dynamically adjusted according to the task type or domain characteristics. At this time, the information increase amount is an indicator that quantitatively evaluates how much meaningful additional information newly acquired knowledge provides compared to the existing context by comparing the difference in response before and after the tool call, and serves to distinguish between simple repetitive information or restatement of existing knowledge and the acquisition of substantial new information. Accordingly, the context expansion unit (400) can construct an expanded context centered on the quality of information rather than the quantity of information, and the present invention supports LLM to perform inference and task execution based on a more refined and reliable context through such an information value evaluation-based context expansion structure.
[0074] The context expansion unit (400) removes or briefly summarizes information of relatively low importance based on the previously calculated information importance evaluation results, and manages key concepts that form the core meaning of the query by assigning tags such as product name, brand, function, and period. This tag assignment process can be performed as a semantic classification process to clearly identify which object or topic each piece of information belongs to, going beyond simple keyword extraction. Through this, the context expansion unit (400) can effectively compress the length of the entire context while maintaining core information essential for subsequent inference or task execution. Furthermore, the expanded context configured in this way is designed to be managed cumulatively at the level of specific objects or topics, rather than being dependent on a single query. Accordingly, the results of multiple queries performed at different points in time or contexts regarding the same product, person, or region are integrated into a single object unit, and a context profile containing comprehensive background knowledge and attribute information regarding the object is formed. Through this object-unit context accumulation structure, the present invention implements a dynamic knowledge expansion environment capable of long-term knowledge accumulation and reuse, going beyond the accuracy of individual query processing.
[0075] The knowledge system building unit (500) performs the function of storing and managing the expanded context generated by the context expansion unit (400) in the form of structured knowledge. The knowledge system building unit (500) forms a reusable and expandable knowledge structure by systematically organizing the expanded context by breaking it down into object units, tag units, and relationship units, rather than storing it as a simple set of text. To this end, the knowledge system building unit (500) may include a knowledge snapshot function that stores the state of the expanded context at a specific point in time as a single object unit, thereby allowing the past context to be referenced or compared during subsequent query processing or task execution. Additionally, the knowledge system building unit (500) enables rapid retrieval of semantically similar information by converting and storing the expanded context in a vector form, and strengthens the connectivity of knowledge by topic or type by managing the association between tags in a graph-shaped relational indexing structure. Accordingly, the present invention prevents the expanded context from being lost as one-time information and converts it into a knowledge asset that can be continuously accumulated and utilized, thereby improving the long-term reasoning ability and task execution performance of the LLM agent.
[0076] The knowledge system building unit (500) forms a knowledge base that can be reused in various tasks by systematizing, storing, and managing the expanded context generated by the context expansion unit (400) from a temporal and object perspective. Specifically, the knowledge system building unit (500) groups the context state at a specific point in time into object units and stores it in the form of a knowledge snapshot, thereby enabling the distinction or comparison of past and current contexts for the same object for reference. Additionally, the knowledge system building unit (500) reflects the semantic characteristics of the expanded context and converts and stores it in a vector form, thereby enabling the rapid search and reuse of semantically similar contexts when a new query is input. Furthermore, the knowledge system building unit (500) stores the association relationships between tags such as product name, brand, function, and period in a graph-shaped relational indexing structure, thereby configuring the system so that related knowledge is naturally connected by topic or type. Accordingly, the present invention goes beyond the simple accumulation of individual information to implement a three-dimensional knowledge structure that simultaneously considers the time axis and the semantic axis, thereby supporting an LLM agent to perform more sophisticated and consistent reasoning and task execution based on the accumulated knowledge.
[0077] The task execution unit (600) is a step that performs actual work unit tasks by utilizing the expanded context generated through the context expansion unit (400) and the structured knowledge system stored in the knowledge system construction unit (500). The task execution unit (600) selectively references appropriate contexts and knowledge elements according to the purpose of the query and the type of task, and derives specific processing results such as information extraction, classification, summarization, and metadata generation based on this. For example, in the case of a product information extraction task, it retrieves context profiles of related object units based on inputs such as product name or category, and automatically generates structured metadata by synthesizing attribute information, brand information, and key features included in the context. In this task execution process, the task execution unit (600) is not limited to a single context, but can improve the completeness and consistency of the results by referencing multiple knowledge snapshots or similar vector information as needed. The generated task execution results can be returned in a structured form such as JSON, and may be transmitted to an external system or a subsequent processing module depending on the application environment. Accordingly, the present invention provides an execution layer that connects extended context and accumulated knowledge to actual business performance, thereby enabling the LLM agent-based knowledge extension structure to have substantial application value.
[0078] Through this configuration, the present invention enables a Large-Scale Language Model (LLM) to move beyond a structure that relies on internally limited static knowledge and to actively explore and utilize external knowledge sources. By allowing an LLM agent to selectively invoke necessary external tools based on the purpose and context of a query to acquire new information, and by quantitatively evaluating the extent to which this information provides meaningful expansion compared to the existing context based on the amount of information increase, the invention enables value-oriented context expansion rather than simple information accumulation. Furthermore, through a tag-based context management structure and an object-unit knowledge accumulation method, the invention ensures that expanded context is continuously accumulated and managed rather than consumed as a one-time event, thereby enabling efficient and consistent information utilization even in situations involving repetitive queries on the same object or topic. Moreover, based on these structural characteristics, the invention realizes an autonomous knowledge expansion framework widely applicable to various data processing and information extraction tasks, such as product information extraction, document analysis, information classification, and metadata generation. This enables the LLM agent to function as an intelligent system that independently expands knowledge and performs inference and task execution based on it.
[0080] FIG. 2 illustrates a method for dynamic context expansion and knowledge system construction of a large-scale language model agent using external tool calls according to an embodiment of the present invention. The method according to an embodiment of the present invention is not a one-time processing flow that generates a simple response to an input query, but rather has a cyclic processing structure that analyzes the purpose of the query, expands the context by utilizing external knowledge sources stepwise, accumulates the expanded information as structured knowledge, and then utilizes it again for task execution. Specifically, the method according to the present invention identifies the meaning and processing purpose of the query in the query input and purpose analysis step (S210), determines an external tool suitable for the query and the order of calls in the external tool selection and call plan establishment step (S220), and secures necessary external information through the external tool call and information acquisition step (S230). Subsequently, in the information value evaluation and context expansion step (S240), the usefulness and contribution of the acquired information are quantitatively evaluated to expand the context of the input query, and in the knowledge structuring and knowledge system construction step (S250), the expanded context is converted into knowledge at the object unit and relationship unit levels and accumulated. In the task execution and result generation step (S260), actual tasks such as information extraction, classification, and summarization are performed using the knowledge system and expanded context thus constructed, and the results are generated in a structured form. Through this stepwise processing flow, the present invention implements an autonomous LLM agent processing method that combines dynamic context expansion based on external tool calls with continuous knowledge accumulation.
[0081] In the query input and purpose analysis step (S210), a query in text form is input from a user or an external system. The query input in the query input and purpose analysis step (S210) may be in a brief form at the level of a single sentence or keywords, or it may be an incomplete input that does not include the entire document or a complete description. The input query undergoes a preprocessing process to remove unnecessary symbols, special characters, or formal noise, and is normalized into a form suitable for subsequent processing by unifying linguistic expressions and sentence structures. Additionally, in the query input and purpose analysis step (S210), the expression style, core keywords, semantic patterns, and contextual clues included in the query are analyzed to determine what type of task the query is intended to perform, such as information search, fact verification, attribute extraction, or summarization. This analysis of the purpose of the query is not limited to simple classification results but is utilized as reference information to determine the scope of information required for query processing, the level of accuracy, and the dependency on external information; the result is subsequently used as a key input to determine the tool call strategy and processing flow in the external tool selection and execution plan establishment stage (S220).
[0082] In the external tool selection and call plan establishment step (S220), external tools necessary for resolving the query are automatically selected based on the topic, purpose, and processing requirements of the query derived in the query input and purpose analysis step (S210). In the external tool selection and call plan establishment step (S220), the agent determines the most suitable tool among various external tools, such as search engine APIs, public data APIs, database APIs, and file analyzers, by comprehensively considering the nature of the information required by the query, whether timeliness is required, and whether the data is structured or unstructured. Additionally, if multiple external tools are required, an execution plan is established that includes the order in which each tool will be called and how the results obtained from each tool call will be combined and processed to be delivered to the next stage. This execution plan is not limited to a simple parallel call structure and may include a conditional or stepwise processing flow in which the decision to call subsequent tools or the order of calls varies depending on the call results of the preceding tool. In this case, the call plan may be generated according to predefined rules, or, if the complexity or uncertainty of the query is high, it may be dynamically generated by reflecting the internal inference results of the LLM. Accordingly, the present invention provides an adaptive call planning structure capable of flexibly adjusting external tool utilization strategies according to query type and context, thereby simultaneously improving the efficiency of external information utilization and the accuracy of processing results.
[0083] In the external tool calling and information acquisition step (S230), the selected external tool is actually called according to the execution plan established in the external tool selection and calling plan establishment step (S220), and external information corresponding to the query is acquired. In the external tool calling and information acquisition step (S230), external tools with different characteristics, such as search engine APIs, public data APIs, database APIs, and file analyzers, are called in a planned order, and each tool call is performed through a standardized request structure. Furthermore, the information received from each external tool is not maintained in a simple raw data form, but is normalized and managed into a common structure that includes content, source, and time information. Through this, information collected from different tools can be compared and analyzed based on the same criteria, and is utilized as foundational data to evaluate the reliability, timeliness, and contribution of the information in subsequent steps. Moreover, by maintaining the source traceability and temporal context of the external information through this normalization process, the present invention systematically prepares external information in a form suitable for context expansion and knowledge system construction, going beyond simple information collection.
[0084] In the information value assessment and context expansion step (S240), quantitative evaluation centered on the usefulness and reliability of the information is performed on the information collected through the external tool call and information acquisition step (S230), rather than simple merging or listing, and the context of the input query is expanded based on the evaluation results. Specifically, in the information value assessment and context expansion step (S240), a weighted evaluation model reflecting semantic similarity, source reliability, recency, and information growth is applied to each piece of information to calculate the relevance of the information. Here, semantic similarity indicates the semantic proximity between the input query and the external information; source reliability reflects the credibility or trust level of the information provider; and recency is an indicator that considers the time of creation or update of the information. Additionally, information growth is an indicator that quantitatively evaluates how much substantial semantic expansion newly acquired information provides compared to the existing context by comparing the context before and after the external tool call; it is used as a criterion to distinguish between duplicate information and new information. Based on the results of this evaluation, highly relevant information is retained or reflected in the expanded context, while less relevant information is removed or summarized, thereby efficiently managing the length of the context while preserving key information. Accordingly, the present invention implements a structure that expands the context based on the quality of information rather than the quantity of information, thereby enabling LLM to perform inference and task execution based on a more refined and reliable context.
[0085] In the knowledge structuring and knowledge system construction stage (S250), the expanded context generated through the information value assessment and context expansion stage (S240) is converted into a reusable and systematic knowledge form and stored. In the knowledge structuring and knowledge system construction stage (S250), the expanded context is not maintained as a simple bundle of text but is organized into object units such as products, people, places, and topics, and can be stored in the form of one or more knowledge snapshots. This allows the context state at a specific point in time to be referenced or compared in subsequent tasks. Additionally, the semantic characteristics of the expanded context are converted into vector-based representations and stored. Accordingly, when a new query is entered, existing similar contexts or knowledge can be quickly explored and reused through semantic similarity-based searching. Furthermore, during the knowledge structuring process, the associations between tags are organized into a graph-shaped relational indexing structure based on the tags assigned in the context expansion stage, thereby constructing a knowledge system in which related knowledge is organically connected by topic or type. Accordingly, the present invention provides a technical foundation that enables an LLM agent to perform long-term reasoning and advanced tasks by converting the expanded context into a knowledge asset that is continuously accumulated and connected along temporal and semantic axes, rather than depleting it as a one-time processing result.
[0086] In the task execution and result generation step (S260), actual tasks are performed by comprehensively utilizing the knowledge system constructed through the knowledge structuring and knowledge system construction step (S250) and the expanded context formed in the information value evaluation and context expansion step (S240). In the task execution and result generation step (S260), task execution is not limited to generating an immediate response to a single query, but is performed by referencing knowledge snapshots accumulated at the object level, vector-based similar contexts, and relationship information between tags together. For example, in the case of an information extraction task, object-level knowledge related to the input query is prioritized for retrieval, and metadata such as attributes, brands, and key features is automatically generated based on the context accumulated in the corresponding object. Furthermore, in the case of summarization or classification tasks, more consistent and accurate results can be derived by considering related knowledge accumulated in the past together, rather than relying solely on a single input text. The results of task execution are generated in a structured form such as JSON and provided to an external system or utilized in subsequent analysis and processing processes. Accordingly, the present invention realizes the practical application value of an autonomous knowledge expansion structure by providing an execution layer where accumulated knowledge is connected to actual business performance.
[0087] According to an embodiment of the present invention, a Large Language Model (LLM) agent actively invokes external tools based on the purpose and context of a query to dynamically expand the incomplete context inherent in the input query, and selects and refines the information obtained during the expansion process based on information value assessment, and then accumulates it into a systematic knowledge structure. Furthermore, the knowledge system thus constructed is not limited to a single task but is repeatedly referenced and utilized during the execution of various tasks, thereby enabling the LLM agent to move beyond a one-time response generation model and implement an autonomous processing flow in which it expands its knowledge independently and performs inference based on it. Accordingly, the present invention provides a method of operation for an intelligent LLM agent capable of continuously enhancing context and knowledge through interaction with an external environment.
[0089] FIG. 3 is a block diagram showing a computer system for implementing a method according to an embodiment of the present invention.
[0090] Referring to FIG. 3, a computer system (1300) may include at least one of a processor (1310), memory (1330), an input interface device (1350), an output interface device (1360), and a storage device (1340) that communicate via a bus (1370). The computer system (1300) may also include a communication device (1320) coupled to a network. The processor (1310) may be a central processing unit (CPU) or a semiconductor device that executes instructions stored in memory (1330) or storage device (1340). Memory (1330) and storage device (1340) may include various forms of volatile or non-volatile storage media. For example, memory may include read-only memory (ROM) and random access memory (RAM). In the embodiments of this description, memory may be located inside or outside the processor, and memory may be connected to the processor through various known means. Memory is a volatile or non-volatile storage medium of various forms, and for example, memory may include read-only memory (ROM) or random access memory (RAM).
[0091] Accordingly, embodiments of the present invention may be implemented as a method implemented on a computer or as a non-transient computer-readable medium storing computer-executable instructions. In one embodiment, when executed by a processor, the computer-readable instructions may perform a method according to at least one aspect of the present description.
[0092] The communication device (1320) can transmit or receive wired or wireless signals.
[0093] In addition, the method according to an embodiment of the present invention may be implemented in the form of program instructions that can be executed through various computer means and may be recorded on a computer-readable medium.
[0094] The above computer-readable medium may include program instructions, data files, data structures, etc., either individually or in combination. The program instructions recorded on the computer-readable medium may be specially designed and configured for embodiments of the present invention, or they may be known and available to a person skilled in the art of computer software. The computer-readable recording medium may include a hardware device configured to store and execute program instructions. For example, the computer-readable recording medium may be 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; ROM; RAM; flash memory, etc. The program instructions may include not only machine code, such as that generated by a compiler, but also high-level language code that can be executed by a computer through an interpreter, etc.
[0095] Although the present invention has been described above with reference to limited embodiments and drawings, the present invention is not limited thereto, and it is obvious that various modifications and variations are possible within the scope of the technical spirit of the present invention and the equivalent scope of the claims described below by those skilled in the art to which the present invention belongs.
Claims
Claim 1 A system for dynamic context expansion and knowledge system construction of a large-scale language model agent using external tool calls, comprising: an input interface unit that receives a text-based query; an agent control unit that interprets the intent of the query and establishes a tool selection and execution plan; a tool calling unit that calls an external tool to obtain information; a context expansion unit that constructs a context by combining the query and the call result of the external tool; a knowledge system construction unit that stores the expansion result of the context; and a task execution unit that generates and outputs metadata using the expansion result of the context and the constructed knowledge, wherein the context expansion unit manages the context cumulatively in object units including products, people, and topics without making the context dependent on a single query, and forms a context profile by integrating the expansion results of multiple queries performed at different times into a single object unit, and the knowledge system construction unit reuses the previously constructed context profile when repeated queries are made on the same object. Claim 2 In claim 1, the input interface unit performs preprocessing to remove at least one of unnecessary symbols, special characters, and formal noise included in the query and unify the language expression, a system for dynamic context expansion and knowledge system construction of a large-scale language model agent using external tool calls. Claim 3 In claim 1, the input interface unit converts the query into a standardized input format in JSON format, a system for dynamic context expansion and knowledge system construction of a large-scale language model agent using an external tool call. Claim 4 In claim 1, the input interface unit analyzes the expression pattern and contextual features of the query and classifies them into task types for information retrieval, fact verification, attribute extraction, and summarization, a system for dynamic context expansion and knowledge system construction of a large-scale language model agent using external tool calls. Claim 5 In claim 1, the agent control unit selects the type of the external tool by considering the subject of the query, domain characteristics, and whether there is a need for recency, a system for dynamic context expansion and knowledge system construction of a large-scale language model agent using an external tool call. Claim 6 A system for dynamic context expansion and knowledge system construction of a large-scale language model agent using external tool calls, wherein, in claim 1, the agent control unit establishes an execution plan including the order of calls for each external tool and the method of combining the call results when calling a plurality of the external tools. Claim 7 In claim 1, the agent control unit is a system for dynamic context expansion and knowledge system construction of a large-scale language model agent using external tool calls, which records and manages intermediate and final results generated during the query processing process on a session basis. Claim 8 In claim 1, the tool calling unit calls at least one of a search engine API, a public data API, a database API, and a functional aid tool, a system for dynamic context expansion and knowledge system construction of a large-scale language model agent using an external tool call. Claim 9 In claim 1, the tool calling unit normalizes information obtained from the external tool into an integrated format including content, source, and time information, a system for dynamic context expansion and knowledge system construction of a large-scale language model agent using an external tool calling. Claim 10 In claim 1, the context extension unit calculates the relevance of the call result of the external tool using a weighting model that reflects semantic similarity, source reliability, recency, and information growth, in a system for dynamic context extension and knowledge system construction of a large-scale language model agent using an external tool call. Claim 11 In claim 1, the context extension unit is a system for dynamic context extension and knowledge system construction of a large-scale language model agent using external tool calls, which removes or summarizes information with low relevance and assigns tags corresponding to product name, brand, function, and period to core concepts. Claim 12 In claim 1, the knowledge system construction unit stores the result of the context expansion as an object-unit knowledge snapshot, a system for dynamic context expansion and knowledge system construction of a large-scale language model agent using an external tool call. Claim 13 In claim 1, the knowledge system construction unit converts the expansion result of the context into a vector form to enable semantic similarity-based search and stores it, and manages the association relationships between tags in a graph-shaped indexing structure, a system for dynamic context expansion and knowledge system construction of a large-scale language model agent using external tool calls. Claim 14 A method for dynamic context expansion and knowledge system construction of a large-scale language model agent using external tool calls performed by a computer system, comprising: (a) receiving a query in text form and determining the purpose of the query by analyzing the expression pattern and contextual features of the query; (b) selecting an external tool that needs to be called based on the purpose of the query and establishing an execution plan including the order of calling the external tool and a method of combining the call results; (c) calling the external tool according to the execution plan to obtain external information corresponding to the query; (d) applying a weighting model reflecting semantic similarity, source reliability, recency, and information growth to the external information to calculate the relevance of the information and expanding the context of the query based on the evaluation result; (e) converting the expanded context into object-unit knowledge snapshots and vector-based representations for storage and constructing a knowledge system including association relationships between tags; and (f) a step of generating metadata by utilizing the extended context and the constructed knowledge system, and outputting the generated result in a structured form, wherein step (e) accumulates and manages the extended context in object units including products, people, and topics without making the extended context dependent on a single query, integrates the extended context for multiple queries performed at different times into a single object unit to form a context profile, and reuses the previously constructed context profile when repeated queries are performed on the same object, a method for dynamic context extension and knowledge system construction of a large-scale language model agent using an external tool call. Claim 15 In claim 14, the above step (a) is a method for dynamic context expansion and knowledge system construction of a large-scale language model agent using an external tool call, wherein the step removes unnecessary symbols, special characters, and formal noise included in the above query and performs preprocessing to unify the language representation. Claim 16 In claim 14, the above step (b) is a method for dynamic context expansion and knowledge system construction of a large-scale language model agent using an external tool call, wherein the external tool is selected by considering the domain characteristics of the query, whether recency is required, and the level of specificity of the information. Claim 17 In claim 14, the above step (b) establishes a multi-stage execution plan in which whether to call a subsequent tool or the order of calls is determined according to the result of calling a preceding tool, a method for dynamic context expansion and knowledge system construction of a large-scale language model agent using external tool calls. Claim 18 In claim 14, the above step (d) is a method for dynamic context expansion and knowledge system construction of a large-scale language model agent using an external tool call, wherein the contribution of newly acquired information is quantitatively calculated by comparing the context before and after the external tool call. Claim 19 In claim 14, the above step (e) is a method for dynamic context expansion and knowledge system construction of a large-scale language model agent using an external tool call, wherein the tag corresponding to at least one of a product name, brand, function, or period is assigned to the expanded context, and the association relationship between the tags is stored in a graph form. Claim 20 In claim 14, the above step (f) is a method for dynamic context expansion and knowledge system construction of a large-scale language model agent using an external tool call, wherein the above metadata is structured in JSON format and provided to an external system.
Citation Information
Patent Citations
Retrieval enhancement generation method fusing dynamic adaptive prompt engineering and semantic enhancement
CN121166733A
Multilayer weight context integration system and method for generative artificial intelligence models
KR102901883B1
Enterprise generative artificial intelligence architecture
US20240202225A1
