Scientists are studying the effect of “social frailty” on memory loss—and testing whether AI companions can help.