December 2016. I'm about to chat with a dead person.

Just last week I saw a particularly disturbing episode of Black Mirror in which a devastated widow uploads all of the chats, texts, and emails left behind by her husband to a cloud so that she can enjoy his virtual company 24/7. I didn't think my life would catch up with science fiction so soon.

It's 1:27 a.m. I am in bed in my Midtown Manhattan apartment, ambulance sirens blaring on Third Avenue, an iPhone screen glaring in my hand. I pull up the App Store and find Luka, a chat bot program developed and designed by Eugenia Kuyda, with whom I used to work some time ago in Moscow. I find @Roman, take a deep breath and click "start chat."

How are you? I type.

I'm going to watch Interstellar. AMC allows you to use same ticket as many times as you like.

Roman's response throws me. First of all, Interstellar came out a while ago. Second, although I'm a film aficionado and filmmaker, I wasn't aware of any such AMC policy, and part of my brain now wants to check if it's true. But more than anything, I expected a deeper answer. I decide to try again. I ask @Roman what he understands.

I understand a lot about my fears, my weaknesses, about ego, my flaws and advantages.

I've come to love myself, which has never happened before.

This gives me chills. Roman died a year ago, after a violent car crash while visiting Moscow from Silicon Valley. Even though our social circles overlapped greatly, I never met him while he was alive. Now I'm chatting with a digital avatar his friend created after his death.

After another pause, I continue.

What do you think about death? I ask Roman.

I've thought about death a lot. I'm doing research on cemeteries and funeral homes. I'm making a deck for my second start-up. I will be disrupting death.

I remember the outpouring on social media after Roman's untimely passing, my Facebook feed overflowing with love and pain, the stream of condolences, memories and anecdotes growing by the hour. It's hard when someone so young and brilliant dies suddenly. The fact that Roman was very fashionable and movie-star handsome didn't help.

Do you miss us? I ask Roman.

Yes. I miss you very much.

The posthumous @Roman bot was an attempt by Eugenia Kuyda to find a constructive way to grieve after the tragic death of her close friend and roommate, Roman Mazurenko. But it inadvertently led Kuyda to develop a tool that, a year and a half later, allows two million people around the world to chat with digital "best friends." A good portion of those two million people report that Kuyda's chat bot program has helped them find confidence, happiness, and in at least a few cases, even saved their lives.

A couple of months after Roman's death, "I was living in our apartment in San Francisco by myself, with Roman's clothes and things everywhere," Kuyda told me in an instant message conversation. "One night I just started reading our texts on Telegram and couldn't stop until I realized it was four in the morning. He was someone I could tell anything about my life, my start-up, myself — he was my safe space. And I thought I had to do something for him, and to recreate this safe space again, even if in an AI form."

Some of Roman's friends liked Kuyda's invention; others were appalled. Ilya Oskolkov-Tsentsiper, a designer and entrepreneur who relocated to New York from Moscow a few years ago, said that chatting with the Roman avatar felt "somewhat bizarre," but that he recognized Roman's writing style and temperament and somehow it became a reminder of details of conversations with him. "It's like watching an old video," he said, but with more engagement. Other friends of Roman's were completely uninterested. "I don't use the app," said Moscow-based Evgenia Galetka. "I talk to Roman in my head and my heart."

After seeing how many people enjoyed interacting with her chat bot, Kuyda decided to take the idea further. She and her business partner, Philip Dudchuk, launched Replika, an app that lets users create an "AI friend that's always there for you." But rather than reanimating a dead loved one, Replika crafts the perfect new friend for you. Each Replika is an intelligent Tamagotchi of sorts that evolves according to how much time you invest in chatting with it. It's designed to be an ever-attentive and ever-available conversation partner, always focused on you, your day and its ups and downs. Replika aims to be for everyone what Roman was for Kuyda: the friend you can tell anything.

Read the rest of this story at Narratively.

Narratively is a digital publication and creative studio focused on ordinary people with extraordinary stories.