To understand what an ego-complex is, we first need to separately understand what the ego function is, and what a complex is.
The ego is a cognitive function responsible for our brain's capacity to formulate a sense of self. The ego is the cognitive faculty that allows for self-awareness, or the concept/identity of an "I" to arise, as distinct from everything else. The ego, as self-awareness, is only comprised of conscious material (i.e. material we are aware of). Thus, the ego is, by definition, unaware of unconscious material and does not include this material into its self-awareness. That which is part of a person's psychological totality, but which is not mentally modelled or accounted for in ego awareness, is called the personal unconscious.
A complex refers to a network of psychic processes that have connected themselves libidinally and which operate as one motivational circuit that carries out higher-order operations. The qualia of a complex is experienced as a personality, or sub-personality. A complex can be created and operated within consciousness or within unconsciousness, generating an ego complex and a shadow complex respectively.

The diagram above shows the constitution of a complex as a simplified illustration, using the ego-complex as an example. The dotted lines represent the complex, while the circles represent psychic processes. These psychic processes are generalized as being either cortical or limbic. The complex connects both cortical and limbic processes together into a motivational circuit. The size of a complex is variable, and may involve few or many psychic processes.
The ego function is a mental organization process which rallies together cognitive faculties into a hierarchy, as a complex. This complex is composed of the cognitive faculties that sit beneath it, and it utilizes these faculties to run wide-scale programs which are experienced qualitatively as a personality. The ego function does not necessarily produce only one complex with subordinate cognitive faculties. The ego function can produce oppositional hierarchies of cognitive faculties. When this happens, the person will have a duplicity in their personality. Each 'personality' in them will be the result of the ego function rallying together different cognitive faculties under an ego-complex.

A shadow-complex is a complex that exists outside of the awareness and control of the ego. Metaphorically, if the ego is comparable to a ship captain, the ego-complex is the total group of sailors that follow the captain's orders. By comparison, the shadow-complex would be a group of sailors who are not allied with the captain and who band together to fulfil their needs independent of the agenda of the captain. Like the ego-complex, the shadow-complex rallies together cognitive faculties, but into an unconscious complex or personality. Unconscious psychological needs will rally together cognitive faculties and conjoin them together into an operative agent. This operative agent works unconsciously to meet the needs that the ego-complex is not attending to. The construction of a shadow-complex happens much like the construction of an ego-complex. It organizes motivational systems together like the ego, but does so with less intentionality. Thus, a shadow-complex will be an amalgamation of repressed content, loosely organized and chaotic. This chaotic and amalgamated nature of a shadow-complex may lead to self-contradictory and paradoxical methods of attaining those needs.
