An agent profile automatic generation method and device, electronic equipment, storage medium and computer program product

CN122985141APending Publication Date: 2026-10-27MOORE THREADS TECHNOLOGY (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611459883.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-20
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0002]目前,智能体(AI Agent)系统多依赖声明式或手动编排方式进行构建,例如,通过领域特定语言(Domain Specific Language,DSL)、人类可读的数据序列化格式YAML、或专用智能体文件(Agent file)语法来手动编排智能体、模型、工具和工作流,这些方法依赖手动配置,学习成本高,导致智能体构建门槛高、构建效率低

Benefits of technology

[0015]根据本公开另一方面,提供了一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现上述方法的步骤。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122985141A_ABST
    Figure CN122985141A_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of computer, and particularly relates to an automatic generation method and device of an agent configuration file, an electronic device, a storage medium and a computer program product.The method comprises the following steps: receiving a target task input by a user based on a natural language; determining a target constructed agent learning sample matched with the target task from a preset sample library, wherein the preset sample library comprises a plurality of constructed agent learning samples; and automatically generating a target agent configuration file corresponding to the target task by using a large language model according to the target constructed agent learning sample, wherein the target agent configuration file is used for automatically constructing a target agent for executing the target task.According to the embodiment of the present disclosure, the agent construction threshold of non-professionals can be effectively reduced, and the agent construction efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a method and apparatus for automatically generating intelligent agent configuration files, electronic devices, storage media, and computer program products. Background Technology

[0002] Currently, AI agent systems are mostly built using declarative or manual orchestration methods. For example, agents, models, tools, and workflows are manually orchestrated using domain-specific languages ​​(DSLs), human-readable data serialization formats (YAML), or dedicated agent file syntax. These methods rely on manual configuration, have high learning costs, and result in high barriers to entry and low efficiency in building AI agents. Summary of the Invention

[0003] In view of this, this disclosure proposes a method and apparatus for automatically generating intelligent agent configuration files, an electronic device, a storage medium, and a computer program product.

[0004] According to one aspect of this disclosure, a method for automatically generating an agent configuration file is provided, comprising: receiving a target task input by a user based on natural language; determining target pre-built agent learning samples matching the target task from a preset sample library, wherein the preset sample library includes multiple pre-built agent learning samples; and automatically generating a target agent configuration file corresponding to the target task using a large language model based on the target pre-built agent learning samples, wherein the target agent configuration file is used to automatically construct a target agent to perform the target task.

[0005] In one possible implementation, the method further includes: acquiring source data corresponding to each constructed agent; and determining constructed agent learning samples corresponding to each constructed agent based on the source data corresponding to each constructed agent, wherein the constructed agent learning samples corresponding to each constructed agent are used to characterize the agent construction pattern from the natural language task description corresponding to the constructed agent to the agent configuration file.

[0006] In one possible implementation, the source data corresponding to each built agent includes: the original task requirements and agent configuration file for the built agent. The step of determining the learning samples for each built agent based on the source data includes: for any built agent, determining the natural language task description corresponding to the built agent based on the original task requirements; parsing the natural language task description to determine multiple agent building elements and the corresponding fields of each agent building element in the agent configuration file; and determining the learning samples for the built agent based on the natural language task description, the multiple agent building elements, and the corresponding fields of each agent building element in the agent configuration file.

[0007] In one possible implementation, each constructed agent learning sample includes at least one of the following fields: natural language task description field, task type field, agent role set field, agent model selection field, agent toolset selection field, agent orchestration field, and agent configuration field.

[0008] In one possible implementation, determining the target built agent learning sample that matches the target task from a preset sample library includes: performing semantic parsing on the target task to determine the target task type; and selecting a built agent learning sample that matches the target task type based on the task type field of each built agent learning sample in the preset sample library, and determining it as the target built agent learning sample.

[0009] In one possible implementation, the step of automatically generating the target agent configuration file corresponding to the target task based on the target agent learning samples and using a large language model includes: determining the target agent construction elements corresponding to the target task based on the target agent learning samples; and automatically generating the target agent configuration file based on the target agent learning samples and the target agent construction elements using the large language model.

[0010] In one possible implementation, the target agent construction elements include at least one of the following: agent role set, agent model selection, agent server, agent toolset, agent orchestration mode, and agent planning strategy.

[0011] In one possible implementation, the method further includes: updating the preset sample library according to the target agent configuration file.

[0012] According to another aspect of this disclosure, an automatic generation device for an agent configuration file is provided, comprising: an input module for receiving a target task input by a user based on natural language; a sample matching module for determining target built agent learning samples that match the target task from a preset sample library, wherein the preset sample library includes multiple built agent learning samples; and a generation module for automatically generating a target agent configuration file corresponding to the target task based on the target built agent learning samples and using a large language model, wherein the target agent configuration file is used to automatically construct a target agent that performs the target task.

[0013] According to another aspect of this disclosure, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the above-described method.

[0014] According to another aspect of this disclosure, a non-volatile computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps of the above-described method.

[0015] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the above-described method.

[0016] The automatic generation method for intelligent agent configuration files according to embodiments of this disclosure receives a target task input by a user based on natural language, effectively reducing the threshold for building intelligent agents for non-professionals. Then, it determines a target pre-built intelligent agent learning sample that matches the target task from a preset sample library including multiple pre-built intelligent agent learning samples. This enables the automatic generation of a target intelligent agent configuration file corresponding to the target task based on the target pre-built intelligent agent learning sample and using a large language model. This allows the automatic construction of a target intelligent agent to execute the target task using the target intelligent agent configuration file, effectively improving the efficiency of intelligent agent construction.

[0017] Other features and aspects of this disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description

[0018] The accompanying drawings, which are included in and form part of this specification, illustrate exemplary embodiments, features, and aspects of this disclosure together with the specification and serve to explain the principles of this disclosure.

[0019] Figure 1 A flowchart illustrating an automatic generation method for an agent configuration file according to an embodiment of the present disclosure is shown.

[0020] Figure 2A flowchart illustrating a method for determining a built agent learning sample corresponding to a built agent according to an embodiment of the present disclosure is shown.

[0021] Figure 3 A block diagram of an apparatus for automatically generating an agent profile according to an embodiment of the present disclosure is shown.

[0022] Figure 4 A block diagram of an electronic device according to an embodiment of the present disclosure is shown. Detailed Implementation

[0023] Various exemplary embodiments, features, and aspects of this disclosure will now be described in detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements that have the same or similar functions. Although various aspects of the embodiments are shown in the drawings, they are not necessarily drawn to scale unless specifically indicated otherwise.

[0024] As used herein, the terms “comprising,” “including,” “having,” or variations thereof are open-ended and include one or more of the stated features, integrals, elements, steps, components, or functions, but do not exclude the presence or addition of one or more other features, integrals, elements, steps, components, functions, or groups thereof.

[0025] When an element is referred to as “connected,” “coupled,” “responding,” or a variation thereof relative to another element, it may be directly connected, coupled, or responding to another element, or there may be an intermediate element present.

[0026] Although the terms first, second, third, etc., may be used herein to describe various elements / operations, these elements / operations should not be limited by these terms. These terms are only used to distinguish one element / operation from another. Therefore, without departing from the teachings of the inventive concept, a first element / operation in some embodiments may be referred to as a second element / operation in other embodiments.

[0027] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments.

[0028] Furthermore, to better illustrate this disclosure, numerous specific details are set forth in the following detailed description. Those skilled in the art will understand that this disclosure can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art have not been described in detail in order to highlight the main points of this disclosure.

[0029] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, data stored, data displayed, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant regions.

[0030] Currently, AI agent systems are mostly built using declarative or manual orchestration methods, such as manually orchestrating agents, models, tools, and workflows through DSL, YAML, or dedicated agent file syntax.

[0031] Existing methods for building AI agents include: manually building agent toolsets using the Lang Chain toolchain; explicitly defining the structure of Conversable Agents and Group Chats using Auto Gen; defining the agent environment and steps using DSLs such as Docker files or Agent files; and manually encapsulating tool service interfaces using the Model Context Protocol (MCP). While declarative methods are more maintainable than pure coding, they still require developers to have strong experience in building AI agents, especially in multi-step collaboration, tool combination, and model capability matching, presenting a certain barrier to entry. Developers need to master specific Agent file and / or workflow writing methods; they lack task-level intelligence, failing to automatically build agents based on user intent; the building process is not generalizable, and repetitive tasks cannot be generated quickly; and they lack the "intelligent configuration capability" to automatically adapt the model to task requirements.

[0032] Therefore, although several agent building frameworks (e.g., Lang Chain, Auto Gen, etc.) support "declarative" definition of agent structures, these methods rely on manual configuration, have high learning costs, and cannot automatically generate agent building schemes based on the user's actual task intent.

