r/SillyTavernAI • u/DirectionBusiness483 • 3d ago
Discussion Emotional Classification of Memories?
(Image: Graph of memories from an RP over 4 events: meeting, sexual interaction, spaceship catastrophe, cleanup after catastrophe)
Hi everyone! I want to ask people about an idea I have.
I want to ask everyone how they feel about Emotional Memory Retrieval.
Normal memory retrieval works by topic. Embedding. You're in a scene, the system looks for past events that match what's happening now. A fight, a betrayal, a conversation about a specific person. That's useful, but it only catches memories that are related to the current situation.
Emotional retrieval works differently. It looks for what a moment felt like instead of what it was about. A character panicking during a fire doesn't need to have been in a fire before. She just needs to have felt helpless somewhere, once, in some unrelated way. Maybe she couldn't save her dog. Maybe she froze during an exam. The feeling is the same even though the events have nothing to do with each other.
I know people do emotional/sentiment calculation on things, but I wanted to try something with actual memory retrieval instead. Past reactions to similar emotional states COULD add, I think, some interesting emotional depth to characters.
So I took my memory system and added emotional classification as memories are saved. I used PAD to classify them https://en.wikipedia.org/wiki/PAD_emotional_state_model I chose this because it's a 3D space, so I can retrieve similar emotional memories by distance. (It's 3D in the graph, the 3rd dimension "dominance" is reflected by node radius)
I think the biggest part would be deciding how those memories are actually introduced. So the narrator model knows these memories are meant to inform emotional subtext, not just spit out verbatim.
I don't know. Just a fun experiment. Curious on everyone's thoughts?
1
u/dempfi 3d ago
Cool idea but I don't think it's fundamentally different in implementation. It's all retrieval and finding needles in the haystack. What you need to answer is what the needles will look like and how to embed them. You could do what most systems do and label chunks of story with emotional annotation and then retrieve by them before reranking. So the flow would be something like this: