Maybe the script is not that spontaneous, yet it addresses the theme of aging, of being someone to forgetting who you are, where you are and who are the people in front of you (most likely family and friends).
Maybe a bit of the film is inspired by what happen to his dear friend Robbin and his strange syndrome that triggered his suicide. Maybe it is also tied a bit to the recent publication of the last days of Gabriel Garcia Marquez and his Alzheimer-Senile Dementia, where he read a book only to find surprised at the end a picture of him and acting surprised to see himself there.
The other important part of the movie is who is taking care of that relative. In many cases, people are sent of to a retirement home or a caregiver is hired, but family tends to flee from the situation. It has always been said that it is tougher for the relatives than to the patient seeing an aggressive disease, even that this one does not create pain to the pain, perhaps anguish; but the family member, we get to see how that relatives is like a candle slowly extinguishing or sometime very quickly: both are devastating