[0033] To address the aforementioned technical problems, this disclosure provides a method for automatically generating agent configuration files. This method allows users to automatically generate target agent configuration files simply by inputting the target task in natural language, thereby automatically constructing the target agent to perform the target task. This effectively lowers the barrier to agent construction and improves agent construction efficiency. The automatic generation method for agent configuration files provided in this disclosure is described in detail below.

[0034] Figure 1A flowchart illustrating an automatic generation method for an agent configuration file according to an embodiment of this disclosure is shown. Figure 1 As shown, the method may include:

[0035] In step S11, the target task based on the user's natural language input is received.

[0036] Users can input their target task in natural language based on their actual task intent. For example, a user could input the target task in natural language: "Help me check if there are any security risks in the latest release of a Git Hub repository."

[0037] Even non-professional users can describe their task intentions using natural language, effectively lowering the user threshold for building intelligent agents.

[0038] In step S12, target built agent learning samples that match the target task are determined from a preset sample library, wherein the preset sample library includes multiple built agent learning samples.

[0039] Any pre-built agent learning sample included in the preset sample library is a sample data that has been structured and standardized from the construction experience of the pre-built agent, and then converted into sample data that can be used for learning by large language models. By abstracting the implicit construction experience of the pre-built agent into explicit pre-built agent learning samples, reuse and sharing can be achieved.

[0040] Furthermore, based on the few-shot strategy, a few-shot prompt is constructed for the large language model. The few-shot prompt needs to embed at least one learning sample of the constructed agent. By using the few-shot prompt, the large language model learns "how to construct an agent to perform the task" rather than "how to complete the task", thus enabling the large language model to "construct an agent".

[0041] The following sections will describe in detail the form of the constructed intelligent agent learning samples and how to construct the preset sample library, based on the possible implementation methods of this disclosure; these details will not be elaborated upon here.

[0042] After receiving a target task from a user based on natural language input, a pre-built target agent learning sample matching the target task can be determined from a pre-defined sample library. The task performed by the pre-built target agent is similar to the target task, providing construction experience for building a target agent that performs the target task. The number of pre-built target agent learning samples can be one or more; this disclosure does not impose a specific limitation.

[0043] The following sections will describe in detail how to determine target-built agent learning samples that match the target task from a preset sample library, based on possible implementation methods of this disclosure; these details will not be elaborated upon here.

[0044] In step S13, based on the target agent learning samples that have been constructed, a target agent configuration file corresponding to the target task is automatically generated using a large language model. The target agent configuration file is used to automatically construct the target agent that performs the target task.

[0045] The target already constructed agent learning samples and the target task embedded in the few-shot prompt template of the large language model are input into the large language model so that the large language model can automatically generate a stable and accurate target agent configuration file corresponding to the target task by using the construction samples of the target already constructed agent.

[0046] Among them, the target agent configuration file is an agent configuration scheme that can be directly executed or deployed. That is, by using the target agent configuration file, the target agent that executes the target task can be automatically constructed, which effectively improves the efficiency and accuracy of agent construction.

[0047] In one example, the target agent configuration file can be directly loaded and executed by the agent runtime or orchestrator, and can run automatically in environments such as Docker, Kubernetes operator, and serverless to perform the target task.

[0048] The automatic generation method for intelligent agent configuration files according to embodiments of this disclosure receives a target task input by a user based on natural language, effectively reducing the threshold for building intelligent agents for non-professionals. Then, it determines a target pre-built intelligent agent learning sample that matches the target task from a preset sample library including multiple pre-built intelligent agent learning samples. This enables the automatic generation of a target intelligent agent configuration file corresponding to the target task based on the target pre-built intelligent agent learning sample and using a large language model. This allows the automatic construction of a target intelligent agent to execute the target task using the target intelligent agent configuration file, effectively improving the efficiency of intelligent agent construction.

[0049] In one possible implementation, the method further includes: acquiring source data corresponding to each constructed agent; and determining constructed agent learning samples corresponding to each constructed agent based on the source data corresponding to each constructed agent, wherein the constructed agent learning samples corresponding to each constructed agent are used to characterize the agent construction pattern from the natural language task description corresponding to the constructed agent to the agent configuration file.

[0050] By acquiring source data from multiple pre-built agents, the construction experience of each agent can be structured and standardized, transforming it into learning samples that can be used by large language models. These pre-built agent learning samples can represent the agent construction pattern from the natural language task description (Task) to the agent file / workflow, enabling the large language model to learn the mapping relationship from the natural language task description (Task) to the agent construction pattern, and then to the agent file, through these learning samples.

