Three-dimensional space generative intelligent agent generation method, device and electronic equipment

By building a three-dimensional activity scene and time system, animators and pathfinding components are generated, the problem of generative agents operating in three-dimensional space is solved, and the automatic pathfinding and task execution of the agents in three-dimensional scenes is realized, and actions are improved. Flexibility and fineness.

CN119169203BActive Publication Date: 2025-02-07SOUTHERN UNIVERSITY OF SCIENCE AND TECHNOLOGY

Patent Information

Application Number
CN202411658253.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2025-02-07
Estimated Expiration
2044-11-20

AI Technical Summary

Technical Problem

In the prior art, generative agents are mainly limited to two-dimensional space and cannot be effectively generated and operated in three-dimensional space, resulting in limited action mode and difficulty in achieving fine actions.

Method used

By building a three-dimensional activity scene and time system, importing the initial virtual objects and setting up personal information, creating a memory library, generating animator components and pathfinding components based on the initial virtual objects, generating a generative agent to realize its automatic operation in a three-dimensional scene Wayfinding and mission execution.

Benefits of technology

It realizes the function of automatically finding a path in a three-dimensional scene by generating agents, and can automatically perform various tasks according to the surrounding environment and its own situation, improving the flexibility and fineness of the agents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119169203B_ABST
    Figure CN119169203B_ABST
Patent Text Reader

Abstract

The present application relates to a method, device and electronic device for generating a generative intelligent agent in three-dimensional space. The method includes: building a three-dimensional activity scene based on preset scene elements and building a time system for the activity scene; importing an initial virtual object and setting personal information of the initial virtual object; the initial virtual object is a three-dimensional model; creating a memory bank of the initial virtual object; creating an animator component and a pathfinding component based on the initial virtual object to generate a generative intelligent agent; the animator component is used to control the generative intelligent agent to perform actions, the pathfinding component is used to navigate the generative intelligent agent in the activity scene, the generative intelligent agent is used to perform preset tasks, the preset tasks are generated based on personal information, content stored in the memory bank, time points of the time system and locations in the activity scene, and a three-dimensional activity scene and intelligent agent object can be constructed, the automatic pathfinding function of the intelligent agent in the three-dimensional scene is realized, and the task can be automatically performed according to the surrounding environment and its own situation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer application technology, and in particular to a method, device and electronic device for generating a three-dimensional space generative intelligent agent. Background Art

[0002] Generative agents are agents that use generative models to simulate credible human behavior. They are an emerging agent construction solution in recent years, and their emergence relies on the rise of large language models. In the past, the underlying design logic of agents was mostly finite state machines or AI (Artificial Intelligence) behavior trees. Such agents are difficult to code and have fixed behavior patterns, making it difficult to cope with various complex environments and tasks. Generative agents can use the excellent text processing capabilities of large language models to automatically perform various actions according to changes in the environment and their own state, and their behavior patterns are more flexible and varied.

[0003] In the related technologies, most of the products of generative agents are 2D (Two-Dimensional) rather than 3D (three-dimensional). In two-dimensional space, the automatic path finding, environment and other role detection algorithms of generative agents only need to consider two-dimensional vector coordinates, and the construction method is relatively simple and the construction cost is low. However, compared with three-dimensional space, two-dimensional space has many disadvantages, such as: only providing flat images and lack of depth information, reducing the user's sense of space and immersion, limiting the action mode of the agent, and making it difficult to achieve the fine movements of the agent. Therefore, it is necessary to create a generative agent in three-dimensional space. Summary of the invention

[0004] In order to solve or partially solve the problems existing in the related art, the present application provides a three-dimensional space generative intelligent agent generation method, device and electronic device, which can construct three-dimensional activity scenes and generative intelligent agent objects, realize the function of automatic path finding of the generative intelligent agent in the three-dimensional scene, and can automatically perform various tasks in the scene according to the surrounding environment and its own situation.

[0005] The first aspect of the present application provides a three-dimensional space generative agent generation method, comprising:

[0006] Building a three-dimensional activity scene based on preset scene elements, and building a time system for the activity scene; the time system is used to indicate the time of the activity scene;

[0007] Importing an initial virtual object and setting personal information of the initial virtual object; the initial virtual object is a three-dimensional model;

[0008] Creating a memory library of the initial virtual object;

[0009] An animator component and a pathfinding component are created based on the initial virtual object to generate a generative agent; the animator component is used to control the generative agent to perform actions, the pathfinding component is used to navigate the generative agent in the activity scene, and the generative agent is used to perform preset tasks, and the preset tasks are generated based on the personal information, the content stored in the memory bank, the time point of the time system and the location in the activity scene.

[0010] Preferably, the process of building a three-dimensional activity scene of a generative agent based on preset scene elements and building a time system of the activity scene includes:

[0011] Importing the initial model of the preset scene elements; the preset scene elements include buildings, roads, and decorations; the buildings have location information;

[0012] Setting the specifications and posture of the initial model, and connecting the buildings through the roads;

[0013] Creating a control script for the time system; the control script includes a time variable; the time variable is used to represent a time point of the time system;

[0014] The time variable is controlled to change according to a preset time change condition.

[0015] Preferably, the pathfinding component includes a navigation component and a grid proxy component, and the steps after generating the generative agent include:

[0016] Acquiring a target location based on the grid proxy component;

[0017] Calculate the best path to move to the target location based on the navigation component;

[0018] The animator component controls the generative agent to move to the target location according to the optimal path.

[0019] Preferably, the generative agent is provided with personal information, and the method further comprises:

[0020] Generate a first prompt word based on the personal information, the content stored in the memory bank, the time point of the time system and the location in the activity scene, and send the first prompt word to a preset large language model; the first prompt word is used to generate the preset task;

[0021] Obtain the preset task generated by the preset large language model;

[0022] Splitting the preset task into several subtasks;

[0023] Extracting key elements of the subtask; the key elements include start time, end time, and location;

[0024] Compare the start time and the end time of each subtask with the current time in the time system in turn;

[0025] When the start time in the subtask is the same as the current time in the time system, the generative agent is controlled to move to the location, and the generative agent begins to execute the subtask; when the end time in the subtask is the same as the current time in the time system, the subtask is completed.

[0026] Preferably, after the subtask is executed, the following step is also included:

[0027] Generate a second prompt word based on the personal information and the subtask, and send the second prompt word to the preset large language model; the second prompt word is used to expand the detailed experience of the subtask;

[0028] The expansion result generated by the preset large language model is obtained, and the expansion result is stored in the memory bank.

[0029] Preferably, the method further comprises:

[0030] Setting a perceptron and a collision body for the generative agent, and setting a range of the collision body;

[0031] Detecting, by the perceptron, whether there are other generative agents within the range of the collision body;

[0032] When the other generative agent exists, the personal information of the generative agent and a preset number of memories, the personal information of the other generative agents and a preset number of memories, and the preset number of memories between the two generative agents are retrieved from the memory bank to generate a third prompt word, and the third prompt word is sent to the preset large language model; the third prompt word is used to generate a dialogue;

[0033] Acquire the conversation content generated by the preset large language model and display the conversation content.

[0034] Preferably, after displaying the conversation content, the method further includes:

[0035] generating a fourth prompt word based on the conversation content, and sending the fourth prompt word to the preset large language model; the fourth prompt word is used to summarize the conversation content;

[0036] Obtaining a conversation summary generated by the preset large language model;

[0037] The conversation summary is saved in the memory bank.

