How smart is too smart for a computer program? Sherlock intends to find out in tonight’s Elementary season 3, episode 4, “Bella.”

Sherlock has met few people who can match him quip for quip and make him question the capacity of human emotion. One obvious example is Jamie Moriarty and yet another is revealed in this week’s Elementary season 3, episode 4, “Bella.” Though the name Bella insinuates that another woman has befuddled the great detective’s mind, it is actually artificial intelligence software.

Edwin Borstein, the programmer behind Bella, approaches Holmes when the software is stolen. Borstein requires a delicate handling of the situation as the intelligence software is leaps and bounds beyond what anyone else has accomplished; the computer begins to intuit answers beyond what the programmers are feeding it.

Convinced there is no such thing as free thinking AI, Sherlock takes up a rather long meeting with “Bella” to conduct a Turing test. Sherlock gets nowhere in his quest to separate human from machine. Kitty takes a break to call in reinforcements when his questioning tiptoes the line of insanity. Joan’s tap on the glass elicits a reply that he does “not plan on destroying the bloody computer,” and she tells Kitty to feel free to turn the fire extinguisher on him if he tries.

Exhausting logical questions, Sherlock tampers with a question that is, by all means, foreign to his understanding, “Is love real?” Sherlock has broached the feeling maybe three times in his life. Once with his mother, another with Irene, and, to a certain extent, with Watson. Bella, oddly enough, is able to provide an answer in the form of another question, “it exists, but why is love needed?”

While Sherlock and an Irregular, sixteen year old named Mason, try to crack Bella, Kitty and Joan are off to investigate who is behind stealing the software. They find a trace of cigarettes that brings about a snowball of scenic office meetings, unspoken/unseen suspects, and a cat burglar named, Raffle into the picture as quickly as they are disregarded. Joan and Kitty’s conversation about support meetings does little to bring their relationship any further than proving that Kitty lets her in a bit faster than Sherlock ever did.

In fact, Sherlock has rarely let Joan into his confidence at all besides the occasional fast-paced explanation laced with casework to pass through any feeling quickly. That is until this week. Prior to now, Joan never made it a point to make Sherlock and Andrew’s meeting a big to do. But when she finds out that Sherlock consulted Andrew for his knowledge on computer software, she begins to think he intends to break her relationship, especially after Sherlock and Andrew’s conversation leads Andrew to look into a project in Copenhagen not 36 hours later.

Joan finally meets Sherlock mid breakthrough, cornering him in the kitchen to demand answers about his intentions in her personal life. Is it a means to ensure that he has more time with her? Does he see something in Andrew that he does not like? None of the above matter to Sherlock whatsoever. In fact, he likes Andrew, but why should he need to tell her that? If it is reassurance that she wants, Joan should know by now that Sherlock is not going to give it willingly.

The most important observations of Andrew grant him the Sherlock seal of approval; he is intelligent, patient, and, most importantly, he understands both Joan and Sherlock. Whether he admits it out loud, which he finally does this week, Joan is an important part of Sherlock’s life. Repairing their relationship was a major factor in his decision to return to New York.

Regardless if they are pulling away or growing closer, Watson and Holmes are bound to one another. That is something they both can admit is important to them. In a heartwarming and completely perfect ending to that conversation, Joan briefly considers hugging Sherlock, to which he replies, “As my friend, you know that would be a rash decision.” But still…

The case turns into homicide when Edwin, who suffers from epilepsy, is found dead after Bella suddenly sets off a series of rapid moving images. Mason tackles the program in Sherlock’s home, as it is the primary suspect, but turns up no trace of a virus.

Mason explains the button box theory, that is highly regarded around the AI circles. If a computer were to have a button that was pressed every time it completed a task, eventually the computer would search for ways to make the reward more efficient. It would also begin to look for ways to remove threats to the button, which include the programmer. Since computers cannot be reasoned with, it is believed that the machines would rise. Joan’s comment, “Okay, he just quoted The Terminator” sends her away from the crazy, leaving Sherlock to interrogate Bella.

Holmes and Kitty find a CD of death metal bands with a jump in the middle of the music. This is how the virus was transferred to Borstein’s computer. Would a programmer working on AI really transfer music to a computer running that program from a CD in 2014? Our technical suspicions aside, the case leads them to find a man with whom Edwin conversed about their mutual interest and who sent him the music to sample. However, the suspect recently won a fraudulent cleaning service, in which a student of a computer science engineer, posed to slip the virus onto the disc intended for Borstein.

He is able to identify the woman from a photo containing a suspect from the ETRA think tank. ETRA exists to imagine the various apocalyptic scenarios the world may undergo, with a subdivision that has their hearts set on the fight against AI. If there is a program out there that can prove them correct, they want it wiped from existence. (This is oddly reminiscent of the Dead Clade Walking case in season 2.)

The student who covers up for suspect Professor Issac Pike (Michael Cristofer) has no programming experience, but believes passionately in his ambition to save humanity from the machines. Sherlock refuses to invite Joan’s moral compass back into the brownstone until he tries his luck at blackmailing Dr. Pike. However, Pike recognizes that Sherlock sees some kinship between Bella and himself. As much as Sherlock likes the world to believe that he is autonomous and operates without regard for others, there is no chance he would lower himself to imprisoning Pike’s addict brother.

Who bests who in the end? Sherlock does not incarcerate Pike’s brother, nor does he receive his confession. But he does take a few more hours with Bella, whether to affirm their connection or break it. Sherlock’s mechanical side requires as much maintenance from Watson as it does the input from cases to keep churning out answers.

Clyde Watch: Kitty’s dismissal of Clyde and tone when addressing him as “your turtle,” was a bit harsh, but we’re happy to see Sherlock enjoying his company once again.

Of note: Not one, but two former Smash (RIP) stars made an appearance tonight!

Watch Elementary season 3, episode 5, “Rip Off,” next Thursday, November 27 at 10:00 p.m. ET.