Effective treatments for complex central nervous system (CNS) disorders require drugs with polypharmacology and multifunctionality, yet designing such drugs remains a challenge. Here, we present a flexible scaffold-based cheminformatics approach (FSCA) for the rational design of polypharmacological drugs. FSCA involves fitting a flexible scaffold to different receptors using different binding poses, as exemplified by IHCH-7179, which adopted a "bending-down" binding pose at 5-HT 2A R to act as an antagonist and a "stretching-up" binding pose at 5-HT 1A R to function as an agonist. IHCH-7179 demonstrated promising results in alleviating cognitive deficits and psychoactive symptoms in mice by blocking 5-HT 2A R for psychoactive symptoms and activating 5-HT 1A R to alleviate cognitive deficits. By analyzing aminergic receptor structures, we identified two featured motifs, the "agonist filter" and "conformation shaper," which determine ligand binding pose and predict activity at aminergic receptors. With these motifs, FSCA can be applied to the design of polypharmacological ligands at other receptors.