After the premiere of “Up” at the 2009 Cannes Film Festival, Pixar chief John Lasseter explained the studio’s nearly foolproof approach to creating animated stories that both enchant and endure: Whenever possible, he said, he and his colleagues strive to fulfill Walt Disney’s motto: “For every smile, a tear.”

That dictum is not just obeyed but refined to throat-catching perfection in “Inside Out,” a triumphant return to form for the studio best known for such classics as “Toy Story,” “Finding Nemo” and “Wall-E.” As vivacious as it is thoughtful, as funny as it is wise and as warmly accessible as it is dizzyingly complex, this raucous journey through the inner life of an 11-year-old girl fires on every artistic cylinder, from its vivid visuals to its uncannily sophisticated grasp of brain science. If there were any justice in an entertainment culture currently dominated by lumbering dinosaurs and their dimwitted human handlers, the dumbed-down noise of summer would be decisively muted by the far more powerful moods, thoughts and ideas that give “Inside Out” not just its verve and spirit but also its soberingly high stakes.

And we haven’t even gotten to Bing Bong.

But that comes later. From the start, “Inside Out” centers on Riley (voiced by Kaitlyn Dias), a happy-go-lucky girl growing up in cozy bliss with her loving parents in Minnesota. From the moment of her arrival, Riley has a secret companion dwelling deep inside her brain: Joy, her cardinal emotion, personified as a twirling blue-haired pixie and voiced by Amy Poehler. Assuming chief-pilot position behind a blinking dashboard, it’s Joy who largely controls Riley’s feelings, even when Anger (Lewis Black), Fear (Bill Hader), Disgust (Mindy Kaling) and Sadness (Phyllis Smith) come into the mix. Happiness is Riley’s default setting, and her mostly positive vibes and memories have allowed her to construct a personality composed of different but complementary islands, including Family, Friendship, Honesty and — because she is one — Goofball.

Everything’s humming along — Riley is living the life of, well, Riley — when things begin going a bit wonky, starting with her family’s move to San Francisco and exacerbated by a dreary new house, difficulties making friends and pressure to keep up a tirelessly cheerful face for her parents (Diane Lane and Kyle MacLachlan). A couple of hiccups occur up in “headquarters,” where core memories are formed and processed into translucent orbs traveling along a wavy Skee-Ball course — or, if you will, an emotional roller coaster. When Joy and Sadness spelunk into Riley’s deeper consciousness to sort it out, the negative feelings threaten to take over, sending her into a funk of depression, loneliness and alienation.

Poehler brings her signature irrepressibility and motormouth charm to her performance as Joy, who, despite working for Riley, is really the star of “Inside Out.” Smith, best known as Phyllis from the sitcom “The Office,” brings similar texture to bear on her blue, teardrop-shaped sad sack, who droops and drags herself through Riley’s brain like an inner Debbie Downer. Directed by Pete Docter and Ronnie Del Carmen from a script by Meg LeFauve, Josh Cooley and Docter, “Inside Out” derives most of its comic relief from Black’s explosive portrayal of Anger, a boxy, easily enraged hothead. “Congratulations, San Francisco,” he fumes when Riley recoils from a broccoli-topped pie at a local Italian deli, “you just ruined pizza.”

As fabulous as the vocal performances are in “Inside Out,” it’s the clever writing and lush visuals that catapult it to greatness, from how ingeniously the filmmakers illustrate the inner workings of the human mind to amusingly on-point glimpses into the emotional HQs of Riley’s parents. (Pro tip: Stay all the way to the end for a hilarious end-credits sequence.)

Among “Inside Out’s” most impressive set pieces on Joy and Sadness’s journey through the mazelike expanse of Riley’s mind are a visit to abstract thought (in which they go from three to two dimensions, finally ending up as nonrepresentational squiggles) and a stop at the dream factory. The latter is depicted as a bustling Hollywood back lot where a rainbow-maned unicorn waits for her cue and a scary clown lurks far below in Riley’s subconscious where, as Sadness puts it, “they take all the troublemakers.”

Dodging vacuum-wielding “Forgetters” on the lookout for old telephone numbers and other useless facts, Joy and Sadness see the aforementioned Bing Bong, an imaginary friend from Riley’s toddler days who is part elephant, part cat, part dolphin and mostly cotton candy. Voiced with bittersweet sensitivity by Richard Kind, Bing Bong winds up playing a crucial role, not only in Riley’s putting away childish things but also in nudging Joy and Sadness toward getting along.

It’ll be no surprise if “Inside Out” becomes as beloved as “Toy Story” and “Finding Nemo,” if only for its liberated, wildly inventive sense of wonder and breathless, breakneck pace. But this is that rare movie that transcends its role as pure entertainment to become something genuinely cathartic, even therapeutic, giving children a symbolic language with which to manage their unruliest emotions.

Uncle Walt knew what he was talking about with “For every smile, a tear.” With “Inside Out,” the brilliant keepers of his legacy prove that it’s not only good for business but also essential for the soul.

PG. At area theaters. Contains mild thematic elements and some action. 94 minutes.