In Psychology, in the domain of social cognition a schema is an organized knowledge structure about a concept or object. Schemas and categories (very simple schemas that group like things together) are our "working knowledge" about the world.

Schemas serve as an adaptive function and are involved in automatic processing, which allows us to efficiently assimilate new experiences into existing schemas. We would not be able to function if many or our perceptual/cognitive processes were not automatic. They allow and help us to resolve ambiguities by quickly applying one's working knowledge of the world. Schemas affect the information that we notice, think about, and remember. We usually remember and notice the information that is consistent with a schema. In addition schemas help us fill in missing information with defaults.

So on the one hand schemas can help us greatly, but they also have a drawback. Schemas can distort what we see and remember, by changing information to fit a certain existing schema. And schemas can persist even after they are discredited, hence the perserverance effect.

There are many types of schemas:

Exemplar: A specific instance of a member of a schema.
Person Schema: A schema about a specific individual.
Prototype: The typical (average) or ideal member of the category or schema. It doesn't have to be real or match any particular exemplar.
Role Schema: A role, or roles of a person or individuals in a particular context.
Script: An action schema, like riding a bike, or driving a car.
Self-Schema: Who or what you are (all the knowledge and beliefs about yourself.
Stereotype: A schema about people who belong to particular groups. Blacks, Asians, Germans, lawyers, waitresses, librarians, etc...

Schemas are also related to heuristics.

Lecture notes from Jennifer Campbell of the University of British Columbia