I want to ask i have heard in many majalis that before we were born God took a pledge from us So my Question is at that time was it only our soul that pledged to God or was our brain also present ??Thanks

This is referring to the verse in the holy Quran

وَإِذْ أَخَذَ رَبُّكَ مِن بَنِي آدَمَ مِن ظُهُورِهِمْ ذُرِّيَّتَهُمْ وَأَشْهَدَهُمْ عَلَىٰ أَنفُسِهِمْ أَلَسْتُ بِرَبِّكُمْ ۖ قَالُوا بَلَىٰ ۛ شَهِدْنَا ۛ أَن تَقُولُوا يَوْمَ الْقِيَامَةِ إِنَّا كُنَّا عَنْ هَٰذَا غَافِلِينَ – 7:172

"And when your Lord brought forth from the children of Adam, from their backs, their descendants, and made them bear witness against their own souls: Am I not your Lord? They said: Yes! we bear witness. Lest you should say on the day of resurrection: Surely we were heedless of this."

This took place in what is called Allama Dharr (the world of particles) when we were particles.