[0051] In one example, the source data corresponding to the built agent can be obtained from at least one or more of the following sources: historically verified and working agent configuration files (Agent file / Workflow); agent building examples in open source projects (e.g., Auto Gen, Lang Chain, Agent Man, etc.); typical task solving processes summarized by human experts; and agent configuration results that users have manually modified and confirmed to be correct in actual use.

[0052] In addition to the sources mentioned above, the source data corresponding to the constructed intelligent agent can also be obtained from other sources according to the actual application scenario. For example, typical intelligent agent configuration files or declarative intelligent agent workflows can be obtained. This disclosure does not make specific limitations in this regard.

[0053] In one possible implementation, each constructed agent learning sample includes at least one of the following fields: natural language task description field, task type field, agent role set field, agent model selection field, agent toolset selection field, agent orchestration field, and agent configuration field.

[0054] In order to enable the constructed agent learning samples to allow the large language model to learn "what agent structure and tool combination should be selected under what task", the constructed agent learning samples include at least one of the following fields: natural language task description field, task type field, agent role set field, agent model selection field, agent tool set selection field, agent orchestration field, and agent configuration field.

[0055] In one example, the constructed agent learning sample includes the following fields:

[0056] Natural Language Task Description field (Task_Description);

[0057] The Task Type field (Task_Type) indicates the type of task, which can be code analysis, information retrieval, automated operation and maintenance, etc.

[0058] Agent_Roles field;

[0059] The agent model selection field (Model_Selection);

[0060] The Agent Toolset Selection field (Tool_Set) can indicate the list of tools and / or Model Context Protocol Services (MCP Servers) required by the agent.

[0061] The agent orchestration field (Orchestration_Pattern) can indicate a single agent orchestration mode or a multi-agent orchestration mode, as well as a planner-executor.

[0062] The Agent configuration field (Agent_Config) can indicate the agent file and / or workflow.

[0063] In addition to the fields mentioned above, the constructed intelligent agent learning samples can also include other fields according to actual application needs. This disclosure does not make specific limitations on this.

[0064] In one possible implementation, the source data corresponding to each built agent includes: the original task requirements and agent configuration file for the built agent. Based on the source data for each built agent, the learning samples for each built agent are determined, including: for any built agent, determining the natural language task description corresponding to the built agent based on the original task requirements; parsing the natural language task description to determine multiple agent building elements, and determining the corresponding field of each agent building element in the agent configuration file; and determining the learning samples for the built agent based on the natural language task description, the multiple agent building elements, and the corresponding field of each agent building element in the agent configuration file.

[0065] By abstracting the source data of the constructed agent to determine the natural language task description, parsing the natural language task description to determine multiple agent construction elements, and then aligning each agent construction element with the corresponding field in the agent configuration file, the constructed agent learning sample corresponding to the constructed agent is finally obtained, and the constructed agent learning sample is stored in a preset sample library for use in the subsequent construction of prompts for the large language model.

[0066] Figure 2 A flowchart illustrating a method for determining a learned sample of a constructed agent according to an embodiment of this disclosure is shown. Figure 2 As shown, it includes:

[0067] In step S21, the source data corresponding to the constructed agent is obtained. The source data corresponding to the constructed agent includes the original task requirements and the agent configuration file.

[0068] In step S22, the natural language task description corresponding to the constructed agent is determined based on the original task requirements corresponding to the constructed agent.

[0069] Based on the source data of the constructed agent, the original task requirements corresponding to the constructed agent can be determined. From the original task requirements, the task objectives, constraints and expected outputs can be extracted, and then a concise and clear natural language task description (Task) corresponding to the constructed agent can be determined.

[0070] In step S23, the natural language task description corresponding to the constructed agent is parsed, multiple agent construction elements are determined, and the corresponding field of each agent construction element in the agent configuration file corresponding to the constructed agent is determined.

[0071] The natural language task description corresponding to the constructed agent is parsed to obtain multiple agent construction elements. For example, these elements may include: the number and roles of agents, whether a planner-executor is needed, whether tool calls are required, and whether multiple iterations are needed. Besides the examples mentioned above, other agent construction elements may also be included based on the parsing results of the actual natural language task description; this disclosure does not impose specific limitations on these.

