The first Sherlock Holmes story, “A Study in Scarlet” was published in 1887, and would become the prototype for the modern mastermind detective.

Sir Arthur Conan Doyle was Joseph Bell’s assistant during Doyle’s time at school and followed along like Watson as Bell instilled in him the importance of observing minute details. Who’s to say if Bell, Like Holmes was robotic and flat, or if Holmes was made that way to better highlight his extreme powers of observation and deduction? Like Holmes, at least, Bell was now and then called upon by the authorities to solve forensic cases.

Source: https://www.distractify.com/p/was-sherlock-holmes-a-real-person