Mr Smith is Sarah Jane's supercomputer that she hides in her wall. It is really a Xylock- an alien race that has a huge memory store. It first communicated with Sarah Jane's laptop when she bought the house and it promised Sarah Jane that he would help her in keeping the Earth safe for as long as he was functional. There is occasional banter between it and K-9.