The present invention relates to pyrrole and pyrazole compounds of formula
(I) and their pharmaceutically acceptable salts, and further relates to
their use in treating schizophrenia, cognitive deficits associated with
schizophrenia, Alzheimer's disease, dementia of the Alzheimer's type,
mild cognitive impairment, or depression. The compounds act as
potentiators on glutamate receptors, in particular AMPA and the GluR
family.