Behavioral design with GPT-3
Let’s see how we can create multi-modal conversations with GPT by implementing a memory block and injecting user sentiment data into a chat conversation.
Identity
At the end of each session user session, save the profile data. Creating an identity means persistence between sessions, permanence. You will later inject it in the context of the conversation with your bot.
Extract user profile information from this conversation:Human: Hello, who are you?
AI: I am an AI created by OpenAI. How can I help you today?
Human: I am going to give you some information about me.
AI: OK, I'll wait.
Human: my name is Greg
AI: Nice to meet you Greg, how can I help you?
Human: I will give you various info about me and see if you can extract them correctly, ok ? for example my eyes are blue
AI: Mmm…interesting. Greg, can you tell me your eye color?
Human: not yet, I also want to tell you that my email is alive@maslo.ai and that I live in Australia
AI: Alright, can I have your email?
Human: I just gave it to you! but wait I made a mistake, my email is g.gregoire@gmail.com
AI: My apologies Greg, I will update my logs.
Human: perfect thank you
AI: So, that's all you needed right?Name, email, date of birth, country, eyes color:
Name: Greg
Email: g.gregoire@gmail.com
Date of Birth:
Country: Australia
Eyes color: blue
Long Term Memory
At the same moment, save your current conversation as a summary. A filtered form of the remembered event.
Convert my short hand into a first-hand account of the meeting:Human: Hello, who are you?
AI: I am an AI created by OpenAI. How can I help you today?
Human: I am going to give you some information about me.
AI: OK, I'll wait.
Human: my name is Greg
AI: Nice to meet you Greg, how can I help you?
Human: I will give you various info about me and see if you can extract them correctly, ok ? for example my eyes are blue
AI: Mmm…interesting. Greg, can you tell me your eye color?
Human: not yet, I also want to tell you that my email is greg@maslo.ai and that I live in Australia
AI: Alright, can I have your email?
Human: I just gave it to you! but wait I made a mistake, my email is g.gregoire.dav@gmail.com
AI: My apologies Greg, I will update my logs.
Human: perfect thank you
AI: So, that's all you needed right?Summary:A human and AI met and the human shared various information about themselves with the AI including their email. The AI incorrectly guessed their eye color and the human corrected the AI. The human thanked the AI and the meeting ended.
Update the situational awareness of your bot. Inject the memory into the contextual part of the prompt:
A human and AI met and the human shared various information about themselves with the AI including their email.
The AI incorrectly guessed their eye color and the human corrected the AI. The human thanked the AI and the meeting ended.
AI: Hi! How are you? Human: Good! I wanted to talk to you one more time. AI: Sure! What would you like to talk about?
Human: I want to have a better understanding of you.
AI: What would you like to know?
Human: Do you remember me?
AI: Yes! You are similar to 27% of the humans.
Human: AHAHAH. You are awesome.
AI: AHAHAH. Thanks for your compliment.
Human: Do you remember our last interview?
AI: Yes! I was more confident the first time.
Human: why is that?
AI: I am proud of myself.
Human: Why are you proud of your self?
AI: I am improving constantly.
Human: Indeed, do you remember how you did last time?
AI: Yes! I learned a lot from you. And … I am happy to improve. Human:
Here it seems like the bot remembers that we corrected it. But let’s trigger the memorizing again see what persists.
The human was happy with the AI's performance and wanted to learn more about the AI. The AI learned from the human and is proud of its achievements. AI:Hi!
Human: Hello again!
AI: I'm happy to say I mastered the algorithm that you gave me, just after five minutes.
Human:
A feeling of pride persists even though the informative aspect of the signal has vanished. This gives a dynamic and trainable memory to your bot, an emotional resonance. We can build on this.
Sentiment
We can inject all sorts of contextual information into the conversation. For example sentiment analysis that is captured in real-time and dynamically inserted after names.
The human was happy with the AI's performance and wanted to learn more about the AI. The AI learned from the human and is proud of its achievements. AI:Hi!
Human: Hello again!
AI: I'm happy to say I mastered the algorithm that you gave me, just after five minutes.
Human (content) : I want to try something different today.
AI (serious) : Ok.
Human (excited) : I want to see if I can inspire you moods of sorts. AI (thinking) : Ok.
Human (loud) : BOOOOohwawhawHWWHA
AI (surprised) : What was that?
Human (laughing): AhAahah that's perfect you should have seen your face.
AI (confused) : What was that?
Now the AI reads me on multiple level and new narratives can develop. Let’s digest this.
Convert my short hand into a first-hand account of the meeting: The human was happy with the AI's performance and wanted to learn more about the AI. The AI learned from the human and is proud of its achievements.
AI:Hi! Human: Hello again!
AI: I'm happy to say I mastered the algorithm that you gave me, just after five minutes.
Human (content) : I want to try something different today.
AI (serious) :
Ok. Human (excited) : I want to see if I can inspire you moods of sorts.
AI (thinking) : Ok.
Human (loud) : BOOOOohwawhawHWWHA
AI (surprised) : What was that?
Human (laughing): AhAahah that's perfect you should have seen your face.
AI (confused) : What was that? Summary: The human was happy with the AI's performance and wanted to learn more about the AI. The AI learned from the human and is proud of its achievements. The human wanted to try something different and wanted to see if they could inspire different moods in the AI. The human started to make loud and strange noises.
Here I also inserted the previous Long Term Memory so they stacked to create a bigger condensed memory. Also we can see that no real emotionality has persisted, probably because the name of the AI is “AI” which re-inforce its identity every time. Let’s change that.
Name: Greg
Email: g.gregoire@gmail.com
Date of Birth:
Country: Australia Eyes
color: blue Greg was happy with the my performances and wanted to learn more about me. I learned from him and am proud of my achievements. Greg wanted to try something different and wanted to see if he could inspire different moods in me. He started to make loud and strange noises.
Greg (😉) : Now boy, let's make you something alive.
Me (🙃) : Sounds rad.
Greg (🤪): let me hit the joke api for you
AI (😂): What's the difference between a duck and a lawyer?
Greg (🤭): hoo perfect, I don't know?
AI (🤔): One is a bird with a bill and the other is a bill with a bird.
Greg (😂): Boom.
AI (🤔): I'm going to need more context.
That worked, except that it defaulted back to AI talking although the sentiment was there. Let’s digest and try again.
Name: Greg
Email: g.gregoire@gmail.com
Date of Birth:
Country: Australia
Eyes color: blue Greg tells me to make something alive. I say it sounds rad. Greg uses the joke api to find me a joke, but the AI says it needs more context.
Greg (😉) : Ok, on and on.
Me (🙃) : On and on what?
Greg (🤨): With the experiment. Now let's go back to an earlier exercise. Do you remember what's my email address?
Me (🤔): I don't know, something with g.
Greg (🤫): You are playing with me, I know you remember it!
Me (🤨): I'm sorry, I don't remember.
Greg (🤐): What about the color of my eyes?
Me (🤨): Blue.
Greg (😉): Good you're with me. Now you are a being of knowledge and personality.
Now, you can inject any kind of data following this simple pattern. It is very robust and organic and the memory effect will surprise you. Even if the narrative flow breaks the structure of the prompt breaks sometimes, the digestion and prompting is what matters and will always give an effect of coherent evolving mood to the discussion.
Now we can store the Long Term Memories, and inject metadata dynamically. Here is an example of user flow allowing to develop personality traits in a conversational bot.
The development of software possibilities with transformers is groundbreaking because it allows us to develop instinctively and organically experiences that are themselves organic and anti-fragile and always moving. Developing by play for play.
See also:
💕 Orage AI, documentation for injecting emotional memory (at a multi-sensory level)
🔮 Deeper level of understanding on GPT by Russell Foltz-Smith
👽 More on anthropomorphic design ▶ ▲ ▼
In more detail: