Understanding the mechanisms whereby information encoded within patterns of action potentials is deciphered by neurons is central to cognitive psychology. The multiprotein complexes formed by NMDA receptors linked to synaptic membrane-associated guanylate kinase (MAGUK) proteins including synapse-associated protein 102 (SAP102) and other associated proteins are instrumental in these processes. Although humans with mutations in SAP102 show mental retardation, the physiological and biochemical mechanisms involved are unknown. Using SAP102 knock-out mice, we found specific impairments in synaptic plasticity induced by selective frequencies of stimulation that also required extracellular signal-regulated kinase signaling. This was paralleled by inflexibility and impairment in spatial learning. Improvement in spatial learning performance occurred with extra training despite continued use of a suboptimal search strategy, and, in a separate nonspatial task, the mutants again deployed a different strategy. Double-mutant analysis of postsynaptic density-95 and SAP102 mutants indicate overlapping and specific functions of the two MAGUKs. These in vivo data support the model that specific MAGUK proteins couple the NMDA receptor to distinct downstream signaling pathways. This provides a mechanism for discriminating patterns of synaptic activity that lead to long-lasting changes in synaptic strength as well as distinct aspects of cognition in the mammalian nervous system.