Scientists have discovered that the genes required for learning, memory, aggression and other complex behaviors originated around 650 million years ago.