Automatic AI agent and environment interaction and resource management method and system

By managing the interaction between the agent and the environment through the AIO system, the problems of poor environmental scalability and unfair resource scheduling in Agentic RL are solved, improving training efficiency and GPU utilization, and achieving load balancing and latency reduction.

CN121326535APending Publication Date: 2026-01-13BEIJING JILIU TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202511892026.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-16
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

Existing reinforcement learning frameworks in Agentic RL suffer from inflexible environment management, difficulty in scaling, low GPU resource utilization, and unfair resource scheduling, resulting in low training efficiency.

Method used

Design an automated AI agent-environment interaction and resource management system (AIO) that intercepts and takes over interaction requests to achieve asynchronous processing and resource scheduling, monitors tool call frequency and resource consumption, predicts demand and pre-starts a sandbox to reduce latency.

Benefits of technology

It significantly improves training scalability and efficiency, maximizes GPU utilization, achieves load balancing and high-priority task guarantees, and reduces end-to-end latency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121326535A_ABST
    Figure CN121326535A_ABST
Patent Text Reader

Abstract

The invention discloses an automatic AI agent and environment interaction and resource management method and system. The method comprises the steps that all interaction requests of an agent and an environment are intercepted and taken over; the method comprises the following steps: storing interaction requests to be processed, sorting and managing the requests according to a preset or dynamic scheduling strategy, and realizing asynchronous processing of the requests; packaging the trajectory fragments before calling into a partial trajectory sample, and sending the partial trajectory sample to an experience playback pool for a trainer to use; and the server is responsible for actually executing tool calling requests in the interaction requests, monitoring calling frequencies, time consumption and resource consumption of different tools, and allocating and adjusting computing resources for different types of requests. Meanwhile, on the basis of analysis of historical tool calling data and calling behaviors, a smooth estimation mode is adopted, the use requirement of the intelligent agent for the environment sandbox is predicted, and the sandbox is pre-started. As a general component, the system can be seamlessly integrated in an existing RL framework, and the training efficiency and expandability are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence, and in particular to an automated method and system for AI agent interaction with the environment and resource management. Background Technology

[0002] Large-model-based agents represent a crucial paradigm for achieving general artificial intelligence. Their core lies in completing complex tasks through multi-round interactions with the environment, tools, and external APIs, and optimizing policies through reinforcement learning. This training model, known as "Agentic RL," presents entirely new challenges to the underlying training system. Poor scalability and flexibility in environment management: Existing reinforcement learning frameworks are primarily designed for traditional RL tasks, and their environment management modules are typically static and tightly coupled. In Agentic RL, agents need to interact with thousands of dynamic, heterogeneous environment instances (such as web browsers, code interpreters, and API endpoints). Existing frameworks struggle to scale up and manage the lifecycle of these environments in a standardized and fault-tolerant manner.

[0003] Severe GPU resource idleness problem: The training efficiency of Agentic RL is severely constrained by the "SkewnessBubble".

[0004] The main reason is: Uncertainty in the number of interaction rounds: The number of interaction rounds required to complete different tasks varies greatly, resulting in different sample generation times in batch processing.

[0005] Tool-call latency heterogeneity: The time taken for an agent to call external tools (such as API requests or database queries) is extremely unstable, ranging from a few milliseconds to tens of seconds. In synchronous or mini-batch training modes, the GPU responsible for data rolling must wait for the slowest tool call to return its result, resulting in a significant amount of time being idle.

[0006] Lack of resource scheduling and fairness: Agents invoke different tools at varying frequencies and consume different resources. Unmanaged tool calls (such as high-concurrency HTTP requests) can quickly exhaust system resources (such as file handles and network sockets) and introduce unpredictable delays. Furthermore, the system lacks a mechanism for fairly and efficiently scheduling requests for different tools, failing to prioritize resource allocation for critical or high-frequency tasks.

[0007] Therefore, a system-level solution is urgently needed to decouple training computation from environment interaction and solve the aforementioned scalability and efficiency bottlenecks. Summary of the Invention

[0008] In view of the above problems, the present invention is proposed to provide an automated AI agent interaction and resource management method and system for overcoming or at least partially solving the above problems.