[0038] Preferably, the memory library includes three memory layers, wherein the first memory layer is used to index different memory objects, the second memory layer is used to index different days, and the third memory layer is used to index memory content. The method further includes:

[0039] Setting a storage threshold of the memory bank;

[0040] When the storage content in the memory library exceeds the storage threshold, the memory library is simplified by a preset memory function.

[0041] A second aspect of the present application provides a three-dimensional space generative agent generation device, comprising:

[0042] A building module, used to build a three-dimensional activity scene based on preset scene elements, and to build a time system for the activity scene; the time system is used to indicate the time of the activity scene;

[0043] An import module, used to import an initial virtual object and set personal information of the initial virtual object; the initial virtual object is a three-dimensional model;

[0044] A creation module, used for creating a memory library of the initial virtual object;

[0045] A generation module is used to create an animator component and a pathfinding component based on the initial virtual object to generate a final generative agent; the animator component is used to control the generative agent to perform actions, the pathfinding component is used to navigate the generative agent in the activity scene, and the generative agent is used to perform preset tasks, and the preset tasks are generated based on the personal information, the content stored in the memory bank, the time point of the time system and the location in the activity scene.

[0046] A third aspect of the present application provides an electronic device, including:

[0047] Processor; and

[0048] The memory stores executable codes thereon, and when the executable codes are executed by the processor, the processor is caused to execute the method as described above.

[0049] The technical solution provided by the present application may include the following beneficial effects: by building a three-dimensional activity scene based on preset scene elements, and building a time system for the activity scene, an initial virtual object is imported, and personal information of the initial virtual object is set, the initial virtual object is a three-dimensional model, and a memory library of the initial virtual object is created, an animator component and a pathfinding component are created based on the initial virtual object, and a generative agent is generated, the animator component is used to control the generative agent to perform actions, the pathfinding component is used to navigate the generative agent in the activity scene, and the generative agent is used to perform preset tasks, and the preset tasks are generated based on the personal information, the content stored in the memory library, the time point of the time system and the location in the activity scene, so that a three-dimensional activity scene and a generative agent object can be constructed, the function of automatic pathfinding of the generative agent in the three-dimensional scene is realized, and various tasks can be automatically performed in the scene according to the surrounding environment and its own situation.

[0050] The technical solution of the present application can also: provide a specific operation plan for the creation of a generative intelligent agent in three-dimensional space, simplify the construction operation of the generative intelligent agent, reduce the uncertainty and confusion in the creation process of the generative intelligent agent, help reduce the waste of time and resources in the decision-making and execution process, ensure the success rate of the creation of the generative intelligent agent, and also complete the construction of the action module of the generative intelligent agent in three-dimensional space, so that the generative intelligent agent can normally process data information in three-dimensional space, realize the function of automatic pathfinding of the generative intelligent agent in three-dimensional scenes, and can automatically perform various tasks in the scene according to the surrounding environment and its own situation.

[0051] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] The above and other objects, features and advantages of the present application will become more apparent by describing in more detail the exemplary embodiments of the present application in conjunction with the accompanying drawings, wherein the same reference numerals generally represent the same components in the exemplary embodiments of the present application.

[0053] Figure 1 It is a flowchart of a method for generating a three-dimensional space generative intelligent agent according to an embodiment of the present application;

[0054] Figure 2 is another flow chart of the method for generating a three-dimensional space generative agent according to an embodiment of the present application;

[0055] Figure 3 is a schematic diagram of an activity scene shown in an embodiment of the present application;

[0056] Figure 4 is a flow chart of a method for a generative agent to perform a task according to an embodiment of the present application;

[0057] Figure 5 is a flow chart of a method for a generative agent to perform a task as shown in an embodiment of the present application;

[0058] Figure 6 is a flow chart of a method for generative agent communication shown in an embodiment of the present application;

[0059] Figure 7 is a schematic diagram of a collision body of a generative agent shown in an embodiment of the present application;

[0060] Figure 8 is a schematic diagram of the structure of the memory bank shown in the embodiment of the present application;

[0061] Fig. 9 is a flow chart of a method for generative agent communication shown in an embodiment of the present application;

[0062] Fig.10 It is a structural schematic diagram of a three-dimensional space generative agent generation device shown in an embodiment of the present application;

[0063] Fig.11 It is a schematic diagram of the structure of an electronic device shown in an embodiment of the present application. DETAILED DESCRIPTION

[0064] The embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to make the present application more thorough and complete, and to fully convey the scope of the present application to those skilled in the art.

[0065] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0066] It should be understood that although the terms "first", "second", "third", etc. may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.

[0067] In the related technology, most of the products of generative agents are 2D rather than 3D. In two-dimensional space, the algorithms of automatic path finding, environment and other role detection of generative agents only need to consider two-dimensional vector coordinates, and the construction method is relatively simple and the construction cost is low. However, compared with three-dimensional space, two-dimensional space has many disadvantages, such as: only providing flat images and lack of depth information, reducing the user's sense of space and immersion, limiting the action mode of the agent, and making it difficult to achieve the fine movements of the agent. Therefore, it is necessary to create a generative agent in three-dimensional space.

[0068] In response to the above problems, an embodiment of the present application provides a method for generating a generative intelligent agent in a three-dimensional space, which can construct a three-dimensional activity scene and a generative intelligent agent object, realize the function of automatic pathfinding of the generative intelligent agent in the three-dimensional scene, and can automatically perform various tasks in the scene according to the surrounding environment and its own situation.

[0069] The technical solution of the embodiments of the present application is described in detail below with reference to the accompanying drawings.

[0070] Figure 1 It is a flow chart of a three-dimensional space generative intelligent agent generation method shown in an embodiment of the present application.

[0071] See also Figure 1 , the method comprising:

[0072] Step 101, building a three-dimensional activity scene based on preset scene elements, and building a time system for the activity scene; the time system is used to indicate the time of the activity scene.

[0073] A generative agent is an agent that uses generative models to simulate credible human behavior and is able to make extensive inferences about itself, other agents, and the environment; it can create daily plans that reflect its own characteristics and experience, execute these plans, react, and re-plan when appropriate; it can respond when the end user changes the environment or commands them in natural language.

[0074] In an embodiment of the present application, an activity scene of a generative intelligent agent is first built, and the model required for the preset scene elements is imported into Unity3D (Unity 3D), and the model format of the model can be FBX (Filmbox) format, and then the imported model is added to the activity scene, wherein the activity scene is three-dimensional.

[0075] After the activity scene is built, a time system needs to be built. The time system can represent the time of the activity scene. The action switching of the generative agent needs to be based on time. At each specific time node, the generative agent will switch its current action accordingly. Therefore, a time system that can be accessed by the generative agent at any time needs to be built in to help the generative agent perform action switching.

[0076] Step 102, importing an initial virtual object and setting personal information of the initial virtual object; the initial virtual object is a three-dimensional model.

[0077] The character model of the required generative intelligent agent can be imported into the Unity3D engine. After the import is completed, an initial virtual object (Avatar) is created for each character model. After the operation is completed, the initial virtual object is added to the scene. The initial virtual object is also a three-dimensional model.

[0078] In addition, you can create a new script to store the personal information of each generative agent. The personal information should at least include the "name" and "personal profile" of each generative agent (including the life, work, daily plan, etc. of the generative agent). Other information such as "character avatar" and "character gender" can be added to the script according to actual needs. After the script is written, bind this script to each generative agent in the activity scene.

[0079] Step 103: Create a memory library of initial virtual objects.

