The "Somnambulist" story is how Pinkerton investigates a bank robbery and murder which went unsolved by other detectives before. The murder victim George Gordon is called a "pay-teller" and "cashier" but actually it seems like he is much more responsible, being trusted to run the bank by himself when the senior bank officers are out of town. Anyway the young man was killed violently one night and found the next morning with the bank vault open. Money was missing and there was evidence of the killer burning his bloody clothes in the fireplace. Pinkerton interviews the bank officers and examines some evidence (notes, bills, and buttons found), then he takes a day to consider the case before giving his report. He even sounds a little like Holmes, declaring that he followed where the evidence led, without bias.
"It is very simple," I replied; "the search has hitherto been conducted on a wrong basis. The whole endeavor seems to have been to guess who might have done the deed, and then to find evidence to convict him. My plan in all similar cases is, to first examine the evidence before, with a perfectly unbiased mind; then, having formed a theory by reasoning on general principles, as applied to the facts in my possession, I proceed to look about for some person who will answer the conditions of my theory."
Thus, in only Chapter 3, Pinkerton already knows who the culprit is, but he doesn't have enough proof to arrest the man, and he wants to find out where the money is first. So we spend the next six chapters seeing Pinkerton's three detectives go undercover in the town, making friends with the killer and convincing him that he is repeatedly seeing the ghost of George Gordon, to prick his conscience.
What's interesting is that one of the three detectives is a woman named Mrs. Kate Warne, and Pinkerton praises her.
Mrs. Warne was the first lady whom I had ever employed, and this was one of the earliest operations in which she was engaged. As a detective she had no superior, and she was a lady of such refinement, tact, and discretion, that I never hesitated to entrust to her some of my most difficult undertakings.
Very refreshing in contrast to Holmes's distrust of women. She is not even described as an "assistant", but a detective in her own right.
Anyway, the title of the mystery comes from the fact that the killer turns out to be a sleepwalker. I found it weird, though, that when Pinkerton finally does suggest that they arrest him, he actually thinks that they don't have enough evidence for a criminal conviction yet. But he tells the bankers that they do have enough and takes the risk anyway. Strange way to work, and the ending was too abrupt. I wonder if that detail was true, or altered for literary license.