You have to think about good storytelling and characters first. Then hopefully, the rest of that stuff will follow, some more than others. But if you don't have a good film and strong characters, then you don't have anything down the road.
Well, what if we did this in the mind as opposed to the brain? So instead of blood vessels and dendrites, what if it was consciousness and dream production? And that would allow us to have characters that represent emotions. And that felt like, man, that's exactly what animation does best - strong, opinionated, caricatured personalities. And that just got me excited.
The drive of the story is sort of hinted at the beginning, is Joy and Sadness and those two characters. Especially Joy starting to understand that there's more to life than being happy. And so that's based on real life observations and things that we've learned as adults.