NOTE: This spoiler was submitted by Jeremy
It's 1943 in London. Sherlock Holmes (Ian McKellen) is 93 years old and retired from detective work. He is riding a train when he sees a young boy with his mother sitting across from him. The boy tries to tap the window glass as a bee sits outside. Holmes tells the boy not to do it as bees don't like that.
Holmes has since been immortalized by the works of his former partner John Watson, and he lives in a home in Sussex with his housekeeper Mrs. Munro (Laura Linney) and her son Roger (Milo Parker). Holmes is returning from a trip to Japan with a jar of jelly from a prickly ash plant to help him with his memory, as he is trying to recollect the details of his last case. Watson previously tried to write the case, but Holmes was dissatisfied with how he wrote it, so Holmes hopes to finish it his way, if only he could remember.
In his spare time, Holmes tends to an apiary of bees. Roger takes an interest and joins Holmes whenever he goes outside. He also hopes to help Holmes regain the memories of his final case.
We see a flashback of Holmes's trip to Japan where he met with a man named Tamiki Umezaki (Hiroyuki Sanada). He brings Holmes to his home where his mother serves them tea. She inquires about Holmes's supposed trademark deerstalker hat, which Holmes states is a misconception, as well as the notion that he smokes with a pipe (he prefers cigars). Umezaki supplies Holmes with the prickly ash jelly.
Holmes is visited by Dr. Barrie (Roger Allam), who knows his memory is failing and suggests that he be placed in a special home to be taken care of, but Holmes refuses.
We see the flashback to Holmes's last case 35 years earlier, where he met with a man named Thomas Kelmot (Patrick Kennedy) over the circumstances surrounding his wife Anne (Hattie Morahan). Thomas stated that Anne had suffered two miscarriages, and the doctors said that trying again would be too dangerous. Anne became depressed but later took up playing the glass harmonica. At times, Thomas could hear Anne playing and then stop to say, "Grace? James?", which would have been the names of her children.
Holmes investigated and followed Anne to a harmonica studio where she took lessons with a woman named Madame Schirmer (Frances de la Tour), whom Thomas accuses of hiding Anne from him. He and Holmes entered the studio, with Thomas demanding to know where Anne is, despite Schirmer saying that Anne never came to her. Holmes then spotted Anne walking behind the studio and he continued to follow her from there. He saw Anne going about town meeting with men to forge checks in Thomas's name and later cashing them, as well as purchasing a special brand of poison, giving him the impression that Anne was trying to murder her husband.
Holmes continues to spend time with Roger, despite his mother's disapproval. She is set to take on a new job at a hotel and to take Roger with her, but Roger doesn't want to leave Holmes. Holmes passes out one evening from an experiment with the prickly ash, making Mrs. Munro less keen on taking care of him. Things get heated between her and Roger one night during dinner when Roger insults his mother's educational and working status, to the shock of Holmes. He orders Roger to go apologize to his mother, which he does.
In the rest of Holmes's trip to Japan, he was told by Umezaki that his father left him and his mother for England and stayed there after meeting and being greatly impressed by Holmes, leaving Umezaki devastated.
Back to 35 years ago - Holmes followed Anne and she later sat down so they could speak to each other. Holmes learned that Anne did not plan to kill Thomas, but instead wanted to purchase gravestones for herself and her unborn children, and the poison would be for herself. Holmes appealed to Anne's feelings by stating he understands how it feels to be lonely. Anne poured the poison on the ground and suggested that the two of them live together so that neither would have to feel alone. Holmes declined, as he felt he had unfinished business to take care of. Anne later walked in the path of a moving train and died. Holmes blamed himself for her death and ended his detective work.
Holmes recalls his final meeting with Watson years ago when he took care of Holmes. We never see Watson's face, but he rarely left Holmes's side. Watson would pass away not long after.
Holmes resolves his issue with Umezaki by writing a letter to him saying his father was a member of the British Empire after realizing Watson's version of his last case was kindness toward Thomas.
One afternoon, Holmes heads to the apiary when he discovers Roger lying on the ground unconscious and covered in stings. Holmes calls for help, and Mrs. Munro runs out to her son. Roger is taken to the hospital and is being treated, but he is still unconscious. Back home, Mrs. Munro douses the apiary with kerosene to light it up, telling Holmes he never cared about Roger. Holmes breaks down sobbing, saying he did. He quickly realizes that there is a nearby wasps nest, which Holmes says Roger was trying to get rid of because it was the wasps that were killing the bees, but Roger got too close and got swarmed by wasps. He knows this because bees leave their stingers, and wasps don't. Holmes and Mrs. Munro burn the wasps nest.
Roger awakens and is later brought home to recuperate. Holmes tells Mrs. Munro that she and Roger can have his house after he passes, instead of taking on another dead end job. Holmes feels a sense of growth in his connections with others. Roger shows his mother how to tend to the bees. Holmes is last seen laying a group of stones in a circle in remembrance of those he knew and lost (Watson, his brother Mycroft, Mrs. Hudson, and Anne, among others).