[0072] Each agent building element, extracted from the natural language task description corresponding to the built agent, is configured and aligned with the corresponding fields in the agent configuration file corresponding to the built agent. For example, the corresponding fields in the agent configuration file may include: agent field (AGENT), instruction field (INSTRUCTION), server field (SERVERS), planning type field (PLAN_TYPE), and planning iteration count field (PLAN_ITERATIONS). Besides the examples above, the corresponding fields in the agent configuration file may also include other fields based on the actual agent building elements and the actual agent configuration file; this disclosure does not specifically limit this.

[0073] In step S24, the learning samples of the constructed intelligent agent are determined based on the natural language task description corresponding to the constructed intelligent agent, multiple intelligent agent construction elements, and the corresponding fields of each intelligent agent construction element in the intelligent agent configuration file corresponding to the constructed intelligent agent.

[0074] By binding the natural language task description corresponding to the built agent with the agent configuration file, standardized learning samples (few-shot samples) of the built agent are formed in the form of a "task-configuration" pair (task→agent config). The built agent learning samples are stored in a preset sample library (few-shot prompt sample set) for use in the subsequent construction of few-shot prompt words for large language models.

[0075] In one example, the number of pre-built agent learning samples included in the preset sample library can be flexibly set according to the actual situation. For example, the preset sample library includes 20 to 100 pre-built agent learning samples with typical task-agent configuration file correspondences.

[0076] In practical applications, a few-shot prompt template is designed, and at least one built agent learning sample and any target task input by the user based on natural language are embedded in the few-shot prompt template. This guides the large language model to learn "how the task is mapped to the agent configuration file" using at least one built agent learning sample, and then automatically infers and generates the complete target agent configuration file corresponding to the target task.

[0077] In one example, a few-shot prompt template could look like this:

[0078] Task: [Clone the latest version of the code from a GitHub repository];

[0079] Agentfile: [Example of a complete agent configuration file];

[0080] Task: [Any target task input by the user based on natural language];

[0081] Agentfile: [The target agent configuration file output by the large language model].

[0082] In addition to the examples mentioned above, the specific form of the few-shot prompt template can also be designed in other forms according to the actual situation. This disclosure does not impose any specific limitations on this.

[0083] When a user inputs a target task using natural language, the process doesn't involve directly "writing a configuration file." Instead, the target agent configuration file is automatically generated through the following interpretable and reproducible technical process: The system receives the target task input from the user using natural language; performs semantic understanding and task type identification on the target task; matches similar task patterns from a pre-defined sample library with pre-built target agent learning samples; based on the pre-built target agent learning samples, a large language model infers a suitable agent construction strategy for the target task (e.g., agent roles, agent models, agent tools, agent orchestration methods, etc.); and then the large language model automatically generates a complete target agent configuration file (Agent file, Workflow). This target agent configuration file is an agent configuration scheme that can be directly executed or deployed.

[0084] The automatic generation method for agent configuration files in this disclosure supports both the automatic construction of single agents for simple tasks and the automatic construction of multi-agent systems for complex tasks.

[0085] In one example, the user's target task based on natural language input is to analyze the latest version of a GitHub repository, determine if there are potential security issues, and provide improvement suggestions. The large language model has already built a single-agent sample based on the target (an automatic code repository analysis agent), and the learned agent construction strategy is as follows: Task type: code analysis + information retrieval; Agent structure: single agent + tool enhancement; Model selection: a large model with strong general reasoning capabilities; Tool requirements: GitHub MCP Server (for obtaining code and release information), file system access tools. The large language model does not learn "how to check for security vulnerabilities," but rather learns a construction strategy for "how to build an agent with code access and analysis capabilities when faced with code analysis tasks."

[0086] In one example, the user's objective task based on natural language input is to automatically generate a technical research report, including data retrieval, summarization, and formatted output. The large language model has already constructed agent samples based on the objective, and the learned agent construction strategy for multi-agent collaborative tasks is as follows: Research Agent: Data retrieval; Writer Agent: Summarization and writing; Orchestrator: Task scheduling and result merging.

[0087] In one possible implementation, determining target built agent learning samples that match the target task from a preset sample library includes: performing semantic parsing on the target task to determine the target task type; and selecting built agent learning samples that match the target task type based on the task type field of each built agent learning sample in the preset sample library, and determining them as target built agent learning samples.

[0088] Semantic parsing is performed on the target task to extract key semantic information. Then, the target task type is determined based on the key semantic information. From the preset sample library, pre-built agent learning samples that match the target task type are selected and identified as target pre-built agent learning samples with similar task patterns to the target task.

