When Diane Keaton’s mother, Dorothy Hall, first saw 1977’s Annie Hall, she immediately recognized the inspiration for her daughter’s namesake relatives in Woody Allen’s film.

“The Hall family was depicted as funny, especially Duane, a thinly disguised substitute for Randy,” Dorothy wrote in her journal. “Duane [played by Christopher Walken] was a sensitive person with a unique personality Woody’s character couldn’t cope with.”

Diane Keaton
Shutterstock

That description could also apply to Randy, Diane’s younger brother, but his unconventional personality was far from a joke. In her new memoir, Brother & Sister, Diane, 74, examines her relationship with Randy, 71, who has long struggled with mental health issues and is now afflicted with dementia and living in a care facility.

“She wants the world to better understand and have compassion for those who are suffering from mental illness,” an insider exclusively tells Closer Weekly in the magazine’s latest issue, on newsstands now. “She wanted to explore that before it was too late for her and Randy.”

Randy’s parents continued to support him financially, and his alcoholism led him to develop cirrhosis and require a liver transplant. As Diane’s star rose in Hollywood, she had distanced herself from her family’s turmoil.

“I convinced myself that I didn’t have time to engage with their ongoing plight to save Randy,” she writes. “It was easy for me to let him remain in the background of my life.”

Diane Keaton
Shutterstock

“My most intimate relationship with any male took place in a pint-size room underneath a crescent-shaped ceiling, where once upon a time I slept in a secondhand bunk bed overlooking my delicate, blond-haired brother below,” writes Diane, who has never married.

Diane and Randy’s civil-engineer father, Jack, found the concept of psychological counseling “kind of threatening,” so Randy didn’t receive treatment until he became eligible for the draft in Vietnam and was granted a deferment.

Randy went to work for his dad, but they clashed on the job. One day, Jack called Randy into his office and insisted he refer to him as “Mr. Hall” in front of his coworkers. “This was the straw that broke the camel’s back,” Diane writes. “Randy remained unresponsive. Instead he drank bottles of scotch.”

Diane Keaton
Shutterstock

Randy’s parents continued to support him financially, and his alcoholism led him to develop cirrhosis and require a liver transplant. As Diane’s star rose in Hollywood, she had distanced herself from her family’s turmoil.

“I convinced myself that I didn’t have time to engage with their ongoing plight to save Randy,” she writes. “It was easy for me to let him remain in the background of my life.”

After their parents died (Jack from brain cancer in 1990, Dorothy from Alzheimer’s disease in 2008), Diane reconnected with Randy.

Diane Keaton
Shutterstock

“For the first time in years, I began to take in his face,” she writes. “I noticed it was getting better with age, just like Mom’s. Maybe their beauty had been enhanced from the pain they endured.”

Now Diane visits Randy every Sunday and hopes to set an example of brotherly- sisterly support for daughter Dexter, 24, and son Duke, 19. Writing the book “was tough, but cathartic,” the insider says. “She feels it honors Randy, their family and their struggles, and shows the love they genuinely have for each other.”

For more on Diane Keaton, pick up the latest issue of Closer Weekly, on newsstands now — and be sure to sign up for our newsletter for more exclusive news!