Emotion System
Last updated
Last updated
Emotions play a crucial role in human decision-making[5, 6], and LLM Agents emulate this by integrating emotional responses into their cognitive processes. These emotional states influence their planning and actions, adding a layer of realism to their behavior.
Plutchik proposed a wheel model consisting of eight basic emotions which include joy, trust, fear, surprise, sadness, disgust, anger, and anticipation[7]. Building upon this framework, we utilize this approach to describe the emotions of agents. Leveraging the capabilities of LLM, we differentiate the emotions of agents and assign scores to their emotions across various dimensions.
Building upon the Decomposed EmotionCause Chain (DECC) framework[8], we leverage Language Models (LLMs) to not only recognize, locate, and analyze emotions but also to summarize them effectively. Moreover, we task LLMs with providing confidence scores for each emotion, enhancing our ability to accurately describe the emotional states of agents. This comprehensive approach not only facilitates a deeper understanding of emotions but also offers insights into the nuanced dynamics of emotional responses.
Agents can move in the town at their will, moving from one place to another. There are many buildings in the town, and agents will move according to their goal, current plan and etc.
Identification of Discrepancies: Agents start by identifying the most significant discrepancy between the current situation and the ideal, stable status. This involves a detailed analysis of the environment, including the observation of buildings and other relevant factors in the small town scenario.
Goal Setting: Agents define a clear and detailed goal aimed at mitigating the identified discrepancy. This goal is accompanied by specific rubrics that provide a framework for assessing progress towards the goal.
Situation Analysis: According to the goal's rubrics, Agents analyze the current situation to understand the gap between the present condition and the desired outcome. This analysis includes evaluating the physical features, principles, or other relevant attributes that contribute to the discrepancy.
Plan Formulation: Agents formulate a clear, multi-step plan to transform the current situation into the desired goal. This planning process involves considering multiple candidate plans to address the identified issues.
Cost Estimation: For each proposed plan, Agents estimate the associated costs, which may include monetary expenses, time investment, and other resources such as vigor. This step ensures that the planning process remains grounded in practicality and feasibility.
Plan Selection: Among the proposed plans, Agents select the one with the minimum cost, ensuring that resource expenditure is optimized while achieving the set goal.
Agents may start a conversation with another agent. This decision is influenced by the character's current plan, the impression of the other character, and the desired outcome of the interaction. The process emphasizes the importance of the first sentence in setting the tone and direction of the conversation. Principles for the chat process are shown below:
Contextual Awareness: The initiating sentence should reflect an understanding of the other character's impression of the initiator and any relevant aspects of their relationship or prior interactions.
Alignment with Objectives: The conversation's initiation should directly or indirectly support the initiating character's current plan or goals, ensuring that interactions are purposeful.
Adaptability: The process must be flexible, allowing characters to adapt their conversational approach based on the evolving dynamics of the interaction and any new information that becomes available.
With the chat mechanism in place, agents can organically cultivate their network of relationships through communication[3]. This facilitates the seamless transmission of various information among agents and fosters the development of memories and emotional connections between agents and their environment.We implement the chat function for Agents using AutoGen[4], the framework plays a critical role in facilitating complex interactions between characters, leveraging its advanced capabilities to enhance conversational AI applications.
AutoGen's architecture supports the creation of customizable and conversable agents. This means that each Agent, including game characters, can be tailored to have unique personalities, goals, and conversational styles. What's more, you can even talk to an agent in the town to influence their decisions etc. AutoGen enables seamless integration of human participation into the conversational flow. This allows for a hybrid model where Agents can initiate conversations based on their programming and then adapt or respond to human input as needed, enhancing the realism and flexibility of interactions.
The Act process involves an Agent selecting an action from a set of candidate actions based on its current plan, the current step within that plan, and its understanding of the world. This selection is pivotal for progressing towards the Agent's objectives and requires careful consideration of the available options. Criteria for action selection is shown below:
Alignment with the Plan: The chosen action must directly contribute to the advancement of the Agent's current plan, ensuring coherence in the Agent's behavior and strategy.
Informed by Memory: The Agent's understanding of the world, informed by its long-term memory, plays a crucial role in selecting the most appropriate action.
Optimal Choice: Among the candidate actions, the Agent must choose the one that optimally advances its objectives, considering the context and potential outcomes.
The Critic process serves as a feedback mechanism that assesses the effectiveness of actions (Acts) taken towards achieving a predefined plan. It is structured around three potential outcomes: success, fail, and not_finished_yet. The evaluation is based on the completion of actions within a specified loop and is influenced by the character's bio, ultimate goal, and long-term memory. Evaluation criteria is shown below:
Plan Completion: The process checks whether the character's actions align with and fulfill the predefined plan.
Action Limitation: It monitors the number of actions taken within a loop, with a cap of five actions to prevent plan failure due to excessive attempts.
Progress Assessment: The process evaluates whether the plan needs more actions for completion if the cap has not been reached.