[0080] In order to realize the memory function of the generative agent, the embodiment of the present application creates a separate memory bank for each generative agent, and the structures of the memory banks of each generative agent are the same.

[0081] Step 104, creating an animator component and a pathfinding component based on the initial virtual object to generate a generative agent; the animator component is used to control the generative agent to perform actions, the pathfinding component is used to navigate the generative agent in the activity scene, and the generative agent is used to perform preset tasks, which are generated based on personal information, content stored in the memory, time points of the time system, and locations in the activity scene.

[0082] The Animator component can control and manage the animation playback of game objects, acting as a bridge between animation and game objects, allowing developers to finely control the playback, mixing, and transition between different animation states of animation. In an embodiment of the present application, an animator component can be created for generative intelligence, and the animator component can be used to control the generative agent to perform various actions.

[0083] In order to enable the generative agent to move in the scene as required, a pathfinding component can be created for the generative agent in an embodiment of the present application to navigate the generative agent, thereby realizing the automatic pathfinding function of the generative agent.

[0084] After creating the animator component and the pathfinding component, the generative agent generation process is basically completed. In order to simulate the daily activities of humans in real life, preset tasks can also be assigned to the generative agent. Generally, the preset tasks are generated based on personal information, content stored in the memory bank, time points in the time system, and locations in the activity scene. The generative agent can perform the corresponding preset tasks. The generative agent produced by the embodiment of the present application can play a role in many fields such as the computer field (specific application of large language models), the entertainment industry (construction of NPC (non-player character) in electronic games), and sociology (using multiple agents to simulate small societies).

[0085] The embodiment of the present application discloses a method for generating a generative intelligent agent in a three-dimensional space. The method comprises building a three-dimensional activity scene based on preset scene elements, building a time system for the activity scene, wherein the time system is used to represent the time of the activity scene, importing an initial virtual object, setting personal information of the initial virtual object, wherein the initial virtual object is a three-dimensional model, creating a memory library of the initial virtual object, creating an animator component and a pathfinding component based on the initial virtual object, generating a generative intelligent agent, wherein the animator component is used to control the generative intelligent agent to perform actions, and the pathfinding component is used to navigate the generative intelligent agent in the activity scene. The generative intelligent agent is used to perform preset tasks, which are generated based on personal information, content stored in the memory library, time points of the time system and locations in the activity scene. The method can construct a three-dimensional activity scene and a generative intelligent agent object, realize the function of the generative intelligent agent automatically finding its way in the three-dimensional scene, and can automatically perform various tasks in the scene according to the surrounding environment and its own situation.

[0086] Figure 2 It is another flow chart of a three-dimensional space generative intelligent agent generation method shown in an embodiment of the present application.

[0087] See also Figure 2 , the method comprising:

[0088] Step 201, importing an initial model of preset scene elements; the preset scene elements include buildings, roads, and decorations; buildings have location information.

[0089] like Figure 3 The figure shows a schematic diagram of an activity scene. A complete scene can contain scene elements such as buildings, roads, and decorations. Buildings are the main venues for generative agents to move around, such as "shopping malls", "restaurants", and "libraries". Roads are used for generative agents to move between buildings. Decorations can include street lights and trees. The initial models of scene elements such as buildings, roads, and decorations can be imported into Unity3D, and then the imported models can be added to the activity scene.

