NEWTOWN, Conn. — On the day of his 6-year-old daughter's funeral, as Jeremy Richman and his wife gathered with loved ones, an idea emerged for a way to channel their grief: a foundation to promote research into the brain pathologies that lead to violence.

Within months of the slaying of their curly-haired first-grader Avielle in the 2012 Sandy Hook Elementary School massacre, the couple launched The Avielle Foundation with the goal of trying to prevent others from suffering such tragedies.

Richman dedicated himself to the cause, becoming known locally and nationally for his advocacy on mental health issues, up until his death on Monday. He was found dead in an apparent suicide inside a Newtown community event center where he had an office, according to police. He was 49.

"Jeremy made huge strides in brain health and suicide prevention," said Stephanie Cinque, the director of the Resiliency Center of Newtown, set up as a place for people to gather and talk after a socially isolated gunman killed 20 children and six educators on Dec. 14, 2012.

"Very sadly, this is a great example of how complicated it is. Jeremy's legacy now, too, is creating the space for that conversation," she said.

Richman and his wife Jennifer Hensel, both scientists, created the foundation to promote research into how a propensity for violence is manifested. Richman, a neuroscientist, eventually left his job as a researcher at a pharmaceutical company to focus full-time on the foundation.

"The brain is just another organ, and you don't have to be a neuroscientist to recognize that it can be healthy, it can be unhealthy, and that you need to feel comfortable advocating for your own brain health and the brain health of your loved ones," Richman said in 2016 interview. "We feel that the failure to do that led in large part to the tragedy at Sandy Hook."

Richman developed a national profile as a lecturer and advocate. He had a meeting on mental health with then-President Barack Obama. In 2015, he received an appointment as a lecturer in psychiatry at Yale's medical school.

Richman also provided "brain health" first aid for children and others at the Resiliency Center of Newtown.

"He referred to it as 'brain health' because it didn't have the stigma that came with saying 'mental health,'" said Cinque. She said Richman also did a lot of work with suicide prevention.

"He would always say, 'Ask the question.' Because, in general, people don't like to say they are going to commit suicide," she said.

Connecticut's governor, two U.S. senators and other local leaders shared stunned condolences.

"Jeremy Richman was a loving husband, father and friend to many," Newtown First Selectman Dan Rosenthal said. "I am proud to say he was my friend. I don't want to speculate as to why Jeremy took his life, except to say none of us can fathom the enormity of loss he carried with him after the death of his beautiful daughter, Avielle."

The foundation said its work would continue.

"Jeremy's mission will be carried on by the many who love him, including many who share the heartache and trauma that he has suffered since December 14, 2012," the foundation said in a written statement. "We are crushed to pieces, but this important work will continue, because, as Jeremy would say, we have to."

A native of Boulder, Colorado, Richman earned his undergraduate degree and doctorate at the University of Arizona.

In addition to his wife, he is survived by two children.