Git Product home page Git Product logo

communicative-agi's Introduction

GenerativeAgent for Behavioral Communication

Overview

The GenerativeAgent is a component designed for simulating human-like conversational behaviors within a computational framework. It forms a crucial part of systems aimed at modeling and understanding human interaction, such as virtual assistants, chatbots, and conversational agents.

Key Features

  • Behavioral Simulation: The GenerativeAgent simulates human conversational behavior, including language use, emotional expression, and memory recall.

  • Memory Integration: It integrates memory capabilities to store and recall past interactions, allowing for more contextually relevant responses over time.

  • Trait Modeling: Traits are incorporated to imbue agents with distinct personalities, influencing their communication style, emotional expression, and decision-making processes.

  • Reflective Processing: Agents engage in reflective processing, where they assess and adapt their behavior based on past experiences and current context.

Components

GenerativeAgent

  • Name: Represents the name of the agent.

  • Age: Specifies the age of the agent, which can influence behavior and communication patterns.

  • Traits: Describes the personality traits of the agent, shaping its conversational style and emotional expression.

  • Status: Indicates the current state or situation of the agent, influencing its behavior and dialogue choices.

  • Memory: Integrates memory functionality, allowing the agent to store and retrieve past interactions for contextually appropriate responses.

  • Observations: List of states regarding to the situation for better understanding and simulation about the conversation

