A method and system for operating an AI agent based on pluggable multi-model access and cross-skill intelligent orchestration
Patent Information
- Application Number
- CN202611437342.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-16
- Publication Date
- 2026-10-20
AI Technical Summary
[0005]本发明提供一种基于多模型可插拔接入与跨技能智能编排的AI Agent运行方法及系统,以至少解决现有AI Agent模型接入耦合度高、跨技能编排依赖人工维护以及跨技能数据传递容易出错的问题
[0008]本发明的有益效果在于:提出了一种基于多模型可插拔接入与跨技能智能编排的AI Agent运行方法及系统,通过模型适配器声明信息建立模型能力集合,使不同模型提供方的接口差异被统一封装在模型适配器中,AI Agent的核心运行逻辑无需直接耦合特定模型提供方的接口格式。通过技能声明式配置信息建立技能契约集合,使技能触发条件、输入参数模式、输出结果模式、依赖关系、冲突关系和协同关系能够被编排过程显式识别。进一步地,通过输入参数模式和输出结果模式自动构建技能执行有向无环图,使技能执行顺序不再依赖人工硬编码维护。通过内存符号表对节点执行结果进行键名、数据类型、来源节点、时间戳和版本标识的记录,并在后续节点执行前进行反射注入,使跨技能数据传递具备类型约束和来源可追溯性。通过针对每一技能节点执行模型能力匹配,使不同子任务能够调用与其任务特征相适配的模型,从而提高AI Agent在多模型、多技能联合任务中的运行可靠性和执行效率。本发明能够降低模型接入耦合度,减少跨技能数据传递错误,并提高多技能任务的自动编排能力。
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence agent technology, and in particular to an AI agent operation method and system based on pluggable access to multiple models and intelligent orchestration across skills. Background Technology
[0002] AI agents are typically used to receive user task intents input in natural language and perform semantic understanding, task planning, tool invocation, content generation, and result feedback through large language models. With the development of large language models and the external tool ecosystem, AI agents are no longer limited to single-question-answering scenarios but are increasingly used in multi-step task execution scenarios, such as web page retrieval, document generation, code processing, table analysis, email sending, and cross-system business processing. Existing AI agent applications often embed the interfaces of specific model providers directly into the agent's core logic. Different model providers differ in request formats, authentication methods, streaming protocols, tool invocation paradigms, context organization, and response structures. When an AI agent needs to switch from one model provider to another, it usually requires modification of the adaptation code and call chain, resulting in high model switching costs. Especially within the same user task, different subtasks may have different model requirements. For example, long text processing requires a large context window, tool invocation tasks require function call capabilities, multimodal tasks require visual input capabilities, and low-complexity formatting tasks are more suitable for low-cost models. Existing methods struggle to perform fine-grained model selection at different nodes during task execution.
[0003] Regarding skill expansion, existing AI agents typically define skills as pre-defined functions, plugins, or tools, and register them through imperative code or static configuration. When a user task requires multiple skills to collaborate, the dependencies, input-output contracts, and execution order between skills usually need to be manually hard-coded and maintained. For example, file identifiers, search results, summary texts, or form numbers generated by a previous skill need to be explicitly passed to a subsequent skill. If the passed field names, data types, or contextual positions change, subsequent skills may fail to execute correctly. Furthermore, existing multi-skill orchestration methods often use fixed-order scripts or simple chained call structures, lacking the ability to automatically identify skill dependencies and struggling to identify skill nodes that can be executed in parallel. When there are conflicting, collaborative, or external service dependencies among multiple skills, existing methods usually require developers to manually configure the execution order and exception handling logic, resulting in insufficient flexibility in the AI Agent's operation, difficulty in error localization, and difficulty in ensuring data transmission consistency in scenarios with multiple models, multiple skills, and multiple intermediate data states.
[0004] Therefore, how to reduce the coupling of model access, reduce cross-skill data transmission errors, and improve the automatic orchestration capability of multi-skill tasks are technical problems that urgently need to be solved in the field of AI Agent operation technology. Summary of the Invention
[0005] This invention provides an AI Agent operation method and system based on pluggable access to multiple models and intelligent orchestration across skills, in order to at least solve the problems of high coupling of existing AI Agent model access, reliance on manual maintenance for cross-skill orchestration, and easy errors in cross-skill data transmission.
[0006] To achieve the above objectives, this invention provides an AIAgent operation method based on multi-model pluggable access and cross-skill intelligent orchestration, the method comprising the following steps: Read model adapter declaration information and skill declarative configuration information, and establish a model capability set based on the model adapter declaration information and a skill contract set based on the skill declarative configuration information; The task is decomposed based on the user's task intent, and candidate skill nodes are matched for each subtask based on the skill contract set to form a set of candidate skill nodes that includes input parameter patterns, output result patterns and skill dependencies. Based on the input parameter patterns and output result patterns of each candidate skill node in the candidate skill node set, dependency parsing is performed, a directed acyclic graph of skill execution is constructed, and a skill execution plan containing topological execution order and parallelizable node groups is generated based on the directed acyclic graph of skill execution. According to the skill execution plan, the current skill node to be executed is determined sequentially. Based on the task requirement information corresponding to the current skill node to be executed and the model capability set, the target model adapter is selected, and the execution input data is injected into the current skill node to be executed based on the memory symbol table. The target model adapter is invoked to execute the skill action corresponding to the currently executed skill node, the node execution result is obtained, and the node execution result is written into the memory symbol table according to the preset symbol entry structure until the skill execution plan is completed and the AI Agent running result is output.
[0007] To achieve the above objectives, the present invention also provides an AI Agent operation system based on multi-model pluggable access and cross-skill intelligent orchestration, comprising: A module is established to read model adapter declaration information and skill declarative configuration information, and to establish a set of model capabilities based on the model adapter declaration information and a set of skill contracts based on the skill declarative configuration information. The decomposition module is used to decompose tasks based on user task intent and match candidate skill nodes for each subtask based on the skill contract set to form a set of candidate skill nodes that includes input parameter patterns, output result patterns and skill dependencies. The construction module is used to perform dependency resolution based on the input parameter pattern and output result pattern of each candidate skill node in the candidate skill node set, construct a directed acyclic graph of skill execution, and generate a skill execution plan containing topological execution order and parallelizable node groups based on the directed acyclic graph of skill execution. The selection module is used to sequentially determine the current skill node to be executed according to the skill execution plan, select the target model adapter based on the task requirement information corresponding to the current skill node to be executed and the model capability set, and inject execution input data into the current skill node to be executed based on the memory symbol table; The calling module is used to call the target model adapter to execute the skill action corresponding to the currently executed skill node, obtain the node execution result, and write the node execution result into the memory symbol table according to the preset symbol entry structure until the skill execution plan is completed and the AI Agent running result is output.
[0008] The beneficial effects of this invention are as follows: It proposes an AI Agent operation method and system based on pluggable access to multiple models and intelligent cross-skill orchestration. A set of model capabilities is established through model adapter declaration information, unifying the interface differences of different model providers within the model adapter. The core operation logic of the AI Agent does not need to be directly coupled to the interface format of a specific model provider. A set of skill contracts is established through skill declarative configuration information, enabling explicit identification of skill triggering conditions, input parameter patterns, output result patterns, dependencies, conflict relationships, and collaborative relationships during the orchestration process. Furthermore, a directed acyclic graph of skill execution is automatically constructed through input parameter patterns and output result patterns, eliminating the need for manual hard-coding to maintain the skill execution order. A memory symbol table records the key name, data type, source node, timestamp, and version identifier of node execution results, and performs reflection injection before subsequent node execution, ensuring type constraints and source traceability for cross-skill data transfer. By performing model capability matching for each skill node, different subtasks can call models adapted to their task characteristics, thereby improving the reliability and execution efficiency of the AI Agent in multi-model, multi-skill joint tasks. This invention can reduce model access coupling, reduce cross-skill data transmission errors, and improve the automatic orchestration capability of multi-skill tasks. Attached Figure Description
[0009] Figure 1 This is a flowchart illustrating the AI Agent operation method based on pluggable access to multiple models and intelligent orchestration across skills, as described in an embodiment of the present invention.
[0010] Figure 2 This is a schematic diagram of task execution timing and parallel scheduling in an embodiment of the present invention.
[0011] Figure 3 This is a flow diagram of memory symbol table reflection injection in an embodiment of the present invention.
[0012] Figure 4 This is a schematic diagram of the structure of the AI Agent operating system based on multi-model pluggable access and cross-skill intelligent orchestration, according to an embodiment of the present invention. Detailed Implementation
[0013] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0014] This invention provides an AI Agent operation method based on pluggable multi-model access and cross-skill intelligent orchestration, referring to... Figure 1 In this embodiment, an AIAgent operation method based on multi-model pluggable access and cross-skill intelligent orchestration includes the following steps: S1: Read the model adapter declaration information and skill declarative configuration information, and establish a model capability set based on the model adapter declaration information and a skill contract set based on the skill declarative configuration information.
[0015] In this embodiment of the invention, the user's task intent can be provided by the user through text input, speech-to-text conversion, API calls, or business system event triggering. For example, a user can input "Help me search for the latest AI agent technology trends, compile them into a report, and send it to the team via email," or the task "Read this week's sales data, generate an analysis summary, and synchronize it to the collaboration system" can be triggered through the business system. Regardless of the input form of the user's task intent, the system converts it into intent text or structured intent objects that can be processed by the subsequent task decomposition process.
[0016] In this embodiment of the invention, the purpose of reading model adapter declaration information is to enable the AI Agent to identify currently available model resources. Model adapter declaration information can be stored in an adapter declaration file, a database configuration table, a registry center, or a remote configuration service. The model adapter declaration information at least describes the model provider identifier, adapter version, supported model list, authentication configuration information, and capability description information. Specifically, the model provider identifier is used to distinguish different model sources, such as cloud models, local models, or models deployed within an organization; the adapter version is used to determine whether the adapter is compatible with the current AI Agent's operating system; the supported model list lists one or more models that the adapter can call; the authentication configuration information enables the system to obtain the credentials required to access the corresponding model service at runtime; and the capability description information describes whether the model supports capabilities such as text input, image input, audio input, function calls, streaming output, and corresponding context length.
[0017] In practical applications, model adapter declaration information can be described using the following structured configuration: provider: Model provider A; adapterVersion: 1.0.0; models: Model A1, Model A2; auth: Key identifier, endpoint address; capabilities: Text, image, function call, context window, inference speed, cost level. It should be noted that the above example is only used to illustrate the possible structure of model adapter declaration information and does not limit the invention to using this field name or data format. Without changing the technical concept of loading the model adapter through declaration information and forming a set of model capabilities, it can also be stored using JSON, YAML, XML, database fields, or key-value tables.
[0018] In this embodiment of the invention, after reading the model adapter declaration information, the system loads a model adapter instance that implements the unified model interface. The unified model interface refers to a set of model call interfaces predefined within the AI Agent runtime system. This set of interfaces standardizes the calling methods exposed by different model adapters. The unified model interface may include an initialization interface, a standard dialogue call interface, a streaming dialogue call interface, an embedding vector generation interface, a visual capability judgment interface, a function call capability judgment interface, a context window acquisition interface, and a capability profile acquisition interface. Through the unified model interface, the differences between different model providers are confined within the model adapter, and the AI Agent's task orchestration logic does not need to directly handle the native request formats of each model provider.
[0019] Specifically, for a model provider that uses the `messages` field to organize its context, the model adapter can map the system's internal standard message list to the provider's `messages` field; for a model provider that uses the `contents` field to organize its context, the model adapter can convert the same standard message list to the `contents` field. Similarly, tool call formats, streaming output callback formats, and response parsing formats are all converted by the corresponding model adapters. Therefore, when the AI Agent needs to change its model or add a new model provider, it only needs to add or update the model adapter.
[0020] After the model adapter instances are loaded, the system initializes and performs availability checks on each instance. Initialization may include reading the key, configuring the service endpoint, establishing a connection pool, setting timeout thresholds, configuring default call parameters, and registering callback functions. Availability checks may include sending health check requests, executing lightweight model calls, reading model capability return values, or checking the status of external services. If a model adapter fails the availability check, the system can mark it as temporarily unavailable and exclude it from subsequent model selection processes. If a model adapter passes the availability check, the system extracts model capability information from that adapter and generates a model capability profile.
[0021] The model capability profile is the basic building block of the model capability set. Each model capability profile corresponds to a callable model and includes at least modal support information, context window information, function call support information, inference speed level, cost level, and health status information. Modal support information describes the input / output types supported by the model, such as text, image, or audio; context window information describes the maximum context length the model can handle; function call support information describes whether the model can call external tools in a structured tool call manner; inference speed level describes the model's response speed in typical tasks; cost level describes the cost of model invocation; and health status information describes whether the model is currently available. Furthermore, the model capability profile may also include runtime information such as current load, number of concurrent requests, failure rate, average latency, and organizational permission scope.
[0022] In this embodiment of the invention, the purpose of reading the declarative configuration information of skills is to enable the system to identify currently callable skills and the possible data relationships between skills. The declarative configuration information of skills can be stored in a declarative configuration file, a registry record, or a database configuration item. The declarative configuration information of skills includes at least the skill name, trigger information, input parameter pattern, output result pattern, external service dependency information, conflict relationship information, and cooperation relationship information. The skill name is used to identify the skill; the trigger information describes under what semantic conditions the skill is suitable to be invoked; the input parameter pattern describes the name, type, necessity, and meaning of the input data required when the skill is executed; the output result pattern describes the data structure generated after the skill is executed; the external service dependency information describes whether the skill depends on search services, email services, file systems, databases, or other external systems; the conflict relationship information describes which skills the skill should not be executed with; and the cooperation relationship information describes which skills the skill is suitable to be executed consecutively with.
[0023] In one executable implementation, the declarative configuration information for a web search skill may include the skill name `web_search`, trigger keywords (search, find, retrieve), input parameter patterns (`query` and `maxResults`), output result patterns (`results` and `searchTime`), external service dependency information (`search_api`), and collaboration relationship information (`content_summarizer`). The input parameter pattern for a content summarization skill may include `results`, and the output result pattern may include `summary_text`. The input parameter pattern for a report generation skill may include `summary_text`, and the output result pattern may include `report_path`. The input parameter pattern for an email sending skill may include `report_path` and `recipient`, and the output result pattern may include `send_status`. Through this declarative configuration information, the system can automatically discover dependencies such as: the data output by the web search skill can be used by the content summarization skill, and the data output by the content summarization skill can be used by the report generation skill.
[0024] It should be noted that the input parameter patterns and output result patterns in the embodiments of this invention are not limited to type definitions in a specific programming language, but can be JSON Schema, YAML structure, Protocol Buffers structure, database field definitions, or other methods that can describe data structures. The embodiments of this invention emphasize explicitly exposing data contracts of skills in a declarative manner.
[0025] After reading the declarative configuration information of skills, the system establishes a skill trigger index, a skill data contract index, and a skill relationship index, and associates these indexes to form a skill contract set. The skill trigger index is used to quickly find potentially matching skills based on user intent or subtask semantics; the skill data contract index is used to find skills that can provide or consume specific data based on input parameter patterns and output result patterns; and the skill relationship index is used to identify conflicting relationships, collaborative relationships, and external service dependencies between skills. By establishing the skill contract set, the system provides a computable data foundation for subsequent task decomposition, skill matching, and DAG orchestration.
[0026] This results in the output of a model capability set and a skill contract set. The model capability set is used for subsequent node-level model selection, while the skill contract set is used for subsequent task decomposition, candidate skill node matching, and construction of a directed acyclic graph for skill execution.
[0027] S2: Decompose the task based on the user's task intent, and match candidate skill nodes for each subtask based on the skill contract set to form a set of candidate skill nodes that includes input parameter patterns, output result patterns and skill dependencies.
[0028] In this embodiment of the invention, user task intent typically includes multiple actions, multiple objects, and multiple output requirements. If the entire task is directly handled by a single model or a single skill, it can easily lead to uncontrollable execution, untraceable intermediate data, and inability to pinpoint the specific failure point after task failure. Therefore, this embodiment of the invention first decomposes the user task intent into multiple sub-tasks with clear input and output requirements, and then matches executable skill nodes to each sub-task through a set of skill contracts.
[0029] Specifically, the system performs semantic parsing of the user's task intent, extracting the task objective, task object, output requirements, and constraints. The task objective refers to the action the user wishes to perform, such as searching, reading, summarizing, generating, sending, comparing, translating, or classifying. The task object refers to the data object affected by the task action, such as web page content, uploaded files, database records, technology trends, team contacts, or business forms. Output requirements refer to the desired result format, such as a report, summary, email body, file path, table, or structured JSON object. Constraints refer to the restrictions the user imposes on the execution process or result, such as being up-to-date, concise, sending to the team, using a low-cost model, requiring citations, or requiring output as a report file. By extracting the above information, the system forms the task intent characteristics.
[0030] In practical applications, task intent features can be structured fields, semantic vectors, or a combination of both. For example, for the task "Help me search for the latest AI agent technology trends, compile a report, and send it to the team via email," the system can identify that the task objectives include searching, compiling, generating a report, and sending an email; the task object is AI agent technology trends; the output requirements are the report and email sending status; and the constraints include "latest" and "sent to the team." Based on these task intent features, the system can decompose the user's task intent into a webpage search subtask, a content summary subtask, a report generation subtask, and an email sending subtask.
[0031] In this embodiment of the invention, each subtask has clearly defined input and output requirements. The input requirement for the web search subtask can be a search query term, and the output requirement can be an array of search results; the input requirement for the content summary subtask can be an array of search results, and the output requirement can be summary text; the input requirement for the report generation subtask can be summary text, and the output requirement can be a report file path or the report body; the input requirement for the email sending subtask can be a report file path, email body, and recipient information, and the output requirement can be the email sending status. By assigning clear input and output requirements to each subtask, subsequent skill matching and dependency resolution can be based on data contracts, rather than relying on manually specified calling order.
[0032] When matching candidate skill nodes for subtasks, the system first determines the first candidate skill that matches the semantics of the subtask based on the skill trigger index. For example, when the subtask objective includes "search," "find," or "retrieve," the web search skill will be determined as the first candidate skill; when the subtask objective includes "organize," "summarize," or "extract," the content summarization skill will be determined as the first candidate skill; and when the subtask objective includes "generate a report," the report generation skill will be determined as the first candidate skill. Subsequently, the system determines the second candidate skill that can meet the input and output requirements of the subtask based on the skill data contract index. For example, if a subtask requires output... The output result pattern contains The skill is more suitable as a second candidate skill; if a subtask requires input If the input parameter pattern contains an array, then the input parameter pattern includes... And the type is The skills mentioned are more suitable as candidate skills.
[0033] In one executable implementation, the system can use a skill matching function to rank candidate skills: ; in, Indicates the first Sub-tasks Indicates the first One skill; This indicates the keyword or trigger weight matching value between the subtask and the skill trigger information; This represents the data contract matching value between the subtask's input / output requirements and the skill input parameter pattern and output result pattern; This represents the semantic similarity between the subtask semantic vector and the skill description vector; , , This represents the weight coefficient of the corresponding matching factor. The above formula illustrates one implementation method of skill matching. In actual deployment, each weight can be adjusted according to the business scenario, the size of the skill library, or historical execution results.
[0034] Semantic similarity can be calculated in the following way: ; in, Indicates the first Semantic vectors of each subtask Indicates the first A skill description vector for each skill. Represents the dot product of two vectors. and These represent the magnitudes of the two vectors, respectively. Using this semantic similarity calculation method, the system can identify situations where the user's expression and skill description are not entirely consistent. For example, although phrases like "search for information online," "retrieve public information," and "find relevant content" are different, they may all have a high degree of similarity to the skill of web search.
[0035] It should be noted that the embodiments of the present invention do not limit task decomposition to be completed by a large language model. In other embodiments, a rule engine, an intent classification model, a workflow template matching model, or a combination of the above methods can be used to complete task decomposition. The key to the embodiments of the present invention is that the task decomposition result must form sub-tasks with clear input and output requirements, and the matching relationship between sub-tasks and skill nodes needs to be confirmed through a set of skill contracts.
[0036] At the end of step S2, the system forms a set of candidate skill nodes. Each candidate skill node carries a skill name, skill type, input parameter pattern, output result pattern, external service dependency information, conflict relationship information, and cooperation relationship information. The set of candidate skill nodes serves as the data foundation for subsequent DAG orchestration.
[0037] S3: Based on the input parameter pattern and output result pattern of each candidate skill node in the candidate skill node set, perform dependency parsing, construct a directed acyclic graph of skill execution, and generate a skill execution plan containing topological execution order and parallelizable node groups based on the directed acyclic graph of skill execution.
[0038] In this embodiment of the invention, step S3 is used to transform the candidate skill node set into an executable directed acyclic graph (DAG) for skill execution. A DAG represents the data dependencies and execution order between skill nodes. Nodes in the graph represent skill execution actions, and directed edges indicate that the output of one skill node can serve as the input data source for another skill node. By constructing a DAG, the system can automatically generate skill execution plans without requiring developers to pre-write fixed call chains.
[0039] Specifically, the system reads the input parameter pattern of each candidate skill node in the candidate skill node set and searches for data source nodes that can provide the corresponding input parameters in the output result patterns of other candidate skill nodes. Here, a data source node refers to a node whose output result can satisfy the requirement of a certain input parameter of the current node. For example, the content summarization skill requires input... Arrays, and web search skills output. If the array is used, then the web search skill can be identified as the data source node for the content summarization skill. The report generation skill requires input. The output of content summarization skills Then, the content summarization skill can be identified as the data source node for the report generation skill. The email sending skill requires input... The report generates skill output. If so, the report generation skill can be identified as the data source node for the email sending skill.
[0040] In this embodiment of the invention, the matching between input parameter patterns and output result patterns is not limited to identical field names. To improve the adaptability of cross-skill orchestration, the system can also make a comprehensive judgment based on parameter names, data types, semantic descriptions, and source paths. For example, the output field name of a certain skill is... The other skill input field is named If both data types are arrays and their semantic descriptions are both "search result list," the system can still determine that they satisfy a dependency relationship. For example, if the output field name of a skill is... The other skill input field is named If the semantic description of the output field is "path to the generated report file", the system can also use this output as the input source for subsequent report sending skills.
[0041] In one executable implementation, an input-output contract matching function can be used to determine whether a dependency edge is established between two skill nodes, expressed as follows: ; in, This represents the input parameters for a specific skill node. This represents the output parameters of another skill node; This indicates that the parameter name matches the value; Indicates a value that matches the parameter type; The parameter semantics describe the matched value; , , These represent the weighting coefficients for name, type, and semantic description, respectively. When... When the preset dependency determination conditions are met, the system determines the skill node to which the output parameter belongs as the data source node of the skill node to which the input parameter belongs, and establishes a directed dependency edge. It should be noted that this formula is only an example of a dependency resolution method. In other implementations, rule matching, type inference, semantic mapping tables, or machine learning models can also be used to complete the input-output contract matching.
[0042] After the system establishes initial dependency edges for candidate skill nodes, an initial skill execution graph is formed. This initial skill execution graph may contain conflicting nodes, redundant nodes, or circular dependencies. Therefore, the system further performs conflict detection and collaborative relationship identification on the initial skill execution graph based on the skill relationship index. Conflict detection is used to determine whether two or more skills should not appear in the same execution plan simultaneously. For example, if two skills attempt to modify the same target file and their outputs overlap, they can be identified as conflicting; similarly, if one skill requests to call external service A, and another skill requests to disable external service A in the same execution context, they can also be identified as conflicting. After a conflict is detected, the system can delete one of the skill nodes based on skill priority, user constraints, data contract integrity, or historical success rate, or replace it with an alternative skill node with the same output pattern.
[0043] Collaboration identification is used to determine whether two skills are suitable for sequential or combined execution. For example, web search skills and content summarization skills often have a collaborative relationship because the array of search results output by the web search skill is suitable as direct input to the content summarization skill; report generation skills and email sending skills may also have a collaborative relationship because the report path output by the report generation skill can be directly used for email attachment sending. After identifying the collaborative relationship, the system can either retain the sequential scheduling relationship in the skill execution plan or prioritize the model adapter that reduces context switching costs during the model selection phase.
[0044] After completing conflict detection and cooperative relationship identification, the system performs loop detection on the initial skill execution graph. A loop occurs when multiple skill nodes form a circular dependency, preventing any single node from serving as the starting point for execution. For example, if node A requires the output of node B, and node B requires the output of node A, a loop is formed. When a loop is detected, the system can remove low-priority dependency edges, mark a certain input parameter as requiring user input, or replace the skill node causing the loop with an alternative skill node. Through these methods, the system obtains a directed acyclic graph of skill execution that does not contain loops.
[0045] The directed acyclic graph of skill execution can be represented as: ; in, This represents a directed acyclic graph of skill execution. Represents a set of skill nodes. This represents the set of directed dependency edges between skill nodes. Each directed dependency edge... Represents skill nodes The output can be used as a skill node. The input data source. This directed acyclic graph not only expresses the execution order but also the data transfer path, thus providing a basis for subsequent memory symbol table injection.
[0046] Furthermore, such as Figure 2 As shown, the system generates skill execution plans based on a directed acyclic graph (DAG) of skill execution. Each skill execution plan includes at least a topological execution order and a group of parallelizable nodes. The topological execution order determines the execution order of skill nodes when dependencies are satisfied. For example, the web search skill must be executed before the content summarization skill, the content summarization skill must be executed before the report generation skill, and the report generation skill must be executed before the email sending skill. Groups of parallelizable nodes are used to mark skill nodes that do not have mutual dependencies at the same execution level. For example, if a task simultaneously requires retrieving web page data and reading local knowledge base data, and these two operations are independent, then the web page retrieval skill and the local document reading skill can be marked as the same group of parallelizable nodes. By identifying groups of parallelizable nodes, the system can reduce the overall task execution time.
[0047] When generating a skill execution plan, the system also associates and records each skill node with its input parameter pattern, output result pattern, candidate model requirement information, and preceding dependent nodes. Candidate model requirement information is used for subsequent model selection; for example, whether a node needs visual capabilities, a long context window, function call capabilities, sensitivity to response latency, and cost constraints. Preceding dependent nodes are used for subsequent memory symbol table lookup to ensure that the current node only uses symbol entries from its dependency paths.
[0048] Therefore, the output of step S3 is the skill execution plan. This skill execution plan records the task execution order, parallel execution opportunities, data dependency paths, and node model requirements in a unified manner.
[0049] S4: Determine the current skill node to be executed sequentially according to the skill execution plan, select the target model adapter based on the task requirement information corresponding to the current skill node to be executed and the model capability set, and inject execution input data into the current skill node to be executed based on the memory symbol table.
[0050] In this embodiment of the invention, step S4 is used to complete two key preparatory actions before the current skill node is executed: first, selecting a target model adapter for the current skill node to be executed; and second, extracting and injecting the execution input data required by the current skill node from the memory symbol table. Since different skill nodes may have different task complexity, input data types, context lengths, function call requirements, and cost requirements, this embodiment of the invention performs node-level model selection for each skill node in the skill execution plan. Because there are data transfer relationships between different skill nodes, this embodiment of the invention automatically completes reflection injection according to the input parameter pattern using the memory symbol table.
[0051] Specifically, the system determines the current skill node to be executed according to the skill execution plan. If there is only one skill node in the current execution level, then that skill node is designated as the current skill node to be executed. If the current execution level contains a group of parallelizable nodes, the system can perform model selection and input injection for multiple skill nodes in that group separately, and execute them in parallel when computational resources allow. After the current skill node to be executed is determined, the system reads the skill type, input parameter mode, output result mode, user task intent, and candidate model requirement information corresponding to that node, thereby extracting the node's task requirement information.
[0052] The node task requirements information includes at least the required modality, context length requirement, function call requirement, latency requirement, and cost constraint information. The required modality indicates whether the current node needs to process text, image, audio, or multimodal data. For example, image recognition skills require visual input capabilities, while text summarization skills primarily require text processing capabilities. The context length requirement indicates the scale of input data that the current node needs to process. For example, content summarization skills may require reading a large number of search results or long documents, thus requiring a high context length; email sending skills typically only need to process report summaries and recipient information, thus requiring a low context length. The function call requirement indicates whether the current node needs the model to participate in tool calls or structured function calls. For example, web search skills or database query skills typically require function call capabilities. The latency requirement indicates whether the current node needs a fast response. The cost constraint information indicates whether the system prioritizes low-cost models.
[0053] When selecting candidate models from the model capability set, the system first determines whether a model meets the basic capability conditions. For example, if the current node requires image input capability, models that do not support visual input will not be included in the candidate set; if the current node requires function call capability, models that do not support function calls will not be included in the candidate set; if the current node estimates that the length of the context to be processed exceeds a certain model context window, that model will also be excluded. After completing the basic screening, the system performs multi-factor matching on the remaining candidate models.
[0054] In one executable implementation, multi-factor matching can take the following form: ; in, Indicates the first One candidate model, This indicates the number of capability factors involved in the matching process. Indicates the first The weights of each ability factor Indicates the first The candidate model in the th The ability value on each ability factor This indicates that the skill node to be executed is at the [number]th [node]. The demand value on each task demand factor This represents the matching result between capability values and requirement values. The capability factors may include modal matching, context window, function call support, inference speed, and cost. For example, the modal matching weight can be set to 0.30, the context window weight to 0.20, the function call weight to 0.20, the inference speed weight to 0.15, and the cost weight to 0.15. It should be noted that the above weights are only used to illustrate one implementation of the invention and do not limit the invention to using fixed weights. In practical applications, the system can dynamically adjust the weights based on organizational strategies, task priorities, user preferences, or real-time resource status.
[0055] When the matching scores of multiple candidate models are close, the system can further combine model health status information and current load information to determine the target model. For example, when the difference in matching scores between two models is less than a preset threshold, the model with the lower number of current concurrent requests can be prioritized; when a model has a high recent failure rate, even if its capability matching score is high, its selection priority can be temporarily reduced. In this way, the selection of the target model adapter considers whether the model's capabilities meet the node task requirements, as well as runtime stability and load balancing.
[0056] After selecting the target model adapter, the system injects execution input data into the currently executed skill node based on the memory symbol table. The memory symbol table is a runtime data structure that stores intermediate results during a task execution. Each symbol entry includes at least a key name, data type, data value, source skill, source node, timestamp, and version identifier. The key name represents the data name, for example... , , Data type is used to represent data structures, such as strings, arrays, objects, or file paths; data value is used to store the actual intermediate results; source skill is used to indicate which skill generated the data; source node is used to indicate which node in the directed acyclic graph of skill execution generated the data; timestamp is used to indicate the time the data was generated; version identifier is used to distinguish different versions of data with the same name.
[0057] like Figure 3 As shown, in this embodiment of the invention, reflection injection refers to the system reading the input parameter pattern of the currently executed skill node, automatically searching for a matching symbol entry in the memory symbol table, and then filling the data value of the symbol entry into the execution input of the current skill node. This process does not require the user to manually specify the transmission path of each intermediate data, nor does it require developers to fix the parameter assignment statements between preceding and following skills in the code. For example, when the input parameter pattern of the content summarization skill requires... When creating an array, the system automatically looks up the key name in the memory symbol table. or Data type is Furthermore, the source node is a symbol entry located on the preceding dependency path of the content summarizing skill. If the lookup is successful, the data value of that symbol entry is injected into the execution input of the content summarizing skill.
[0058] When multiple injection candidate entries exist, the system can determine the target symbol entry based on key name matching, data type matching, source path matching, version identifier, and timestamp. The following candidate injection evaluation methods can be used: ; in, This represents a candidate symbol entry in the memory symbol table. Indicates the skill node currently pending execution; This indicates the data type matching result between the symbol entry and the input parameter pattern of the currently executed skill node; Indicates the result of key name or semantic name matching; This indicates the dependency path matching result between the source node of the symbol entry and the currently pending skill node; Indicates the freshness or version priority of a symbol entry; , , , This represents the weight coefficient of the corresponding evaluation item. Using this evaluation method, when multiple data entries with the same name or type exist in the memory symbol table, the system can prioritize the data that is from the correct source, of the same type, has the newest version, and is closest to the dependency path of the current node.
[0059] It should be noted that the memory symbol table can be stored in the memory of the AI Agent running server, or it can be stored in a distributed cache, session storage, temporary database, or task context object. In this embodiment of the invention, the memory symbol table is emphasized for its function of uniformly recording and reflecting the intermediate results during the execution of an AI Agent task, and it is not limited to physical storage in a single machine's memory.
[0060] In step S4, the currently executed skill node obtains the target model adapter and execution input data. The target model adapter is used to call the corresponding model service in the subsequent step S5, and the execution input data is used as input when the skill action is executed.
[0061] S5: Call the target model adapter to execute the skill action corresponding to the current skill node to be executed, obtain the node execution result, and write the node execution result into the memory symbol table according to the preset symbol entry structure until the skill execution plan is completed and the AI Agent running result is output.
[0062] In this embodiment of the invention, step S5 is used to complete the actual execution of the skill node, the structured processing of the node results, the writing of the memory symbol table, and the final output of the AI Agent running results. The skill node to be executed has already obtained the target model adapter and execution input data in step S4. Therefore, step S5 first generates a standardized model call request based on the execution input data, skill action parameters, and target model adapter of the current skill node. The standardized model call request is a unified request object within the system and may include a message list, model parameters, tool call description, streaming output identifier, context data, return format constraints, and skill action identifier.
[0063] Upon receiving a standardized model invocation request, the target model adapter converts it into the request format of the corresponding model provider. Different model providers may require different field structures and invocation methods. For example, some model providers require the use of the `messages` field to convey the dialogue context, while others require the use of the `contents` field. Some model providers place tool invocation information in the `tools` field, and others use a separate `functiondeclarations` field. The target model adapter converts the standardized model invocation request into the corresponding format according to its own implementation and sends the request to the model provider. After the model provider returns the raw response data, the target model adapter then converts the raw response data into a unified response structure within the system.
[0064] For skill nodes requiring streaming output, the target model adapter can gradually return model response fragments via callback functions, event streams, or message queues; for skill nodes not requiring streaming output, the target model adapter can return the result all at once after the model response is complete. Regardless of the response method used, the system parses and structures the model-returned data based on the output result pattern of the currently executing skill node. For example, the output result pattern of the web search skill requires... arrays and If the field is specified, the system will parse the original response into an array of search results and search time; the output result pattern of the content summarization skill requires... If the field is specified, the system will parse the content returned by the model into summary text; the output result mode of the report generation skill requires... If the field is specified, the system will store the generated report file path or report text in the corresponding field; the output result mode requirements for email sending skills are as follows. If the field is specified, the system will parse the email sending result into a status such as successful sending, failed sending, or waiting for retry.
[0065] After obtaining the node execution result, the system writes the result into a memory symbol table. A node execution result can correspond to one or more symbol entries. For example, after executing a web search node, it can be written to... and Two symbol entries; after the content summary node is executed, it can be written. Symbol entries; after the report generation node is executed, it can be written. and Symbol entries; these can be written after the email sending node is executed. and Symbolic entries. Each symbolic entry records the key name, data type, data value, source skill, source node, timestamp, and version identifier. By recording the source skill and source node, the system can trace the generation of a corresponding skill node from intermediate data; by recording the timestamp and version identifier, the system can distinguish different versions of data with the same name in parallel or repeated execution scenarios; by recording the data type, the system can avoid type mismatches during subsequent reflection injection.
[0066] When a skill execution plan includes a group of parallelizable nodes, the system can execute multiple independent skill nodes simultaneously. Since multiple parallel nodes may write data to the in-memory symbol table concurrently, the system can avoid data overwriting using the source node and version identifier. For example, two parallel retrieval nodes both generate... For typed data, the memory symbol table can record them separately. and Alternatively, it can record results from different sources under the same semantic meaning. When injecting subsequent aggregation nodes, the system can select one result based on the input parameter pattern and dependency path, or it can merge multiple results before injection. Therefore, this embodiment of the invention can maintain the consistency and traceability of cross-skill data in a parallel execution environment.
[0067] If the execution of the current skill node fails, the system can perform corresponding processing based on the reason for the failure. If the reason for the failure is a timeout of the target model service, an abnormal health status, or a triggering of a call restriction, the system can update the health status of the corresponding model in the model capability set and reselect a backup model adapter based on the task requirement information of the current node. If the reason for the failure is that the external service of the skill is unavailable, the system can search for alternative skill nodes with the same or similar output result patterns in the skill contract set and update the skill execution plan based on the directed acyclic graph of skill execution. If the reason for the failure is that a required input parameter is missing, the system can return to step S4 to re-execute the symbol table lookup, or generate a supplementary input request based on the input parameter pattern. It should be noted that the failure handling in this embodiment of the invention is based on the existing data in the model capability set, skill contract set, directed acyclic graph of skill execution, and memory symbol table for evidence-based replacement, retry, or rollback.
[0068] Reference Figure 4 , Figure 4 This is a schematic diagram of the structure of the AIAgent operating system based on pluggable access to multiple models and intelligent orchestration across skills, according to an embodiment of the present invention.
[0069] like Figure 4 As shown, the AIAgent operation system based on multi-model pluggable access and cross-skill intelligent orchestration proposed in this embodiment of the invention includes: Module 10 is used to read model adapter declaration information and skill declarative configuration information, and to establish a model capability set based on the model adapter declaration information and a skill contract set based on the skill declarative configuration information. The decomposition module 20 is used to decompose the task based on the user's task intent and match candidate skill nodes for each subtask based on the skill contract set to form a set of candidate skill nodes that includes input parameter patterns, output result patterns and skill dependencies. The construction module 30 is used to perform dependency parsing based on the input parameter pattern and output result pattern of each candidate skill node in the candidate skill node set, construct a directed acyclic graph of skill execution, and generate a skill execution plan containing topological execution order and parallelizable node groups based on the directed acyclic graph of skill execution. Selection module 40 is used to sequentially determine the current skill node to be executed according to the skill execution plan, select the target model adapter based on the task requirement information corresponding to the current skill node to be executed and the model capability set, and inject execution input data into the current skill node to be executed based on the memory symbol table; The calling module 50 is used to call the target model adapter to execute the skill action corresponding to the currently executed skill node, obtain the node execution result, and write the node execution result into the memory symbol table according to the preset symbol entry structure until the skill execution plan is completed and the AI Agent running result is output.
[0070] Other embodiments or specific implementations of the AI Agent operating system based on multi-model pluggable access and cross-skill intelligent orchestration of the present invention can be referred to the above-mentioned method embodiments, and will not be repeated here.
[0071] It is understood that in the description of this specification, references to terms such as "one embodiment," "another embodiment," "other embodiments," or "first embodiment to Nth embodiment," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0072] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0073] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A method for operating an AI Agent based on pluggable multi-model access and cross-skill intelligent orchestration, characterized in that, The method includes the following steps: Read model adapter declaration information and skill declarative configuration information, and establish a model capability set based on the model adapter declaration information and a skill contract set based on the skill declarative configuration information; The task is decomposed based on the user's task intent, and candidate skill nodes are matched for each subtask based on the skill contract set to form a set of candidate skill nodes that includes input parameter patterns, output result patterns and skill dependencies. Based on the input parameter patterns and output result patterns of each candidate skill node in the candidate skill node set, dependency parsing is performed, a directed acyclic graph of skill execution is constructed, and a skill execution plan containing topological execution order and parallelizable node groups is generated based on the directed acyclic graph of skill execution. According to the skill execution plan, the current skill node to be executed is determined sequentially. Based on the task requirement information corresponding to the current skill node to be executed and the model capability set, the target model adapter is selected, and the execution input data is injected into the current skill node to be executed based on the memory symbol table. The target model adapter is invoked to execute the skill action corresponding to the currently executed skill node, the node execution result is obtained, and the node execution result is written into the memory symbol table according to the preset symbol entry structure until the skill execution plan is completed and the AI Agent running result is output.
2. The AI Agent operation method based on multi-model pluggable access and cross-skill intelligent orchestration as described in claim 1, characterized in that, Read the model adapter declaration information and establish a model capability set based on the model adapter declaration information, specifically including: Scan the preset adapter directory and read the adapter declaration file corresponding to each model adapter. The adapter declaration file includes at least the model provider identifier, adapter version, list of supported models, authentication configuration information and capability description information. The model adapter instance that implements the unified model interface is loaded based on the adapter declaration file, and initialization and availability detection are performed on the model adapter instance to obtain a set of model adapter instances in a callable state. Extract modal support information, context window information, function call support information, inference speed level, cost level, and health status information of each model from the model adapter instance set to form a model capability profile corresponding to each model; A set of model capabilities is established based on the capability profiles of each model.
3. The AI Agent operation method based on multi-model pluggable access and cross-skill intelligent orchestration as described in claim 1, characterized in that, Read the declarative skill configuration information and establish a set of skill contracts based on the declarative skill configuration information, specifically including: Read the declarative configuration file corresponding to each skill. The declarative configuration file includes at least the skill name, trigger information, input parameter mode, output result mode, external service dependency information, conflict relationship information, and cooperation relationship information. A skill trigger index is established based on the trigger information, and a skill data contract index is established based on the input parameter pattern and the output result pattern; A skill relationship index is established based on external service dependency information, conflict relationship information, and collaboration relationship information, so that the dependency, exclusion, and collaboration relationships between different skills can be identified in the orchestration process. The skill trigger index, skill data contract index, and skill relationship index are stored together to form a skill contract set.
4. The AI Agent operation method based on multi-model pluggable access and cross-skill intelligent orchestration as described in claim 1, characterized in that, Tasks are decomposed based on user task intent, and candidate skill nodes are matched for each subtask based on a set of skill contracts to form a set of candidate skill nodes that includes input parameter patterns, output result patterns, and skill dependencies. Specifically, this includes: Semantic parsing of user task intent is performed to extract task objectives, task objects, output requirements, and constraints, and task intent features are formed based on task objectives, task objects, output requirements, and constraints. Based on the task intent features, the user task intent is decomposed into multiple sub-tasks with clear input and output requirements, and candidate information on the sequential relationship between each sub-task is determined. For each subtask, a first candidate skill is determined based on the skill trigger index, and a second candidate skill that can meet the input and output requirements of the subtask is determined based on the skill data contract index. The first and second candidate skills are merged and filtered to obtain the candidate skill nodes corresponding to the subtask, and the candidate skill nodes corresponding to each subtask are summarized to form a candidate skill node set.
5. The AI Agent operation method based on multi-model pluggable access and cross-skill intelligent orchestration as described in claim 1, characterized in that, Based on the input parameter patterns and output result patterns of each candidate skill node in the candidate skill node set, dependency resolution is performed to construct a directed acyclic graph of skill execution, specifically including: For each candidate skill node in the candidate skill node set, extract the input parameter pattern of the candidate skill node, and search for the data source node that can provide the corresponding input parameters in the output result patterns of other candidate skill nodes; If the data source node is found, a directed dependency edge is established between the data source node and the candidate skill node that requires the input parameter to form an initial skill execution graph; Based on the skill relationship index, conflict detection and collaborative relationship identification are performed on the initial skill execution graph. Candidate skill nodes with conflicts are deleted or replaced according to the conflict detection results, and combinations of candidate skill nodes that can be continuously collaboratively executed are retained according to the collaborative relationship identification results. After completing conflict detection and cooperative relationship identification, the initial skill execution graph is subjected to loop detection and topological sorting to obtain a directed acyclic graph of skill execution.
6. The AI Agent operation method based on multi-model pluggable access and cross-skill intelligent orchestration as described in claim 5, characterized in that, Based on the directed acyclic graph of skill execution, a skill execution plan is generated that includes a topological execution order and parallelizable node groups, specifically including: Based on the directed dependency edges between skill nodes in the directed acyclic graph of the skill execution, the in-degree information and dependency level information of each skill node are determined. Skill nodes with zero in-degree or whose dependencies are satisfied are identified as executable nodes in the same execution level, and skill nodes in the same execution level that do not have mutual dependencies are marked as parallelizable node groups. A topology execution order is generated based on the sequential relationship of each execution level, and the topology execution order is associated with the parallelizable node group to form a skill execution plan; Each skill node in the skill execution plan is associated and recorded with its input parameter mode, output result mode, candidate model requirement information, and prerequisite dependency nodes.
7. The AI Agent operation method based on multi-model pluggable access and cross-skill intelligent orchestration as described in claim 1, characterized in that, Based on the task requirement information corresponding to the currently pending skill node and the model capability set, a target model adapter is selected, specifically including: Based on the skill type, input parameter mode, output result mode, and user task intent of the current skill node to be executed, extract the node task requirement information. The node task requirement information includes at least the required modality, context length requirement, function call requirement, latency requirement, and cost constraint information. Based on the node task requirement information, candidate model capability profiles that meet the basic capability conditions are selected from the model capability set; Multi-factor matching is performed on the capability profiles of each candidate model and the task requirement information of the node to obtain the model matching results corresponding to each candidate model. Based on the model matching results and the health status and current load information of each candidate model, the target model is determined from the candidate models, and the model adapter corresponding to the target model is determined as the target model adapter.
8. The AI Agent operation method based on multi-model pluggable access and cross-skill intelligent orchestration as described in claim 1, characterized in that, Injecting execution input data into the currently executed skill node based on the memory symbol table specifically includes: Read the input parameter pattern of the currently executed skill node to determine the required and optional input parameters for the execution of the currently executed skill node; The symbol entries corresponding to the required input parameters and the optional input parameters are searched in the memory symbol table. The symbol entries include at least the key name, data type, data value, source skill, source node, timestamp, and version identifier. Based on the input parameter pattern, key name matching, data type matching, and source path matching are performed on the found symbol entries to obtain injection candidate entries corresponding to each input parameter; If multiple injection candidate entries exist, the target symbol entry is determined based on the version identifier, timestamp, and dependency path relationship between the source node and the current skill node to be executed, and the data value of the target symbol entry is injected into the execution input of the current skill node to be executed.
9. The AI Agent operation method based on multi-model pluggable access and cross-skill intelligent orchestration as described in claim 1, characterized in that, The target model adapter is invoked to execute the skill action corresponding to the currently executed skill node, the node execution result is obtained, and the node execution result is written into the memory symbol table according to a preset symbol entry structure. Specifically, this includes: Based on the execution input data, skill action parameters, and target model adapter of the current skill node to be executed, a standardized model call request is generated; The target model adapter converts the standardized model call request into the request format of the corresponding model provider and receives the raw response data returned by the corresponding model provider. Based on the output result pattern of the current skill node to be executed, the original response data is parsed and structured to obtain the node execution result that conforms to the output result pattern; Write the execution result of the node into the memory symbol table, and record the key name, data type, data value, source skill, source node, timestamp and version identifier in the symbol entry corresponding to the execution result of the node; When the current skill node fails to execute, a backup model adapter is selected based on the model capability set, or an alternative skill node is determined based on the directed acyclic graph of skill execution, and the skill execution plan is updated.
10. An AI Agent operating system based on multi-model pluggable access and cross-skill intelligent orchestration, characterized in that, include: A module is established to read model adapter declaration information and skill declarative configuration information, and to establish a set of model capabilities based on the model adapter declaration information and a set of skill contracts based on the skill declarative configuration information. The decomposition module is used to decompose tasks based on user task intent and match candidate skill nodes for each subtask based on the skill contract set to form a set of candidate skill nodes that includes input parameter patterns, output result patterns and skill dependencies. The construction module is used to perform dependency resolution based on the input parameter pattern and output result pattern of each candidate skill node in the candidate skill node set, construct a directed acyclic graph of skill execution, and generate a skill execution plan containing topological execution order and parallelizable node groups based on the directed acyclic graph of skill execution. The selection module is used to sequentially determine the current skill node to be executed according to the skill execution plan, select the target model adapter based on the task requirement information corresponding to the current skill node to be executed and the model capability set, and inject execution input data into the current skill node to be executed based on the memory symbol table; The calling module is used to call the target model adapter to execute the skill action corresponding to the currently executed skill node, obtain the node execution result, and write the node execution result into the memory symbol table according to the preset symbol entry structure until the skill execution plan is completed and the AI Agent running result is output.