[0089] For example, if a user inputs a target task in natural language as "help me check if there are any security risks in the latest release of a Git Hub repository", semantic parsing can extract key semantic information, which may include: the task target is security check, the object is a Git Hub repository, and the action is to obtain the release, analyze the code or description, thereby determining that the target task type is a code / repository analysis task.

[0090] Retrieve pre-built agents with similar task patterns from a preset sample library, such as code review agents and information retrieval and analysis agents, and determine the pre-built agent learning samples corresponding to the pre-built agents with similar task patterns as the target pre-built agent learning samples corresponding to the target task.

[0091] In one possible implementation, based on the target agent learning samples, a large language model is used to automatically generate the target agent configuration file corresponding to the target task, including: determining the target agent construction elements corresponding to the target task based on the target agent learning samples; and automatically generating the target agent configuration file based on the target agent learning samples and the target agent construction elements using a large language model.

[0092] Since the target agent's learning samples have similar task patterns to the target task, the target agent's building elements corresponding to the target task can be extracted based on the target agent's learning samples.

[0093] Furthermore, based on the target agent learning samples, the large language model learns the mapping relationship between the natural language task description (Task) and the agent file, infers the optimal configuration scheme for the target task, automatically completes the specific configuration information of the target agent construction elements, and finally directly outputs the target agent configuration file.

[0094] In one possible implementation, the target agent construction elements include at least one of the following: agent role set, agent model selection, agent server, agent toolset, agent orchestration mode, and agent planning strategy.

[0095] The elements of constructing a target intelligent agent include the selection of the agent model. For example, a large language model can dynamically select a suitable model for the target intelligent agent (e.g., general models such as Qwen and GPT-4).

[0096] The elements for constructing a target intelligent agent include a set of agent roles. For example, a large language model can output the agent definition (name, instruction, etc.) of the target intelligent agent.

[0097] The building blocks of the target agent include agent servers. For example, a large language model can output the server capabilities of the target agent (SERVERS, e.g., git / filesystem / mcp).

[0098] The building blocks of a target intelligent agent include an agent toolkit; for example, a large language model can output the tool invocation protocol of the target intelligent agent (e.g., the MCP command line format).

[0099] The elements of constructing a target intelligent agent include the agent orchestration pattern. For example, a large language model can output the orchestration strategy (ORCHESTRATOR) of the target intelligent agent.

[0100] The elements for constructing a target intelligent agent include the agent's planning strategy. For example, a large language model can output the planning strategy (PLAN_TYPE, PLAN_ITERATIONS) of the target intelligent agent.

[0101] In addition to including at least one of the following: agent role set, agent model selection, agent server, agent toolset, agent orchestration mode, and agent planning strategy, the elements for constructing a target agent may also include other elements for constructing an agent, depending on the actual application requirements. This disclosure does not impose any specific limitations on these elements.

[0102] The target agent configuration file generated in this embodiment automatically includes MCP server binding information, including complete configurations such as commands, parameters, and transmission methods. When the target agent loads this configuration file at runtime, it can establish a connection with the corresponding tool service via the MCP protocol without any additional development, achieving standardized encapsulation and invocation of the tool. This design maximizes the decoupling between the agent and the tool: the tool provider only needs to encapsulate the service according to the MCP protocol, and the agent builder only needs to declare the service address in the configuration; neither needs to know the other's implementation details.

[0103] The automatic generation method for agent configuration files in this disclosure can reduce the agent construction speed from minutes / hours to seconds.

[0104] In one example, the automatic generation method of the agent configuration file of this disclosure embodiment can be integrated into a continuous integration / continuous delivery (CI / CD) pipeline to automatically generate the corresponding test agent or deployment agent after each code commit.

[0105] In one example, the automatic generation method of the agent configuration file of this disclosure embodiment can be used as a development aid tool, allowing developers to quickly obtain the agent configuration file through natural language description in the IDE, greatly improving development efficiency.

[0106] The automatic generation method for agent configuration files in this disclosure easily supports the construction of agents for different tasks by combining agent construction patterns and few-sample prompt words. It significantly improves the reusability, general scalability, generalization and automation level of agent construction, enabling agent construction to evolve from the passive construction and orchestration of existing technologies to task-driven automatic agent generation, thus opening up a new way of agent construction.

[0107] In one possible implementation, the method further includes updating a preset sample library based on the target agent configuration file.

[0108] Using the target agent configuration file, new few-shot samples can be generated backflow to achieve continuous iterative updates of the preset sample library for subsequent prompt enhancement.

