Spiking neural networks (SNNs) have attracted extensive attentions in Brain-inspired Artificial Intelligence and computational neuroscience. They can be used to simulate biological information processing in the brain from multiple scales, including membrane potential, neuronal firing, synaptic transmission, synaptic plasticity, and multiple brain areas coordination. More importantly, SNNs serve as an appropriate level of abstraction to bring inspirations from brain and cognition to Artificial Intelligence. Existing software frameworks support SNNs in machine learning, brain simulations, and specific hardware devices from certain perspectives respectively. However, the community requires an open-source platform that can support building and integrating computational models for brain-inspired AI and brain simulation at multiple scales. In this paper, we present the Brain-inspired Cognitive Intelligence Engine (BrainCog) for creating brain-inspired AI and brain simulation models. BrainCog incorporates different types of spiking neuron models, learning rules, brain areas, etc., as essential modules provided by the platform. Based on these easy-to-use modules, BrainCog supports various brain-inspired cognitive functions, including Perception and Learning, Decision Making, Knowledge Representation and Reasoning, Motor Control, and Social Cognition. These brain-inspired AI models have been effectively validated on various supervised, unsupervised, and reinforcement learning tasks, and they can be used to enable AI models to be with multiple brain-inspired cognitive functions. For brain simulation, BrainCog realizes the function simulation of Drosophila decision-making and prefrontal cortex working memory, the structure simulation of the Neural Circuit