The showrunner behind the plot-twisty network sitcom talks about the power of memory and avoiding the M. Night Shyamalan trap.

Michael Schur says showrunner Greg Daniels taught him how to write for TV — first as a writer on “The Office,” and then as co-creators of “Parks and Recreation.” However, one lesson serves as his guiding principle: The difference between good and long-term storytelling boiled down to what Daniels called “institutional memory.”

“It really annoyed him when characters seemingly didn’t learn anything,” said Schur on IndieWire’s Filmmaker Toolkit podcast. “[Characters] would do something, act in a certain way, and then eight episodes later there would be a different story and act in the same way they did the first time. [It’s] as if their memories were erased and they didn’t learn anything. They didn’t grow and they weren’t real people who had lives.”

With “The Good Place,” Schur explores how people grow and better themselves. In season two, this is complicated by the demon (Ted Danson), who constantly reboots their afterlives.

“In ‘The Good Place,’ that idea is taken to sort of an extreme,” said Schur. “Not only are the characters trying to emotionally learn things, we [also] want them to progress as people — but then there’s a weird variable that their memories are constantly being erased. It’s sort of an extreme-sports version of this lesson I learned writing for Greg, which is not only do the rules need to say the same, but everyone’s memory needs to be additive as you go along. If you don’t do that, you’re going to write a bad show.”

Schur also talked about how after the show’s season-one finale, which had a huge, world-altering plot twist, it was vital to ensure the audience wasn’t anticipating the next big turns in the story. Schur held up filmmaker M. Night Shyamalan as a cautionary tale — who, after a couple of movies, fans would guess the film’s twist after seeing a two-minute trailer. It’s one of many aspects of creating a world-building, plot twisty, philosophy-fueled, 30-minute sitcom that gives Schur sleepless nights, but that has also lent itself to creating one of the richer, more layered stories on network TV.