[0109] In one example, the target agent's configuration file can be reviewed and fine-tuned by the user before generating new few-shot samples to improve sample accuracy.

[0110] The automatic generation method for agent configuration files in this disclosure enables large language models to automatically generate target agent configuration files, including agent configuration, tool binding, service references, and execution logic, based on the user's target task input in natural language. This greatly improves the efficiency and adaptability of agent construction.

[0111] It is understood that the various method embodiments mentioned above in this disclosure can be combined with each other to form combined embodiments without violating the principle and logic. Due to space limitations, this disclosure will not elaborate further. Those skilled in the art will understand that in the above methods of specific implementation, the specific execution order of each step should be determined by its function and possible internal logic.

[0112] In addition, this disclosure also provides an automatic generation device, electronic device, computer-readable storage medium, and program for intelligent agent configuration files. All of the above can be used to implement any of the automatic generation methods for intelligent agent configuration files provided in this disclosure. The corresponding technical solutions and descriptions are described in the corresponding descriptions in the method section and will not be repeated here.

[0113] Figure 3 A block diagram of an apparatus for automatically generating agent profiles according to an embodiment of the present disclosure is shown. Figure 3 As shown, the device 30 includes:

[0114] Input module 31 is used to receive the user's target task based on natural language input;

[0115] The sample matching module 32 is used to determine the target built agent learning sample that matches the target task from the preset sample library, wherein the preset sample library includes multiple built agent learning samples.

[0116] The generation module 33 is used to automatically generate the target agent configuration file corresponding to the target task based on the target agent learning samples already constructed, using a large language model. The target agent configuration file is used to automatically construct the target agent that performs the target task.

[0117] In one possible implementation, device 30 further includes: a sample construction module, used for:

[0118] Obtain the source data corresponding to each constructed agent;

[0119] Based on the source data corresponding to each built agent, determine the built agent learning sample corresponding to each built agent. The built agent learning sample corresponding to each built agent is used to represent the agent construction pattern from the natural language task description corresponding to the built agent to the agent configuration file.

[0120] In one possible implementation, the source data for each constructed agent includes: the original task requirements for the constructed agent and the agent configuration file.

[0121] The sample building module is used for:

[0122] For any constructed agent, determine the natural language task description corresponding to the constructed agent based on the original task requirements corresponding to the constructed agent;

[0123] Parse the natural language task description corresponding to the constructed agent, determine multiple agent construction elements, and determine the corresponding field of each agent construction element in the agent configuration file corresponding to the constructed agent;

[0124] Based on the natural language task description corresponding to the constructed agent, multiple agent construction elements, and the corresponding fields of each agent construction element in the agent configuration file corresponding to the constructed agent, the constructed agent learning samples corresponding to the constructed agent are determined.

[0125] In one possible implementation, each constructed agent learning sample includes at least one of the following fields: natural language task description field, task type field, agent role set field, agent model selection field, agent toolset selection field, agent orchestration field, and agent configuration field.

[0126] In one possible implementation, the sample matching module 32 is used for:

[0127] Perform semantic analysis on the target task to determine the target task type;

[0128] Based on the task type field of each built agent learning sample in the preset sample library, select the built agent learning sample that matches the target task type and determine it as the target built agent learning sample.

[0129] In one possible implementation, the generation module 33 is used for:

[0130] Based on the learning samples of the target intelligent agent that have been built, determine the construction elements of the target intelligent agent corresponding to the target task;

[0131] Based on the target intelligent agent's learning samples and the target intelligent agent's construction elements, a large language model is used to automatically generate the target intelligent agent's configuration file.

[0132] In one possible implementation, the target agent construction elements include at least one of the following: agent role set, agent model selection, agent server, agent toolset, agent orchestration mode, and agent planning strategy.

[0133] In one possible implementation, device 30 further includes: an update module, used for:

[0134] Update the preset sample library based on the target agent's configuration file.

[0135] In some embodiments, the functions or modules of the apparatus provided in this disclosure can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0136] This disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the above method.

[0137] This disclosure also provides a non-volatile computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the above-described method.

[0138] This disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described method.

[0139] Figure 4 A block diagram of an electronic device according to an embodiment of the present disclosure is shown. (Refer to...) Figure 4 The electronic device 1900 can be provided as a server or a terminal device. (See reference...) Figure 4 The electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions, such as application programs, that can be executed by the processing component 1922. The application programs stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 1922 is configured to execute instructions to perform the methods described above.

