The present invention is directed to compounds of formula (I) which are M1 receptor positive allosteric modulators and that are useful in the treatment of diseases in which the M1 receptor is involved, such as Alzheimers disease, schizophrenia, pain or sleep disorders. The invention is also directed to pharmaceutical compositions comprising the compounds, and to the use of the compounds and compositions in the treatment of diseases mediated by the M1 receptor.