Caleb is a programmer for Bluebook, the world's most popular search engine. He wins a one-week visit to the secluded home of Bluebook CEO Nathan. The only other person there is Kyoko, a mute housemaid.
Nathan has built a humanoid robot named Ava with artificial intelligence
(AI). To program her behaviour, he harvested personal information from
billions of Bluebook users, using their search queries as indicators of
human thought, and hacked billions of cell phones for recordings of
human expressions and body language. He wants Caleb to administer the Turing test
to Ava, a test designed to measure an AI's ability to persuade the
tester it is human. Caleb points out that this is not a fair test, as he
already knows Ava is an AI; Nathan responds that Caleb must judge
whether he can relate to Ava despite knowing she is artificial.
Ava has a robotic body and a synthetic brain, but a human-looking
face, and is confined to her apartment. Caleb grows close to her, and
she tells him she wants to be with him. She reveals that she can trigger
power outages that temporarily shut down the surveillance system that
Nathan uses to monitor the complex and their conversations. During one
outage, she tells Caleb that Nathan is a liar who cannot be trusted.
Caleb encourages Nathan to drink until he passes out, then steals his
security card to access the mainframe system. He alters some of
Nathan's code, then watches footage of earlier androids Nathan built;
they damage themselves in their desperation to escape. He also discovers
that Kyoko is an android. Back in his room, Caleb cuts his arm open and
investigates his flesh.
At their next meeting, Ava cuts the power; Caleb says he fears that
Nathan will reprogram her, "killing" her personality. They agree on a
plan: Caleb will get Nathan drunk and reprogram the system to open all
the complex's doors at the next outage, and Caleb and Ava will escape
together.
The next day, Nathan reveals that he recorded Caleb and Ava's
conversation using a battery-powered camera. He explains his real motive
for inviting Caleb: to see if Ava was convincingly human enough to
seduce Caleb into helping her escape. Caleb reveals that he has already
reprogrammed the doors to open while Nathan was drunk the previous
night.
When Ava cuts the power, she leaves her confinement and Nathan knocks
Caleb unconscious. As Nathan begins to drag Ava back to her
confinement, Kyoko stabs him with a kitchen knife. Nathan knocks her
inert, but Ava stabs him to death. She takes parts from prototype
androids, giving her the appearance of a complete human, and leaves
Caleb trapped inside a sealed room. She boards the helicopter meant for
Caleb's departure and enters human society.

