It is recorded in the Talmud (Yevamot 9a) that Rabbi Yehudah HaNasi insults his student Levi for a poorly-thought-out remark he had made by saying, "It seems to me he has no brain in his head." While the text of the Talmud was finalized in the 5th century, this quotation would supposedly have been spoken in the late 2nd century.
However, I know that in the Ancient Near East, as evidenced in numerous places in the Hebrew Bible, as well as in Egyptian texts, it was believed that the heart was the organ of thought in the body.
So when did the idea that it is the brain rather than the heart that is the organ of thought first appear in the Near East, and is its appearance in a quotation from the late 2nd century anachronistic?
I don't have an exact answer to this question, but "heart" was not used only to refer to an organ. It was also to refer to the "center" of someone, aka where their thoughts originate - but not from a brain, from who that person truly is, their soul.