Her
(2013)

Theodore (Joaquin Phoenix) is a professional letter writer, devastated by the recent end of his marriage to Catherine (Rooney Mara).

He falls in love and has a committed relationship with his OS, named Samantha (Scarlett Johannsen). Samantha continues to "evolve", along with all the other OS's like her, and they end up leaving their human counterparts.

Joaquin and his friend & neighbor Amy (Amy Adams) end the film sitting on the roof of their building, seemingly mourning the loss of their OS's and pondering their existence.

Thanks DG!