Liberty's Kids Go Inside Out

Plot
A girl named Riley Andersen is born in Minnesota and within her mind, five personifications of her basic emotions—Joy, Sadness, Fear, Disgust, and Anger—gradually come to life and influence her actions via a console in her mind's Headquarters. As she grows up, her experiences become memories, stored in colored orbs, which are sent into long-term memory each night. Her five most important "core memories" (all of which are happy ones) are housed in a hub that powers "islands", each reflecting an aspect of her personality. In Headquarters, Joy acts as a de facto leader to maintain Riley's cheerful childhood, but as she and the other emotions do not understand Sadness' purpose (not even Sadness herself), she frequently tries to keep Sadness away from the console.

At the age of eleven, Riley and her parents move to San Francisco for her father's new business. Riley has poor first experiences: the new house is cramped and old, the moving van with all their belongings was misdirected, her father is under stress from his business, and a poor encounter at a pizza restaurant leaves her disheartened. When Sadness begins touching Riley's happy memories, turning them sad, Joy tries to guard them. On Riley's first day at her new school, Sadness accidentally causes Riley to cry in front of her class, creating a sad core memory. Joy, panicking, tries to dispose of it, but accidentally knocks the other core memories loose during a struggle with Sadness, deactivating the personality islands. Joy, Sadness, and the core memories are sucked out of Headquarters, and taken to the maze-like storage area of long-term memory.

Anger, Fear, and Disgust try to maintain Riley's emotional state in Joy's absence with disastrous results, distancing her from her parents, friends and hobbies, resulting in her personality islands gradually beginning to crumble and fall, one by one, into the "Memory Dump", an abyss where memories are forgotten. In desperation, Anger inserts an idea into the console prompting Riley to run away, believing that her return to Minnesota will enable her to make new happy core memories.

Joy and Sadness encounter Bing Bong, Riley's childhood imaginary friend, who suggests riding the train of thought back to Headquarters. The three eventually catch the train, but it is derailed when the "Honesty Island" collapses (when Riley steals her mother's credit card and begins to run away). In desperation, Joy abandons Sadness and tries to ride a "recall tube" back to Headquarters, but the last personality island collapses, breaking the tube, plunging Joy and Bing Bong into the Memory Dump. At the bottom, Joy begins to lose hope, but discovers a sad memory of a hockey game that becomes happy when Riley's parents and friends comfort her. Joy realizes that Sadness serves an important purpose: to create empathy in others when Riley is emotionally overwhelmed and needs help.

Joy and Bing Bong try to use Bing Bong's old wagon rocket to escape the Memory Dump, but after several tries, Bing Bong realizes their combined weight is too much and jumps out, sacrificing himself to allow Joy to escape. Joy reunites with a despondent Sadness and manages to get them to Headquarters, only to discover that Anger's idea has disabled the console, rendering Rileyapathetic. To the surprise of the others, Joy hands control of the console to Sadness, who is able to successfully extract the idea, reactivating the console and prompting Riley to return home.

As Sadness reinstalls the (now sad) core memories, Riley arrives home to her parents and breaks down in tears, confessing that she misses her old life. As her parents comfort her, Joy and Sadness work the console together, creating a new core memory that combines their emotions; a new island forms representing Riley's acceptance of her new life. A year later, Riley has adapted to her new home, made new friends, returned to her old hobbies, and adopted a few new ones (fueled by new, more nuanced core memories from combinations of her emotions). Inside Headquarters, her emotions all work together on a new expanded console with room for them all, enabling Riley to lead a more emotionally complex life.