[0009] According to one aspect of the present invention, an automated AI agent interacting with the environment and managing resources is provided, the resource management method comprising: Intercept and take over all interaction requests between the agent and the environment; Store pending interactive requests, sort and manage the requests according to preset or dynamic scheduling strategies, and realize asynchronous processing of requests; The trajectory fragments before the call are packaged, executed in batches, and then the execution results are replayed into the experience pool for the trainer to use. It is responsible for actually executing tool call requests in interactive requests, monitoring the call frequency, time consumption and resource consumption of different tools, and allocating and adjusting computing resources for different types of requests to achieve load balancing and high-priority task guarantee; Based on the analysis of historical tool call data and call behavior, a smooth estimation method is used to predict the agent's demand for environmental sandbox usage, pre-start the sandbox, hide the cold start overhead of the sandbox, and reduce the end-to-end latency of agent-environment interaction.

[0010] Optionally, the computing resources include: process / thread pool size and network bandwidth.

[0011] Optionally, the scheduling strategy may specifically include: FIFO, priority queue, shortest task first, and fair shared scheduling.

[0012] Optionally, intercepting and taking over all interaction requests between the agent and the environment specifically includes: the agent initiating a tool call during the interaction with the environment.

[0013] Optionally, the storage of pending interactive requests, according to a preset or dynamic scheduling strategy, sorts and manages the requests to achieve asynchronous processing of the requests, specifically including: Package the completed interaction data of the current round into a training sample and send it to the downstream trainer; The GPU responsible for data sampling has completed its task and can immediately begin processing the next interactive task in the environment without waiting for the tool call to return.

[0014] Optionally, the interaction data specifically includes: the state and actions before the tool is invoked.

[0015] Optionally, the step of packaging the trajectory fragments prior to the call into a partial trajectory sample and sending it to the experience replay pool for use by the trainer specifically includes: After the tool call is completed, AIO returns the result to the corresponding environment instance, updating its state and preparing it for the next round of interaction.

[0016] Optionally, the step of being responsible for actually executing tool call requests in interactive requests, monitoring the call frequency, time consumption, and resource consumption of different tools, and allocating and adjusting computing resources for different types of requests to achieve load balancing and high-priority task guarantees specifically includes: Framework-independent integration: AIO is designed as a standalone system component that integrates seamlessly with any mainstream RL framework through standardized interfaces.

[0017] Optionally, the RL framework specifically includes: on-policy / off-policy, synchronous / asynchronous, centralized / distributed.

[0018] This invention also provides an automated AI agent interaction and resource management system, which applies the aforementioned automated AI agent interaction and resource management method. The resource management system includes: The interaction lifecycle management module is used to intercept and take over all interaction requests between the agent and the environment; The asynchronous request buffer and scheduling module is used to store interactive requests to be processed, and sort and manage the requests according to preset or dynamic scheduling strategies to realize asynchronous processing of requests. The round-level partial trajectory generation module is used to package the trajectory fragments before the call occurs, execute them in batches, and then replay the execution results back to the experience pool for the trainer to use; The dynamic resource orchestration module is responsible for actually executing tool call requests in interactive requests, monitoring the call frequency, time consumption and resource consumption of different tools, and allocating and adjusting computing resources for different types of requests to achieve load balancing and high-priority task assurance. Based on the analysis of historical tool call data and call behavior, a smooth estimation method is used to predict the agent's demand for environmental sandbox usage, pre-start the sandbox, hide the cold start overhead of the sandbox, and reduce the end-to-end latency of agent-environment interaction.

[0019] This invention provides an automated AI agent interaction and resource management method and system. The resource management method includes: intercepting and taking over all interaction requests between the agent and the environment; storing pending interaction requests, sorting and managing the requests according to a preset or dynamic scheduling strategy to achieve asynchronous processing of requests; packaging trajectory fragments before the call occurs into a partial trajectory sample and sending it to an experience replay pool for use by the trainer; and being responsible for actually executing tool call requests in the interaction requests, monitoring the call frequency, time consumption, and resource consumption of different tools, and allocating and adjusting computing resources for different types of requests to achieve load balancing and high-priority task assurance. As a general-purpose component, it can be seamlessly integrated into existing RL frameworks, significantly improving the scalability and efficiency of training.

[0020] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0021] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 A flowchart illustrating an automated AI agent's interaction with the environment and resource management method provided in an embodiment of the present invention. Detailed Implementation

[0023] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0024] The terms "comprising" and "having," and any variations thereof, in the specification, embodiments, claims, and drawings of this invention are intended to cover non-exclusive inclusion, such as including a series of steps or units.

[0025] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments.

[0026] This invention aims to address the problems of poor environment scalability, low GPU utilization (especially caused by "round-by-round skew bubbles"), and chaotic resource scheduling in existing Agentic RL training frameworks. It provides an automated environment interaction management system (AIO), which, as a general-purpose component, can be seamlessly integrated into existing RL frameworks, significantly improving training scalability and efficiency.

[0027] like Figure 1 As shown, an automated AI agent interacts with the environment and manages resources. The resource management method includes: Intercept and take over all interaction requests between the agent and the environment; Store pending interactive requests, sort and manage the requests according to preset or dynamic scheduling strategies, and realize asynchronous processing of requests; The trajectory fragments before the call are packaged, executed in batches, and then the execution results are replayed into the experience pool for the trainer to use. It is responsible for actually executing tool call requests in interactive requests, monitoring the call frequency, time consumption and resource consumption of different tools, and allocating and adjusting computing resources for different types of requests to achieve load balancing and high-priority task guarantee; Based on the analysis of historical tool call data and call behavior, a smooth estimation method is used to predict the agent's demand for environmental sandbox usage, pre-start the sandbox, hide the cold start overhead of the sandbox, and reduce the end-to-end latency of agent-environment interaction.

[0028] This invention proposes an Automated Environment Interaction and Resource Management System (AIO) for agent reinforcement learning. As an independent system component in the reinforcement learning framework, it is responsible for managing the entire lifecycle of agent-environment interaction.

[0029] The system includes at least: Interaction Lifecycle Management Module: As the system's entry point, it intercepts and takes over all interaction requests between the agent and the environment, especially tool call requests.

[0030] Asynchronous Request Buffering and Scheduling Module: This module includes a built-in request buffer pool to store all pending tool call requests. It sorts and manages requests according to preset or dynamic scheduling strategies (such as FIFO or priority queues) to achieve asynchronous request processing.

[0031] Turn-level Partial Rollout Generation Module: One of the core innovations of this invention. When a tool call request is submitted to the buffer module, the module immediately packages the trajectory fragments (state, action, reward, etc.) before the call into a "partial rollout" sample and sends it to the Replay Buffer for use by the learner.

[0032] Dynamic Resource Orchestration Module: Responsible for actually executing tool call requests in the buffer pool. This module can monitor the call frequency, duration, and resource consumption of different tools, and dynamically allocate and adjust computing resources (such as process / thread pool size, network bandwidth, etc.) for different types of requests to achieve load balancing and ensure high-priority tasks.

[0033] The steps are as follows: Interception and Buffering: When an agent initiates a tool call during interaction with the environment, the AIO lifecycle management module intercepts the request and stores it in the asynchronous request buffer module.

[0034] Generate partial trajectories and release the GPU: Simultaneously, the partial trajectory generation module immediately packages the completed interaction data of the current round (i.e., the state and actions before the tool call) into a training sample and sends it to the downstream trainer. At this point, the task of the GPU responsible for data sampling (Rollout GPU) is complete, and it can immediately begin processing the interaction tasks of the next environment without waiting for the tool call to return. This step completely eliminates "round-level skew bubbles."

[0035] Asynchronous execution and resource orchestration: The dynamic resource orchestration module retrieves requests from the buffer pool and allocates resources for execution based on the current system load and scheduling strategy. This module monitors the usage of each tool and dynamically adjusts resource allocation strategies, such as allocating more resources to high-concurrency or resource-intensive tool calls.

[0036] Results and state synchronization: After the tool call is completed, AIO returns the results to the corresponding environment instance, so that its state is updated and ready for the next round of interaction.

[0037] Framework-independent integration: AIO is designed as an independent system component that can be seamlessly integrated with any mainstream RL framework (such as on-policy / off-policy, synchronous / asynchronous, centralized / distributed) through standardized interfaces without requiring any modification to the framework itself.

[0038] Beneficial effects: Completely eliminates round-level skewed bubbles and maximizes GPU utilization: Through the "round-level partial trajectory" mechanism, data sampling computation (GPU-intensive) and tool call waiting (I / O-intensive) are completely decoupled, enabling Rollout GPUs to achieve near 100% utilization and improving data throughput.

[0039] Scalability and convenience: AIO centrally manages all environment interactions and resources, and can easily distribute tool call tasks to the entire computing cluster without requiring developers to manually implement complex distributed logic, thus achieving seamless scaling of the environment.

[0040] Intelligent load balancing and resource optimization: Through dynamic monitoring and resource orchestration, the system can automatically identify and prioritize high-frequency or resource-intensive tasks, avoiding resource bottlenecks, achieving load balancing across the entire system, and improving stability and overall performance.

[0041] High versatility and ease of use: As a plug-and-play system component, AIO is transparent to upper-layer RL algorithms and can be integrated into various existing frameworks at zero cost, lowering the barrier for researchers and engineers to build efficient agentic RL systems.

[0042] The above specific embodiments further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for automating AI agent interaction and resource management with the environment, characterized in that, The resource management method includes: Intercept and take over all interaction requests between the agent and the environment; Store pending interactive requests, sort and manage the requests according to preset or dynamic scheduling strategies, and realize asynchronous processing of requests; The trajectory fragments before the call are packaged, executed in batches, and then the execution results are replayed into the experience pool for the trainer to use. It is responsible for actually executing tool call requests in interactive requests, monitoring the call frequency, time consumption and resource consumption of different tools, and allocating and adjusting computing resources for different types of requests to achieve load balancing and high-priority task guarantee; Based on the analysis of historical tool call data and call behavior, a smooth estimation method is used to predict the agent's demand for environmental sandbox usage, pre-start the sandbox, hide the cold start overhead of the sandbox, and reduce the end-to-end latency of agent-environment interaction.

2. The method for automated AI agent interaction and resource management according to claim 1, characterized in that, The computing resources include: process / thread pool size and network bandwidth.

3. The method for automated AI agent interaction and resource management according to claim 1, characterized in that, The scheduling strategies specifically include: FIFO, priority queue, shortest task first, and fair shared scheduling.

4. The method for automated AI agent interaction and resource management according to claim 1, characterized in that, The interception and takeover of all interaction requests between the agent and the environment specifically includes: the agent initiating a tool call during the interaction with the environment.

5. The method for automated AI agent interaction and resource management according to claim 1, characterized in that, The storage of pending interactive requests, according to a preset or dynamic scheduling strategy, sorts and manages the requests to achieve asynchronous processing of the requests, specifically including: Package the completed interaction data of the current round into a training sample and send it to the downstream trainer; The GPU responsible for data sampling has completed its task and can immediately begin processing the next interactive task in the environment without waiting for the tool call to return.

6. The method for automated AI agent interaction and resource management according to claim 5, characterized in that, The interactive data specifically includes: the state and actions before the tool is invoked.

7. The method for automated AI agent interaction and resource management according to claim 1, characterized in that, The step of packaging the trajectory fragments prior to the call into a partial trajectory sample and sending it to the experience replay pool for use by the trainer specifically includes: After the tool call is completed, AIO returns the result to the corresponding environment instance, updating its state and preparing it for the next round of interaction.

8. The method for automated AI agent interaction and resource management according to claim 1, characterized in that, The specific tasks include: handling tool invocation requests in the actual execution of interaction requests; monitoring the invocation frequency, time consumption, and resource consumption of different tools; and allocating and adjusting computing resources for different types of requests to achieve load balancing and high-priority task guarantees. Framework-independent integration: AIO is designed as a standalone system component that integrates seamlessly with any mainstream RL framework through standardized interfaces.

9. The method for automated AI agent interaction and resource management according to claim 8, characterized in that, The RL framework specifically includes: on-policy / off-policy, synchronous / asynchronous, centralized / distributed.

10. An automated AI agent interaction and resource management system, employing the automated AI agent interaction and resource management method according to any one of claims 1-9, characterized in that, The resource management system includes: The interaction lifecycle management module is used to intercept and take over all interaction requests between the agent and the environment; The asynchronous request buffer and scheduling module is used to store interactive requests to be processed, and sort and manage the requests according to preset or dynamic scheduling strategies to realize asynchronous processing of requests. The round-level partial trajectory generation module is used to package the trajectory fragments before the call occurs, execute them in batches, and then replay the execution results back to the experience pool for the trainer to use; The dynamic resource orchestration module is responsible for actually executing tool call requests in interactive requests, monitoring the call frequency, time consumption and resource consumption of different tools, and allocating and adjusting computing resources for different types of requests to achieve load balancing and high-priority task assurance. Based on the analysis of historical tool call data and call behavior, a smooth estimation method is used to predict the agent's demand for environmental sandbox usage, pre-start the sandbox, hide the cold start overhead of the sandbox, and reduce the end-to-end latency of agent-environment interaction.

Citation Information

Patent Citations

  • State control method, device and equipment of monitoring terminal and storage medium

    CN118859731A

  • Software testing method, device and equipment based on heterogeneous multi-agent and medium

    CN120803954A

  • Provisioning service requests in a computer system

    US20160379125A1

  • Artificial intelligence (AI) assisted end-to-end workflow integration for software development in digital model platforms

    WO2025072894A1