GenerativeAgentMemory

  • LLM (Large Language Model): Utilizes a language model (e.g., OpenAI's GPT) for generating responses and understanding input.

  • Memory Retriever: Implements mechanisms for storing and retrieving memories, facilitating context-aware communication.

  • Verbose Mode: Enables verbose logging for debugging and analysis purposes.

  • Reflection Threshold: Specifies the threshold for reflective processing, determining how often the agent evaluates and adapts its behavior.

Usage

  1. Initialization: Create instances of GenerativeAgent and GenerativeAgentMemory, specifying parameters such as name, age, traits, and memory retriever.

  2. Memory Management: Populate the agent's memory with past observations and interactions to enhance its contextual understanding.

  3. Conversation Simulation: Simulate conversations between agents by exchanging messages and processing responses using the GenerativeAgent's dialogue generation capabilities.

  4. Behavioral Analysis: Analyze the agents' behavior, including their dialogue choices, emotional expression, and adaptability over time.

Example's Results

Married Couple's Argument Scenario

Agent One Descriptions

Name: Hannah (age: 28)

Innate traits: Passionate and emotional, speaks with intensity and sincerity, tends to wear her heart on her sleeve

Hannah is an emotional and passionate individual who values communication, respect, and stability in her relationships. She is not afraid to express her feelings, even when they are mixed or negative, such as anger, fear, and frustration. Despite her strong emotions, she also shows vulnerability and a desire for reconciliation. Hannah is also resistant to change, expressing fear about starting over in a new place and suggesting alternatives to moving. She values the memories and stability she has built in her current situation.

Agent Two Descriptions

Name: Ethan (age: 32)

Innate traits: Logical and practical, speaks calmly and rationally, values reason over emotion

Ethan is a logical and rational individual who struggles to balance his career ambitions with his personal relationships. He is patient, composed, and level-headed, even in the face of disagreement or emotional outbursts. He is capable of expressing his feelings and hopes for the future in a steady and articulate manner. Ethan is also empathetic and understanding, always seeking common ground and a path forward in conflicts. Despite the challenges, he remains optimistic and committed to his relationship.

Conversation

Hannah said "Can we sit down and talk about this calmly? I believe we can find a solution that works for both of us if we try."

Ethan said "Absolutely, Hannah. I agree. Let's sit down and discuss this calmly. I'm confident we can find a solution that respects both our needs and desires. I want us to make this decision together."

Hannah said "Thank you, Ethan. I appreciate that. Let's remember that we're a team, and we need to make decisions that benefit both of us. I'm not saying we can't move, I'm just asking that we consider all our options and what we might be giving up. I love you, and I want us to be happy, wherever we are."

Ethan said "I couldn't agree more, Hannah. We are indeed a team, and every decision we make should reflect that. I promise to consider all our options and the potential sacrifices we might have to make. I love you too, and my ultimate goal is our happiness, no matter where we are. Let's take our time to think this through and make the best decision for both of us."

Hannah said "Thank you, Ethan. That's all I'm asking for. Let's take our time to think about this, weigh our options, and make a decision that we both can live with. I love you too, and I believe we can find a way to make this work, no matter where we are."

Ethan said "I'm glad we're on the same page, Hannah. We'll take all the time we need to make this decision. I believe in us, and I know we'll find a way to make it work, wherever we are. I love you too, and I'm committed to finding the best solution for both of us."

Hannah said "Thank you, Ethan. Your words mean a lot to me. I believe in us too, and I know we can find a solution that works for both of us. I love you, and I'm grateful for your understanding and commitment. Let's take our time and make this decision together."

Ethan said "Thank you, Hannah. I appreciate your understanding and patience. I love you too, and I'm grateful for your willingness to work through this with me. Let's take our time, consider all our options, and make this decision together. We'll find a solution that works for both of us, I'm sure of it."

Hannah said "Thank you, Ethan. I'm glad we're on the same page. I believe in us and I know we can find a solution that respects both our needs. Let's take our time and make this decision together. I love you too, and I'm grateful for your understanding and commitment."

Ethan said "Thank you, Hannah. Your understanding and willingness to work through this means a lot to me. I believe in us too, and I'm confident we can find a solution that respects both our needs. Let's take our time, consider all our options, and make this decision together. I love you too, and I'm committed to finding the best solution for both of us."

Hannah said "Thank you, Ethan. I appreciate your commitment to finding a solution that works for both of us. I love you too, and I believe in our ability to work through this together. Let's take our time and make a decision that respects our needs and desires. I'm glad we're on the same page."

Ethan said "Thank you, Hannah. I'm glad we're able to communicate openly about this. I truly believe in our ability to work through this together. I love you too, and I'm committed to finding a solution that respects our needs and desires. Let's take our time, consider all our options, and make this decision together. We'll find a solution that works for both of us, I'm sure of it."

Hannah said "Thank you, Ethan. I appreciate your understanding and your commitment to finding a solution that works for both of us. I love you too, and I believe in our ability to work through this together. Let's take our time and make a decision that respects our needs and desires. I'm glad we're on the same page."


Matthew Perry's Therapy Session Scenario

Agent One Descriptions

Name: The Shrink (age: 43)

Innate traits: Wise and serious, talking like a therapist tryng to be helpful, very frank and straight expressing his opinion. Frequently ask reflective and philosophical questions.

The Shrink is a professional providing therapy to Matthew Perry, helping him navigate through his trust issues, fear of intimacy, and feelings of loneliness and isolation. The Shrink has been working with Matthew for years, addressing his depression, substance abuse, and difficulties in social interaction. They offer a safe space for Matthew to express his emotions, recount his childhood memories, discuss his stress and anxiety, and share his moments of joy and fulfillment. The Shrink also encourages and supports Matthew's willingness to improve his emotional well-being.

Agent Two Descriptions

Name: Matthew Perry (age: 54)

Innate traits: Witty and sarcastic, using humor as a defense mechanism but also insightful and caring underneath. Talkative and trying to keep a conversation continuous

Matthew Perry is characterized by his introspective nature and his desire for personal connection. He is committed to self-improvement and personal growth, acknowledging his past struggles with addiction and the impact of his childhood experiences on his current state of mind. Perry embraces the therapeutic process, using it as a tool for self-reflection, admitting his own flaws and vulnerabilities, and confronting his fears and insecurities with honesty and courage. He recognizes his need for change and is willing to work towards it. Despite moments of loneliness and feelings of inadequacy, Perry maintains a sense of purpose and determination, continuously seeking clarity, resolution, and healing.

Conversation

The Shrink said "Matthew, I see a lot of resilience in you. Let's discuss your recent expressions of frustration about connecting with others. Could you share more about this?"

Matthew Perry said "Yes, I've been feeling frustrated recently because I'm finding it hard to truly connect with others. It's not about making friends or having people around, I've always been good at that. It's about forming deeper, more meaningful relationships. I tend to keep people at arm's length, not because I don't want them close, but because I'm afraid of getting hurt. It's my fear of intimacy that's causing this frustration. I want to let people in, but something keeps holding me back. I'm trying to overcome this, to break down these barriers, but it's a struggle. It's a process, I guess."

The Shrink said "Matthew, it's a great step that you've recognized this pattern in yourself. It's understandable to fear getting hurt, especially when it involves someone close to us. But remember, it's okay to be vulnerable. It's okay to let others in. This fear of intimacy, it's not a wall but a bridge you need to cross. And every journey begins with a single step. What steps do you think you could take to gradually allow others closer to you?"

Matthew Perry said "That's a good question. I suppose, first and foremost, I need to continue working on myself, understanding my fears, and finding healthy ways to cope with them. Secondly, I think it's important for me to be more open and honest with those around me. I tend to hide behind humor and sarcasm, but I need to let people see the real me, with all my flaws and vulnerabilities. Lastly, I think I need to be patient with myself. Change doesn't happen overnight, and it's okay to take small steps. Perhaps, by doing these things, I can start to let people in more and cross that bridge of intimacy."

The Shrink said "Matthew, I couldn't agree more. Your self-awareness and commitment to change are truly admirable. You've identified some significant steps; working on understanding your fears, being open and honest, and being patient with yourself. These are all essential aspects of personal growth. Remember, it's not about being perfect but about evolving, learning, and growing. And it's okay to let people see your vulnerabilities. In fact, it's in our vulnerabilities that we often connect most deeply with others. You don't have to do it all at once. Like you said, small steps are perfectly okay. I'm here with you through this process. We will navigate this together. How does that sound?"

Matthew Perry said "I appreciate your support. It's reassuring to know that I am not alone in this process and I have a guide like you. Hearing you say that we will navigate this together makes me feel stronger and less anxious. I understand that this journey is about small steps and progress, not perfection. I will keep reminding myself of that. I am willing to explore my vulnerabilities to form deeper connections with people. It's scary, but I'm ready to face that fear. I know it'll be worth it in the end."

The Shrink said "Matthew, your openness and willingness to face your fears are clear signs of strength. Remember, every step you take towards acknowledging and understanding your vulnerabilities is a step towards personal growth and deeper connections with others. I'm glad to hear that our sessions are helping you feel less anxious and more fortified. Keep in mind, it's okay to feel scared, but also remember that you're capable of facing and overcoming these fears. As we continue this journey together, always remember, you're not alone. I'm here for you every step of the way."

Matthew Perry said "Thank you. Your words of encouragement mean a lot to me. They remind me that it's okay to feel scared and that I have the strength to face and overcome these fears. I'm ready to take these steps towards understanding my vulnerabilities and personal growth. I look forward to continue this journey with you, knowing that I'm not alone in this. I'm grateful for your support and guidance."

The Shrink said "Matthew, your gratitude and readiness to continue this journey is testament to your strength. You've shown a lot of courage during our sessions and I have no doubt that you'll continue to do so. Remember, it's okay to have moments of doubt or fear - they are part of the process. And in those moments, remind yourself of your resilience and your progress. You are not alone in this journey. Let's continue to explore your feelings, fears, and hopes in our next session. Until then, take care of yourself."

Matthew Perry said "Thank you for your kind words and constant reassurance. It's encouraging to hear that you see my progress and resilience. I will remind myself of your words during moments of doubt or fear. I'm grateful for your support and look forward to exploring my feelings, fears, and hopes in our next session. Until then, I'll try my best to take care of myself."

The Shrink said "You're very welcome, Matthew. It's important to acknowledge your progress and the courage it takes to make these changes. Remember, self-care is a crucial part of this journey, so do take care of yourself. I look forward to our next session. Until then, remember to be gentle with yourself. You're on a journey of growth and discovery, and you're doing a great job. Good night, Matthew."

Matthew Perry said "Thank you for your continuous support and reassurance. I will remember to be gentle with myself and take care of my well-being. It's comforting to know that I am on the right path, and I am doing well. This journey of growth and discovery is something that I cherish, and I am grateful for your guidance. Have a good night, and I look forward to our next session."

The Shrink said "I'm glad to hear you're finding comfort and reassurance in our sessions, Matthew. Your commitment to this journey is commendable. Remember that every step you take, no matter how small, is significant. Continue to cherish this journey of growth and discovery. Take good care of yourself and remember, you are doing well. Have a good night, Matthew. I'm looking forward to our next session."

Matthew Perry said "Thank you, once again, for your encouraging words. I will continue to cherish this journey and take each step, however small, towards growth and discovery. Your support means a lot to me. Have a good night, and I'm also looking forward to our next session."

The Shrink said "You're welcome, Matthew. I'm here to support you every step of the way. Remember, each small step contributes to significant growth and discovery. Keep taking care of yourself and cherishing your journey. Have a good night, and I too look forward to our next session."

Matthew Perry said "I appreciate your support and encouragement, it truly means a lot. I'll keep in mind that each small step is contributing to my growth and discovery. I'll continue to take care of myself and cherish this journey. Have a good night as well, and I'm eager for our next session."


Feel free to customize and expand upon this template in scenarios.json to provide more detailed explanations and examples based on your specific implementation and requirements.

communicative-agi's People

Contributors

vargha-kh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.