[0140] Electronic device 1900 may also include a power supply component 1926 configured to perform power management of electronic device 1900, a wired or wireless network interface 1950 configured to connect electronic device 1900 to a network, and an input / output interface 1958 (I / O interface). Electronic device 1900 can operate on an operating system, such as Windows Server, stored in memory 1932. TM Mac OS X TM Unix TM Linux TM FreeBSD TM Or similar.

[0141] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions that can be executed by a processing component 1922 of an electronic device 1900 to perform the above-described method.

[0142] Computer-readable storage media can be tangible devices capable of holding and storing programs / instructions used by instruction execution devices. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination of the foregoing. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.

[0143] The computer program (or computer-readable program instructions) described herein can be downloaded from a computer-readable storage medium to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage medium in the respective computing / processing device.

[0144] The computer program (or computer program instructions) used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, etc., and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing state information from the computer-readable program instructions to implement various aspects of this disclosure.

[0145] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.

[0146] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.

[0147] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.

[0148] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0149] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or technical improvements to the embodiments in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A method for automatically generating intelligent agent configuration files, characterized in that, include: Receive the user's target task based on natural language input; From a preset sample library, target-built intelligent agent learning samples that match the target task are determined, wherein the preset sample library includes multiple built intelligent agent learning samples; Based on the target, an agent learning sample has been constructed. Using a large language model, a target agent configuration file corresponding to the target task is automatically generated. The target agent configuration file is used to automatically construct the target agent that executes the target task.

2. The method according to claim 1, characterized in that, The method further includes: Obtain the source data corresponding to each constructed agent; Based on the source data corresponding to each built agent, determine the built agent learning sample corresponding to each built agent. The built agent learning sample corresponding to each built agent is used to represent the agent construction pattern from the natural language task description corresponding to the built agent to the agent configuration file.

3. The method according to claim 2, characterized in that, The source data for each constructed agent includes: the original task requirements for the constructed agent and the agent configuration file; The step of determining the learning samples for each built agent based on the source data corresponding to each built agent includes: For any constructed agent, determine the natural language task description corresponding to the constructed agent based on the original task requirements corresponding to the constructed agent; Parse the natural language task description corresponding to the constructed agent, determine multiple agent construction elements, and determine the corresponding field of each agent construction element in the agent configuration file corresponding to the constructed agent; Based on the natural language task description corresponding to the constructed agent, multiple agent construction elements, and the corresponding fields of each agent construction element in the agent configuration file corresponding to the constructed agent, the constructed agent learning samples corresponding to the constructed agent are determined.

4. The method according to any one of claims 1 to 3, characterized in that, Each constructed agent learning sample includes at least one of the following fields: natural language task description field, task type field, agent role set field, agent model selection field, agent toolset selection field, agent orchestration field, and agent configuration field.

5. The method according to claim 4, characterized in that, The step of determining target-built agent learning samples that match the target task from a preset sample library includes: Perform semantic parsing on the target task to determine the target task type; Based on the task type field of each built agent learning sample in the preset sample library, select the built agent learning sample that matches the target task type and determine it as the target built agent learning sample.

6. The method according to claim 4, characterized in that, The step involves constructing intelligent agent learning samples based on the target, and automatically generating a target intelligent agent configuration file corresponding to the target task using a large language model, including: Based on the intelligent agent learning samples already constructed for the target, determine the target intelligent agent construction elements corresponding to the target task; Based on the target intelligent agent learning samples and the target intelligent agent construction elements, the target intelligent agent configuration file is automatically generated using the large language model.

7. The method according to claim 6, characterized in that, The target intelligent agent construction elements include at least one of the following: intelligent agent role set, intelligent agent model selection, intelligent agent server, intelligent agent toolset, intelligent agent orchestration mode, and intelligent agent planning strategy.

8. The method according to claim 1, characterized in that, The method further includes: Update the preset sample library according to the target agent configuration file.

9. An automatic generation device for intelligent agent configuration files, characterized in that, include: The input module is used to receive the user's target task based on natural language input; The sample matching module is used to determine target built agent learning samples that match the target task from a preset sample library, wherein the preset sample library includes multiple built agent learning samples. The generation module is used to automatically generate a target agent configuration file corresponding to the target task based on the intelligent agent learning samples already constructed for the target, using a large language model. The target agent configuration file is used to automatically construct the target intelligent agent that executes the target task.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 8.

11. A non-volatile computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.

12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.