[0090] For a building, you can add an empty object as its child object. This child object is placed in front of the building, and its coordinate position will be used as the end point of the generative agent pathfinding system in the subsequent process. At the same time, the child object needs to mount a script (such as a C# script), which needs to store the location information (such as the name) of the corresponding building in the form of a string to distinguish different buildings.

[0091] Step 202, setting the specifications and posture of the initial model, and connecting the buildings through roads.

[0092] Adjust the model specifications, orientation, and placement according to actual needs. There should be enough distance between buildings, and no overlapping parts should appear. Buildings are connected by roads, and there must be at least one road between any two buildings. If there are decorations, they can be placed anywhere that does not block the road and does not overlap with the building.

[0093] You can also add colliders for decorations and buildings. If you don't need high precision, you can use the "Box Collider" in Unity, otherwise use the more sophisticated "MeshCollider".

[0094] Step 203, create a control script for the time system; the control script includes a time variable; the time variable is used to represent a time point of the time system.

[0095] Create a new control script for the time system in Unity3D, and create three int-type time variables in the control script, representing "the total number of days that have passed", "the current hour" and "the current minute" respectively, which can represent the time point of the time system. The three variables can be set as global static variables, which can be conveniently called by other scripts at any time.

[0096] Step 204, controlling the time variable to change according to a preset time change condition.

[0097] According to the time change logic of the real world (i.e., 1 hour is added every 60 minutes, and 1 day is added every 24 hours), the changes of the above three time variables are controlled. After the program is run, the code will run automatically to control the flow of time in the virtual world.

[0098] You can also add Unity3D's UI (User Interface) component "Canvas" to the active scene, then add a component (Text_TMP) to display time in the Canvas, and pass the three time variables in the above time system script to the component. Then you can observe the virtual world time of the current active scene on the screen at any time during the program running.

[0099] Step 205, importing an initial virtual object and setting personal information of the initial virtual object; the initial virtual object is a three-dimensional model.

[0100] The character model of the required generative intelligent agent can be imported into the Unity3D engine. After the import is completed, an initial virtual object (Avatar) is created for each character model. After the operation is completed, the initial virtual object is added to the scene, where the initial virtual object is also a three-dimensional model.

[0101] In addition, you can create a new script to store the personal information of each generative agent. The personal information should at least include the "name" and "personal profile" of each generative agent (including the life, work, daily plan, etc. of the generative agent). Other information such as "character avatar" and "character gender" can be added to the script according to actual needs. After the script is written, bind this script to each generative agent in the activity scene.

[0102] Step 206: Create a memory library of initial virtual objects.

[0103] In order to realize the memory function of the generative agent, the embodiment of the present application creates a separate memory bank for each generative agent, and the structures of the memory banks of each generative agent are the same.

[0104] Step 207, create an animator component and a pathfinding component based on the initial virtual object to generate a generative agent; the animator component is used to control the generative agent to perform actions, the pathfinding component is used to navigate the generative agent in the activity scene, and the generative agent is used to perform preset tasks, which are generated based on personal information, content stored in the memory, time points of the time system, and locations in the activity scene.

[0105] The animator component can control and manage the animation playback of game objects. In an embodiment of the present application, an animator component can be created for generative intelligence, and the generative agent can be controlled to perform various actions through the animator component. In order to enable the generative agent to move in the scene as required, a pathfinding component can be created for the generative agent in an embodiment of the present application. After creating the animator component and the pathfinding component, the generative agent generation process is basically completed. In order to simulate the daily activities of humans in real life, preset tasks can also be assigned to the generative agent. Generally, the preset tasks are generated based on personal information in the memory bank, stored content, time points in the time system, and locations in the activity scene. The generative agent can perform the corresponding preset tasks.

[0106] In the process of creating the animator component, you can import the skeletal animation files of various character actions of the initial virtual object into the Unity3D engine, where "standing" and "walking" are required actions, and "sitting down" and "lying down" are optional actions, which can be selected according to actual needs. Then open the Inspector window of the generative agent in the Unity3D engine, find the "Avatar" column in the "Animator" component, drag the Avatar of each agent model to this position, and assign the Avatar to its respective Animator component in this way. Then create a new Animator Controller file in a folder in any Unity3D project and assign it to the Animator component of each generative agent. Then open the Animator Controller file and add the skeletal animation file to the Animator Controller file. After completing the above operations, each generative agent in the scene can perform the corresponding character actions.

[0107] In an optional embodiment of the present application, the pathfinding component includes a navigation component and a grid proxy component, and after step 207, the following steps are further included:

[0108] Step S11, obtaining a target location based on a grid proxy component;

[0109] The pathfinding component in the embodiment of the present application includes a navigation component and a mesh agent (NavMeshAgent) component. To realize the automatic pathfinding function, you must first implement the map baking step. First, select the built active scene and set its static tag type to "Navigation Static". Then set the baking parameters in the Navigation window of the Unity3D engine for baking. In addition, you need to add a mesh agent component to the generative agent in the active scene.

[0110] In the process of realizing automatic pathfinding, you can create a new script and introduce the namespace "usingUnityEngine.AI (Artificial Intelligence Navigation)" in the script. Set a public method in the script and name it Move(). In this method, call the "NavMeshAgent.SetDestination(Vector3)" function in the "UnityEngine.AI" library, and input the three-dimensional coordinates of the target location in the active scene in the form of Vector3 (3D vector) into the "NavMeshAgent.SetDestination(Vector3)" function to obtain the target location.

[0111] Step S12, calculating the best path to the target location based on the navigation component;

[0112] The Unity3D engine can then render the path based on the map baking results and automatically use the Navigation component to calculate the optimal path between the generated agent and the target location.

[0113] Step S13, the animator component controls the generative agent to move to the target location according to the optimal path.

[0114] After the best path is calculated, the animator component will control the generative agent to automatically move to the target location at a certain speed. After that, by calling this Move() method at any time, the generative agent can complete automatic pathfinding in the scene. At the same time, the Euclidean distance between the current generative agent and the target point is calculated in the "Update()" method in the script. If the distance between the two is far, it proves that the current generative agent is still on the way to the target location. At this time, the Animator component of the generative agent can be used to play the "walking" animation in the Animator Controller file; when the generative agent reaches the target location, stop playing the "walking" animation and start playing the "standing" animation. At this point, the generative agent can play the corresponding animation according to its current state.

[0115] The embodiment of the present application discloses a method for generating a generative intelligent agent in a three-dimensional space, which includes importing an initial model of preset scene elements, wherein the preset scene elements include buildings, roads, and decorations, and the buildings have location information, setting the specifications and posture of the initial model, connecting the buildings through roads, creating a control script of a time system, wherein the control script includes a time variable, and controlling the time variable to change according to a preset time change condition, importing an initial virtual object, setting personal information of the initial virtual object, wherein the initial virtual object is a three-dimensional model, creating a memory library of the initial virtual object, creating an animator component and a pathfinding component based on the initial virtual object, generating a generative intelligent agent, wherein the animator component is used to control the generative intelligent agent to perform actions, and the pathfinding component is used to navigate the generative intelligent agent in an active scene, Generative agents are used to perform preset tasks, which are generated based on personal information, content stored in the memory bank, time points in the time system, and locations in the activity scene, thereby providing a specific operation plan for the creation of generative agents in three-dimensional space, simplifying the construction operation of generative agents, reducing uncertainty and confusion in the creation process of generative agents, helping to reduce the waste of time and resources in the decision-making and execution process, ensuring the success rate of generative agent creation, and also completing the construction of action modules for generative agents in three-dimensional space, so that generative agents can normally process data information in three-dimensional space, realize the function of automatic pathfinding of generative agents in three-dimensional scenes, and can automatically perform various tasks in the scene according to the surrounding environment and its own situation.

[0116] Figure 4 It is a flow chart of a method for a generative agent to perform tasks shown in an embodiment of the present application.

[0117] like Figure 4 As shown, the method includes:

[0118] Step 401, generating a first prompt word based on personal information, content stored in a memory bank, a time point in a time system, and a location in an activity scene, and sending the first prompt word to a preset large language model; the first prompt word is used to generate a preset task.

[0119] The generative agent can integrate, process, and splice personal information, content stored in the memory bank, time points of the time system, and locations in the activity scene to generate a first prompt word that is sent to a preset large language model. The first prompt word is used to generate a preset task. It is understandable that if the current program is running for the first time, the generative agent has not performed any actions, and the memory bank of the generative agent is empty. The content stored in the memory bank can be regarded as blank content. Assume that the string currently storing the character name is "Name", and the string storing the personal profile is "Profile". There are n main buildings in the activity scene, namely: "Building 1, Building 2, Building 3...Building n". An example of the assembly rule of the first prompt word is as follows:

[0120] Prompt word =

[0121] "You are" + Name + "Here is your personal profile:" + Profile +

[0122] “Here is the introduction to this town:”+

[0123] "There are n places in the town. They are Building 1, Building 2, Building 3... Building n" +

[0124] "Let's say you just woke up. What are your goals for today? Start writing every hour from 8:00. Write down the tasks you will do in your town. Write only one or two short sentences for each task. Keep the word count to 100 words or less. All times are in 24-hour format."

[0125] Specifically, suppose the current character's name is Zhang San, and his personal profile is "Zhang San is a worker", and the main buildings in the current scene include "residential area", "factory", "restaurant", and "park". The prompt words generated at this time are: "You are Zhang San. Here is your personal profile: Zhang San is a worker. Here is an introduction to the town: There are 4 places in the town. They are factories, parks, residential areas, and restaurants. Suppose you just got up. What is your goal for today? Starting from 8:00, write once every hour. Write down the various tasks you will do in the town. Write only one or two short sentences for each task. The number of words is controlled within 100 words. All times that appear in it are in 24-hour format."

[0126] If the memory bank of the generative agent is not empty and has stored content, the prompt word can be generated based on personal information, the content stored in the memory bank, the time point of the time system, and the location in the activity scene. In an example, assuming that the string currently storing the character's memory content is "Memory", the prompt word assembly rule example will also be modified to:

[0127] Prompt word =

[0128] “You are” + Name + “Here is your personal profile:” + Profile + “Here are your past experiences:” + Memory +

[0129] “Here is the introduction to this town:”+

[0130] "There are n places in the town. They are Building 1, Building 2, Building 3... Building n" +

[0131] "Let's say you just woke up. What are your goals for today? Start writing every hour from 8:00. Write down the tasks you will do in your town. Write only one or two short sentences for each task. Keep the word count to 100 words or less. All times are in 24-hour format."

[0132] After the first prompt word is generated, the first prompt word is encapsulated into a specified message format according to the preset large language model category, and then converted into Json (JS key-value pair data) format data, and finally the Json data is sent to the api (Application Programming Interface) interface of the preset large language model through the Unity3D engine in the form of a bit stream.

[0133] Step 402: Obtain a preset task generated by a preset large language model.

[0134] After receiving the message, the preset large language model will automatically generate a daily task schedule (preset task) for the generative agent. The task schedule contains several single task strings in the form of "XX:XX-XX:XX perform a certain job at a certain place". The task schedule is relatively rough, and its time granularity is one hour. The following is an example of a preset task (only some of the tasks are shown):

[0135] 8:00-9:00 Prepare breakfast at home

[0136] 9:00-10:00 Depart for the factory

[0137] 10:00-11:00 Start the assembly line inspection work

[0138] …

[0139] After the preset task is generated, it will be sent to the generative agent. After receiving the preset task, the generative agent will process it into a string form.

[0140] Step 403: split the preset task into several subtasks.

[0141] Split the preset tasks one by one using string segmentation, and use a List<string>Store each subtask to facilitate subsequent steps.

[0142] Step 404, extract key elements in the subtask; the key elements include start time, end time, and location.

[0143] Extract key elements from each subtask: "start time", "end time", and "location". First, use the string.split() method in the script to divide the string into two parts with the "-" character as the delimiter. The first half is the start time, and the number at the beginning of the second half is the end time. Then use the string.Contains() method in the script to determine whether the second half of the string contains the location information (such as the name) of the building in the scene. If it contains the corresponding name, the building is the target. If the second half of the string does not contain the name of any building in the current scene, the "location" of the task is set to empty. Take "9:00-10:00 departure to the factory" as an example. The "start time", "end time", and "location" of the task are "9:00", "10:00", and "factory" respectively. For the task of "starting assembly line inspection work from 10:00 to 11:00", the "start time", "end time" and "location" are "10:00", "11:00" and "" (leave blank) respectively.

[0144] Step 405, sequentially compare the start time and end time of each subtask with the current time in the time system.

[0145] Extract the current time of the time system and compare the current time with the start time and end time of each subtask in turn.

[0146] Step 406, when the start time in the subtask is the same as the current time in the time system, the generative agent is controlled to move to the location and the generative agent starts to execute the subtask; when the end time in the subtask is the same as the current time in the time system, the subtask is completed.

[0147] When the start time in the subtask is the same as the current time in the time system, if the location is not empty, the Move() method is called, and the three-dimensional spatial coordinates corresponding to the task "location" are input as input parameters into the Move() method to control the generative agent to move to the location, and the generative agent starts to execute the subtask. If the "location" is empty, it means that the generative agent does not need to move in space at present, so there is no need to call the Move() method.

[0148] When the end time in the subtask is the same as the current time in the time system, it means that the subtask is completed.

[0149] Step 407: Generate a second prompt word based on the personal information and the subtask, and send the second prompt word to the preset large language model; the second prompt word is used to expand the subtask detailed experience.

[0150] When the subtask is completed, the preset large language model can be used to enrich the detailed experience of the subtask, splice the task description of the subtask with personal information, generate a second prompt word, encapsulate the second prompt word into a specified message format according to the preset large language model category, and then convert it into Json format data, and finally send the Json data in the form of a bit stream through the Unity3D engine to the api interface of the preset large language model.

[0151] The splicing rules for the second prompt word are as follows:

[0152] Prompt word =

[0153] "You are" + Name + "Here is your personal profile:" + Profile +

[0154] "You have just completed the following task:" + Current task description +

[0155] "Please expand your work experience within this hour to make it more vivid and specific. The word count should be between 100-200 words."

[0156] Specifically, suppose the current character's name is Zhang San, his personal profile is "Zhang San is a worker", and the task he just completed is "10:00-11:00 start assembly line inspection work". Then the prompt words generated at this time are: "You are Zhang San. Here is your personal profile: Zhang San is a worker. You just completed the following task: 10:00-11:00 start assembly line inspection work. Please expand your work experience in this hour to make it more vivid and specific, and the number of words should be controlled between 100-200 words."

[0157] Step 408, obtaining the expansion result generated by the preset large language model, and storing the expansion result in the memory.

[0158] The preset large language model will automatically expand the subtask according to the second prompt word and send the expanded result to the generative agent. The generative agent can splice it into the expanded result according to the end time of the subtask, mark the occurrence time of the subtask, and save it in the memory bank of the generative agent.

[0159] After the current subtask is completed, it can also be detected whether all subtasks in the preset task are completed. If there are still unfinished subtasks, it can return to step 404 to execute the next subtask. If all subtasks in the preset task are completed, it can return to step 401 to regenerate a new preset task.

[0160] like Figure 5 As shown, it is a flow chart of a method for a generative agent to perform a task, wherein the generative agent is set at a client, and a preset large language model is set at a server. The generative agent includes an information processing module, a memory module, a time module and a memory module. The information processing module integrates the personal information of the generative agent, the location in the activity scene, the time point of the time system, and the content stored in the memory bank to generate a first prompt word for generating a preset task, and then encapsulates the first prompt word to generate a message and sends it to the server. The preset model large language of the server generates a preset task (a rough task table) according to the content of the message and sends it to the generative agent. The generative agent performs string processing on the preset task, splits the preset task, and obtains several subtasks. The time module sends the current time of the time system, extracts the subtask of the current time, and controls the generative agent to move to the target location through the action module. After the subtask is completed, the server generates an expanded result of the subtask detail experience, and sends it to the memory module for memory storage, and determines whether all subtasks are completed. If there are still subtasks that have not been completed, the subtask of the current time is re-extracted and the next subtask is executed. If all subtasks are completed, a new preset task is regenerated.

[0161] The embodiment of the present application discloses a method for a generative agent to perform a task, wherein a first prompt word is generated based on personal information, content stored in a memory bank, a time point of a time system, and a location in an activity scene, and the first prompt word is sent to a preset large language model. The first prompt word is used to generate a preset task, the preset task generated by the preset large language model is obtained, the preset task is divided into a plurality of subtasks, and key elements in the subtasks are extracted; the key elements include a start time, an end time, and a location, the start time and the end time in each subtask are compared with the current time in the time system in turn, when the start time in the subtask is the same as the current time in the time system, the generative agent is controlled to move to the location, the generative agent starts to perform the subtask, when the end time in the subtask is the same as the current time in the time system, the subtask is completed, a second prompt word is generated based on the personal information and the subtask, and the second prompt word is sent to the preset large language model, the second prompt word is used to expand the subtask detail experience, the expansion result generated by the preset large language model is obtained, and the expansion result is stored in the memory bank, so that the generative agent can spontaneously simulate humans in reality and perform normal daily activities according to the tasks generated by the large language model.

[0162] Figure 6 It is a flow chart of a method for generative intelligent agent communication shown in an embodiment of the present application.

[0163] See also Figure 6 , the method comprising:

[0164] Step 601, setting a perceptron and a collision body for the generative agent, and setting a range of the collision body.

[0165] You can set a perceptron for the generative agent, which can be used to identify whether there are other generative agents nearby. Then create an empty child object under the object of the generative agent in the Unity3D scene and name it "View". Then add a box collider component (collider) to "View" and then adjust the range of the collider component, such as Figure 7 The figure shows a schematic diagram of the collision body of the generative agent. The cube wireframe in the picture is the collider, which represents the field of view of the generative agent.

[0166] Step 602: Use a sensor to detect whether there are other generative agents within the range of the collision body.

[0167] Whenever an object enters the field of view of the collision body, the perceptron will detect it to determine whether the object is another generative agent. If the object is another generative agent, it can start trying to start a conversation process. In an example, suppose there are two generative agents in the scene: agent A and agent B. Both have the same structure and function, but different personal information. Both generative agents are in a moving state, and the perceptron of agent A can detect whether there are other generative agents within the range of the collision body.

[0168] Step 603, when there are other generative agents, retrieve the generative agent's own personal information and a preset number of memories, the personal information and a preset number of memories of other generative agents, and a preset number of memories between two generative agents from the memory bank, generate a third prompt word, and send the third prompt word to the preset large language model; the third prompt word is used to generate a dialogue.

[0169] In the process of moving towards the target location, if agent B enters the field of view of agent A, the sensor of agent A senses the presence of agent B. At this time, agent A will send a signal to notify the action modules of agents A and B to stop moving and stay in place to prepare for a conversation. In order to prevent other generative agents from approaching and trying to start a new conversation with agents A and B during the conversation between agents A and B, the sensors of both parties will be locked when the two agents stop moving. At this time, agents A and B will not sense other agents, nor will they be sensed by other generative agents. The sensor will automatically unlock after a period of time, and then agents A and B can talk to other generative agents again. The locking time of the sensor of the generative agent should not be too short, otherwise the sensor may be unlocked before the conversation between the two ends. At the same time, the locking time should not be too long, otherwise the generative agent will not be able to talk to other generative agents again for a long time after the end of a conversation. In an example, the locking time of the sensor can be set between 15 seconds and 20 seconds.

[0170] After the sensor is locked, agents A and B can officially start a conversation. Agent A will retrieve the following five sets of information: agent A's personal information, agent A's most recent preset number of memories about itself (e.g., 10), agent B's personal information, agent B's most recent preset number of memories about itself (e.g., 10), agent A's most recent preset number of memories about agent B (e.g., 10), where the personal information can be the generative agent's personal profile. Assuming that the strings currently storing the above five sets of information are "Profile A", "Profile B", "Memory A", "Memory B", and "Memory A and B", the rules for generating the third prompt word are as follows:

[0171] Prompt word =

[0172] "Profile 1: " + Profile A + "Profile 2: " + Profile B +

[0173] "The character's past experience:" + "Character 1:" + Memory A + "Character 2:" + Memory B + "Character 1 and Character 2:" + Memory A and B +

[0174] "Now two characters meet on the road and start a conversation. Please output the response to the above prompt in json format. The output should be a list in the form of:" + [" <name> ", " <conversation>"] +

[0175] "Output multiple sentences in a conversation, making the whole conversation smooth and natural." +

[0176] "The following is an output sample in Json format:" + { "output": "[["+ Zhang San+ ", "Hello!"],["+ Li Si+ ", "How are you doing recently? "]... ]"}.

[0177] After the third prompt word is generated, the third prompt word is encapsulated into a specified message format according to the preset large language model category, and then converted into Json format data, and finally the Json data is sent to the api interface of the preset large language model through the Unity3D engine in the form of a bit stream.

[0178] Step 604, obtain the dialogue content generated by the preset large language model, and display the dialogue content.

[0179] After receiving the message, the preset large language model will generate the corresponding dialogue content according to the third prompt word. The format of the dialogue content is Json format, and the generated dialogue content will be sent to the generative agent. The Unity3D UI component "Canvas" can be used to display the dialogue content between agents A and B to the user.

[0180] Step 605: Generate a fourth prompt word based on the conversation content, and send the fourth prompt word to a preset large language model; the fourth prompt word is used to summarize the conversation content.

[0181] The generative agent can store the received conversation content in the memory, but since the directly generated conversation content is large in text, the space required for direct storage is large, so the conversation stored in the memory can be simplified to a certain extent. The simplification process is performed by the preset large language model. Assuming that the string name of the current stored conversation content is "Conversation", the rule example for generating the fourth prompt word for summarizing the conversation content is as follows:

[0182] Prompt word =

[0183] "The following is a conversation between two people:" + Conversation +

[0184] "Please summarize this conversation and create a brief summary of it. The summary must clearly state the names of both people. The total number of words should not exceed 50."

[0185] The fourth prompt word is encapsulated into a specified message format according to the preset large language model category, and then converted into Json format data, and finally the Json data is sent to the api interface of the preset large language model through the Unity3D engine in the form of a bit stream.

[0186] Step 606: Obtain a conversation summary generated by a preset large language model.

[0187] The preset large language model will generate a concise dialogue summary for the dialogue content based on the fourth prompt word.

[0188] Step 607, save the conversation summary to the memory bank.

[0189] The generative agent will concatenate the current time of the time system to the dialogue summary to mark the specific time when the dialogue took place. The dialogue summary containing the time of occurrence will then be stored in the memory banks of both agents A and B at the same time, as "agent A's memory of agent B" and "agent B's memory of agent A" for subsequent use.

[0190] like Figure 8 As shown in the figure, it is a flow chart of a generative agent communication method. Taking agent B entering the field of view of agent A as an example, it is assumed that agent A and agent B in the activity scene are controlled by the action module to move towards the target location. During the movement, agent B enters the field of view of agent A. The perceptron of the perception module of agent A perceives the existence of agent B. At this time, agent A will send a signal to notify the action modules of agents A and B to stop moving. The perceptrons of the perception modules of both parties will be locked (unlocked after a specified time) and stay in place to prepare for a conversation. The information processing module of agent A retrieves the personal information "Profile A" of agent A, the 10 most recent memories "Memory A" about itself in the memory bank of the memory module of agent A, the personal information "Profile B" of agent B, the 10 most recent memories "Memory B" about itself in the memory bank of the memory module of agent B, and the 10 most recent memories "Memory A and B" about agent B in the memory bank of the memory module of agent A, and generates a third prompt word for generating a dialogue based on the retrieved information, then encapsulates the third prompt word, generates a message, and sends it to the server. The preset model big language of the server generates the dialogue content based on the message content, sends the dialogue content to the client, and displays the dialogue content on the UI interface of the client. At the same time, the information processing module of agent A generates a fourth prompt word for summarizing the dialogue content based on the dialogue content, then encapsulates the fourth prompt word, generates a message, and sends it to the server. The preset model big language of the server generates a dialogue summary based on the message content. The conversation summary is stored in the memory banks of the memory modules of agents A and B respectively as "agent A's memory about agent B" and "agent B's memory about agent A".

[0191] In an optional embodiment of the present application, the memory library includes three memory layers, wherein the first memory layer is used to index different memory objects, the second memory layer is used to index different days, and the third memory layer is used to index memory content. The method further includes:

[0192] Step S21, setting a storage threshold of the memory bank.

[0193] like Fig. 9 As shown, it is a schematic diagram of the structure of the memory bank. In the embodiment of the present application, each generative agent has its own memory bank. The structure of the memory bank of each generative agent is the same, and they are all three-segment memory banks. The memory bank includes three memory layers, and its data structure is:

[0194] Dic{'key': string , 'value': List <List <string>>}

[0195] The first layer of the memory is a dictionary structure, which stores a number of key-value pairs that can index different memory objects. In one example, if it is about the memory of agent A itself, the key used for indexing is "agent A"; if it is the memory of agent A about agent B, the key used for indexing is set to "agent B". After determining the key, retrieve the value corresponding to the key in the dictionary (type is List<T> <List <string>>) to perform the second-level operation. The second level of the memory bank is a List (directory) structure. Assuming that this memory occurred on the nth day in the virtual world, the nth element in the List (type is List <string>) to perform the third layer operation. The third layer of the memory bank is also a List structure. At this time, the last layer of the memory bank has been reached, and the string "M" storing the memory will be directly added to the end of the List.

[0196] As the generative agent works longer, the memory stored in the memory bank of the generative agent will continue to increase. Too much memory will not only occupy a large amount of storage space, but also affect the speed of the generative agent to retrieve memory. Therefore, a streamlined function can be set for the memory bank to delete the memory when the total memory of the memory bank is too large.

[0197] In order to make the behavior of the generative agent closer to real humans, the memory reduction function imitates the human memory forgetting process. In the script responsible for the memory module function, two integer class parameters are set: M and m. M represents the storage threshold of a single generative agent, and m is the total number of memories currently in the generative agent.

[0198] Step S22, when the storage content in the memory exceeds the storage threshold, the memory is simplified by a preset memory function.

[0199] When m>=M, it proves that the current memory of the generative agent is too large, and at this time, it can start to simplify the memory by forgetting. According to the "Ebbinghaus Memory Forgetting Curve", it can be known that in reality, the memory rate of human beings is directly related to the time of memory. Assuming that the memory rate of a certain memory (the probability that a certain memory is not forgotten) is y, and this memory has been remembered for x hours after the first time, the preset memory function of y and x can be approximately expressed as formula (1):

[0200] Formula (1)

[0201] In the script responsible for the forgetting function, a loop is set to traverse each memory in the memory bank. According to the current virtual world time and the first memory time recorded in the current memory, the total number of hours x that have passed since the first memory can be calculated. Substituting it into formula (1) can calculate the memory rate. Then, the namespace UnityEngine (Unity engine) is introduced into the script, and a random decimal r between 0 and 1 is generated using the random number generator in UnityEngine. If r<=y, the memory is retained; if r>y, the memory is deleted from the memory bank, thereby realizing the streamlined function of the memory bank and the generative agent can restore normal memory function.

[0202] The embodiment of the present application discloses a method for generative agent communication, including setting a sensor and a collision body for a generative agent, setting the range of the collision body, detecting whether there are other generative agents within the range of the collision body by the sensor, and when there are other generative agents, retrieving the personal information of the generative agent itself and a preset number of memories, the personal information of other generative agents and a preset number of memories, and the preset number of memories between two generative agents from a memory bank, generating a third prompt word for generating a dialogue, sending the third prompt word to a preset large language model, obtaining dialogue content generated by the preset large language model, and displaying the dialogue content, generating a fourth prompt word for summarizing the dialogue content based on the dialogue content, sending the fourth prompt word to the preset large language model, obtaining a dialogue summary generated by the preset large language model, and saving the dialogue summary to the memory bank, so that the generative agent has the function of automatically exchanging information with other generative agents and can automatically store experiences related to itself.

[0203] Corresponding to the aforementioned application function implementation method embodiment, the present application also provides a three-dimensional space generative intelligent agent generation device, electronic device and corresponding embodiments.

[0204] Fig.10 It is a structural schematic diagram of a three-dimensional space generative intelligent agent generation device shown in an embodiment of the present application.

[0205] See also Fig.10 , the device comprises:

[0206] The building module 1001 is used to build a three-dimensional activity scene based on preset scene elements, and to build a time system for the activity scene; the time system is used to indicate the time of the activity scene;

[0207] The import module 1002 is used to import an initial virtual object and set personal information of the initial virtual object; the initial virtual object is a three-dimensional model;

[0208] A creation module 1003, used to create a memory library of initial virtual objects;

[0209] The generation module 1004 is used to create an animator component and a pathfinding component based on the initial virtual object to generate a final generative agent; the animator component is used to control the generative agent to perform actions, the pathfinding component is used to navigate the generative agent in the activity scene, and the generative agent is used to perform preset tasks. The preset tasks are generated based on personal information, content stored in the memory bank, time points of the time system, and locations in the activity scene.

[0210] In an optional embodiment of the present application, the building module 1001 includes:

[0211] The import submodule is used to import the initial model of the preset scene elements; the preset scene elements include buildings, roads, and decorations; buildings have location information;

[0212] The setup submodule is used to set the specifications and poses of the initial model and connect buildings through roads;

[0213] The time submodule is used to create a control script for the time system; the control script includes a time variable; the time variable is used to represent the time point of the time system;

[0214] The time variation submodule is used to control the time variable to vary according to preset time variation conditions.

[0215] In an optional embodiment of the present application, the pathfinding component includes a navigation component and a grid proxy component, and the device also includes:

[0216] The location module is used to obtain the target location based on the grid agent component;

[0217] A calculation module, used for calculating an optimal path to move to a target location based on a navigation component;

[0218] The movement module is used by the animator component to control the generative agent to move to the target location according to the optimal path.

[0219] In an optional embodiment of the present application, the device further includes:

[0220] A first prompt word module is used to generate a first prompt word based on personal information, content stored in a memory bank, a time point in a time system, and a location in an activity scene, and send the first prompt word to a preset large language model; the first prompt word is used to generate a preset task;

[0221] A task module, used to obtain preset tasks generated by a preset large language model;

[0222] Splitting module, used to split the preset task into several subtasks;

[0223] The element module is used to extract the key elements in the subtask; the key elements include the start time, end time, and location;

[0224] The comparison module is used to compare the start time and end time of each subtask with the current time in the time system in turn;

[0225] The execution module is used to control the generative agent to move to a location when the start time in the subtask is the same as the current time in the time system, and the generative agent starts to execute the subtask; when the end time in the subtask is the same as the current time in the time system, the subtask is completed.

[0226] In an optional embodiment of the present application, the device further includes:

[0227] An expansion module, used to generate a second prompt word based on personal information and subtasks, and send the second prompt word to a preset large language model; the second prompt word is used to expand the subtask detailed experience;

[0228] The expansion result module is used to obtain the expansion results generated by the preset large language model and store the expansion results in the memory bank.

[0229] In an optional embodiment of the present application, the device further includes:

[0230] The perception module is used to set the perceptron and collision body for the generative agent and set the range of the collision body;

[0231] The detection module is used to detect whether there are other generative agents within the range of the collision body through the perception machine;

[0232] A retrieval module is used to retrieve the personal information of the generative agent and a preset number of memories, the personal information of other generative agents and a preset number of memories, and the preset number of memories between two generative agents from the memory bank when there are other generative agents, generate a third prompt word, and send the third prompt word to the preset large language model; the third prompt word is used to generate a dialogue;

[0233] The dialogue content module is used to obtain the dialogue content generated by the preset large language model and display the dialogue content.

[0234] In an optional embodiment of the present application, the device further includes:

[0235] A summarizing module, used to generate a fourth prompt word based on the conversation content, and send the fourth prompt word to a preset large language model; the fourth prompt word is used to summarize the conversation content;

[0236] The dialogue summary module is used to obtain the dialogue summary generated by the preset large language model;

[0237] The saving module is used to save the conversation summary to the memory bank.

[0238] In an optional embodiment of the present application, the memory library includes three memory layers, wherein the first memory layer is used to index different memory objects, the second memory layer is used to index different days, and the third memory layer is used to index memory content. The device also includes:

[0239] Threshold module, used to set the storage threshold of the memory bank;

[0240] The simplification module is used to simplify the memory bank through a preset memory function when the storage content in the memory bank exceeds a storage threshold.

[0241] The embodiment of the present application discloses a three-dimensional space generative intelligent agent generation device, which builds a three-dimensional activity scene based on preset scene elements and a time system for the activity scene; imports an initial virtual object and sets personal information of the initial virtual object; the initial virtual object is a three-dimensional model; creates a memory library of the initial virtual object; creates an animator component and a pathfinding component based on the initial virtual object to generate a generative intelligent agent; the animator component is used to control the generative intelligent agent to perform actions, the pathfinding component is used to navigate the generative intelligent agent in the activity scene, and the generative intelligent agent is used to perform preset tasks. The preset tasks are generated based on personal information, content stored in the memory library, time points of the time system and locations in the activity scene, and can construct a three-dimensional activity scene and a generative intelligent agent object, realize the function of automatic pathfinding of the generative intelligent agent in the three-dimensional scene, and can automatically perform various tasks in the scene according to the surrounding environment and its own situation.

[0242] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated again here.

[0243] Fig.11 It is a schematic diagram of the structure of an electronic device shown in an embodiment of the present application.

[0244] See also Fig.11 , the electronic device 1100 includes a memory 1110 and a processor 1120.

[0245] The processor 1120 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.

[0246] The memory 1110 may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage devices. Among them, ROM can store static data or instructions required by the processor 1120 or other modules of the computer. The permanent storage device may be a readable and writable storage device. The permanent storage device may be a non-volatile storage device that does not lose the stored instructions and data even after the computer is powered off. In some embodiments, the permanent storage device uses a large-capacity storage device (such as a magnetic or optical disk, flash memory) as a permanent storage device. In some other embodiments, the permanent storage device may be a removable storage device (such as a floppy disk, optical drive). The system memory may be a readable and writable storage device or a volatile readable and writable storage device, such as a dynamic random access memory. The system memory may store some or all instructions and data required by the processor at runtime. In addition, the memory 1110 may include any combination of computer-readable storage media, including various types of semiconductor storage chips (such as DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), and disks and / or optical disks may also be used. In some embodiments, the memory 1110 may include a readable and / or writable removable storage device, such as a laser disc (CD), a read-only digital versatile disc (such as a DVD-ROM, a double-layer DVD-ROM), a read-only Blu-ray disc, an ultra-density optical disc, a flash memory card (such as an SD card, a mini SD card, a Micro-SD card, etc.), a magnetic floppy disk, etc. The computer-readable storage medium does not include carrier waves and transient electronic signals transmitted wirelessly or wired.

[0247] The memory 1110 stores executable codes, and when the executable codes are processed by the processor 1120 , the processor 1120 can execute part or all of the methods described above.

[0248] In addition, the method according to the present application may also be implemented as a computer program or a computer program product, which includes computer program code instructions for executing some or all of the steps in the above method of the present application.

[0249] Alternatively, the present application can also be implemented as a computer-readable storage medium (or non-transitory machine-readable storage medium or machine-readable storage medium) on which executable code (or computer program or computer instruction code) is stored. When the executable code (or computer program or computer instruction code) is executed by a processor of an electronic device (or server, etc.), the processor executes part or all of the steps of the above-mentioned method according to the present application.

[0250] The embodiments of the present application have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.< / string> < / string> < / string> < / conversation> < / name> < / string>

Claims

1. A method for generating a three-dimensional space generative agent, characterized in that: The method comprises: Building a three-dimensional activity scene based on preset scene elements, and building a time system for the activity scene; the time system is used to indicate the time of the activity scene; Importing an initial virtual object and setting personal information of the initial virtual object; the initial virtual object is a three-dimensional model; Creating a memory library of the initial virtual object; An animator component and a pathfinding component are created based on the initial virtual object to generate a generative agent; the animator component is used to control the generative agent to perform actions, the pathfinding component is used to navigate the generative agent in the activity scene, and the generative agent is used to perform a preset task, which is generated by a preset large language model based on the personal information, the content stored in the memory bank, the time point of the time system, and the location in the activity scene; Setting a perceptron and a collision body for the generative agent, and setting a range of the collision body; Detecting, by the perceptron, whether there are other generative agents within the range of the collision body; When the other generative agent exists, the personal information of the generative agent and a preset number of memories, the personal information of the other generative agents and a preset number of memories, and the preset number of memories between the two generative agents are retrieved from the memory bank to generate a third prompt word, and the third prompt word is sent to the preset large language model; the third prompt word is used to generate a dialogue; Acquire the conversation content generated by the preset large language model and display the conversation content.

2. The method according to claim 1, characterized in that The method of building a three-dimensional activity scene based on preset scene elements and building a time system for the activity scene includes: Importing the initial model of the preset scene elements; the preset scene elements include buildings, roads, and decorations; the buildings have location information; Setting the specifications and posture of the initial model, and connecting the buildings through the roads; Creating a control script for the time system; the control script includes a time variable; the time variable is used to represent a time point of the time system; The time variable is controlled to change according to a preset time change condition.

3. The method according to claim 1, characterized in that The pathfinding component includes a navigation component and a grid proxy component, and the steps after generating the generative agent include: Acquiring a target location based on the grid proxy component; Calculate the best path to move to the target location based on the navigation component; The animator component controls the generative agent to move to the target location according to the optimal path.

4. The method according to claim 1, characterized in that The method further comprises: Generate a first prompt word based on the personal information, the content stored in the memory bank, the time point of the time system and the location in the activity scene, and send the first prompt word to a preset large language model; the first prompt word is used to generate the preset task; Obtain the preset task generated by the preset large language model; Splitting the preset task into several subtasks; Extracting key elements of the subtask; the key elements include start time, end time, and location; Compare the start time and the end time of each subtask with the current time in the time system in turn; When the start time in the subtask is the same as the current time in the time system, the generative agent is controlled to move to the location, and the generative agent begins to execute the subtask; when the end time in the subtask is the same as the current time in the time system, the subtask is completed.

5. The method according to claim 4, characterized in that After the subtask is completed, it also includes: Generate a second prompt word based on the personal information and the subtask, and send the second prompt word to the preset large language model; the second prompt word is used to expand the detailed experience of the subtask; The expansion result generated by the preset large language model is obtained, and the expansion result is stored in the memory bank.

6. The method according to claim 1, characterized in that After displaying the conversation content, the following further includes: generating a fourth prompt word based on the conversation content, and sending the fourth prompt word to the preset large language model; the fourth prompt word is used to summarize the conversation content; Obtaining a conversation summary generated by the preset large language model; The conversation summary is saved in the memory bank.

7. The method according to claim 1, characterized in that The memory library includes three memory layers, wherein the first memory layer is used to index different memory objects, the second memory layer is used to index different days, and the third memory layer is used to index memory content. The method further includes: Setting a storage threshold of the memory bank; When the storage content in the memory library exceeds the storage threshold, the memory library is simplified by a preset memory function.

8. A three-dimensional space generative agent generation device, characterized in that: The device comprises: A building module, used to build a three-dimensional activity scene based on preset scene elements, and to build a time system for the activity scene; the time system is used to indicate the time of the activity scene; An import module, used to import an initial virtual object and set personal information of the initial virtual object; the initial virtual object is a three-dimensional model; A creation module, used for creating a memory library of the initial virtual object; A generation module, used to create an animator component and a pathfinding component based on the initial virtual object to generate a final generative agent; the animator component is used to control the generative agent to perform actions, the pathfinding component is used to navigate the generative agent in the activity scene, and the generative agent is used to perform a preset task, which is generated by a preset large language model based on the personal information, the content stored in the memory bank, the time point of the time system and the location in the activity scene; The perception module is used to set the perceptron and collision body for the generative agent and set the range of the collision body; The detection module is used to detect whether there are other generative agents within the range of the collision body through the perception machine; A retrieval module is used to retrieve the personal information of the generative agent and a preset number of memories, the personal information of other generative agents and a preset number of memories, and the preset number of memories between two generative agents from the memory bank when there are other generative agents, generate a third prompt word, and send the third prompt word to the preset large language model; the third prompt word is used to generate a dialogue; The dialogue content module is used to obtain the dialogue content generated by the preset large language model and display the dialogue content.

9. An electronic device, characterized in that: include: processor; as well as A memory having executable codes stored thereon, which, when executed by the processor, causes the processor to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Data processing method and device, electronic equipment and storage medium

    CN117034770A

Cited By

  • A three-dimensional agent generation method and system based on image feature reconstruction

    CN122737315A