It was narrated from 'Ali that the Messenger of Allah (ﷺ) said: "Mahdi is one of us, the people of the Household. Allah will rectify him in a single night."
Muhammad bin Amara told me, he said: Ismail bin Aban told us, he said: Al-Sabah bin Yahya Al-Marri told us, on the authority of Al-Suddi, on the authority of Abu Daylam, he said: Ali bin Al-Hussein said to a man from the people of Levant: Did you not read in al ahzab (Allah only intends to keep ˹the causes of˺ evil away from you and purify you completely, O members of the ˹Prophet’s˺ family!) He said: you are them? He said: Yes.
Tafseer al Tabari
So going back to the first Hadith; since Imam Ali ibn al Husain AS said he’s from the purified Ahlul bayt AS that means Imam mahdi AJ is from him.
It is agreed from both Sunni and Shia that imam Mahdi AJ would be the most knowledgeable of his time;
Likewise, the saying of Abu Jaafar al-Baqir: “We are the people of the remembrance” - and what he means is that this nation is the people of the remembrance - is correct, because this nation is more knowledgeable than all the previous nations, and the scholars of the people of the Prophet’s household - peace and mercy be upon them - are among the best scholars if they are on the straight Sunnah, like Ali. Ibn Abbas, Bani Ali: Al-Hasan and Al-Hussain, Muhammad bin Al-Hanafiya, Ali bin Al-Hussein Zain Al-Abidin, Ali bin Abdullah bin Abbas, Abu Jaafar Al-Baqir - who is Muhammad bin Ali bin Al-Hussein - and Jafar his son, and their likes, their strikes and their forms, who are holding on to the firm rope of God And his straight path, and everyone who has a right knew his right, and he descended all the house that God and His Messenger gave him, and the hearts of his faithful servants gathered to him.
Tafseer ibn katheer 16:43
So since Imam Baqir AS and imam Sadiq AS are Ahlul thikr and so is imam Mahdi AJ that means he is from them AS. And about the last part; this would apply to imam Kadthim AS and imam Ridha AS:
Some Sunni scholars, such as al-Sam'ani, visited Imam al-Kazim's (a) grave[124] and took resort (tawassul) to him. Abu 'Ali al-Khallal, a Sunni scholar, said that he visited Musa b. Ja'far's grave and resorted to him whenever he had a problem and then his problem was solved.[125] Al-Shafi'i is also quoted as saying that Musa b. Ja'far's grave is a "healing cure".[126]
Ibn Hibban(sunni scholar) wrote, "His grave is in Sanabad, out of Nawqan beside the grave of Rashid and is being visited; and I have visited it many times and when I was in Tus and I faced no problem except that I visited the grave of 'Ali b. Musa al-Rida (a), may peace by upon him and his forefather, and called God there and my problem was solved and my supplication was answered. I have experienced this many times and I have found it this way.
Now since Imam Mahdi AJTFS will have all Muslims support him and come back to him just like imam Kadthim AS and imam Ridha AS he is from them and he’s from imam Jawad AS aswell since he’s the only son of imam Ridha AS
As for imam Hadi AS; he was the sole inheritor of his father + he ended the fittnah which was whether the Quran was created or is the word of Allah making him the most knowledgeable of his time
As for imam al Askari AS; he inherited his father solely. Sunnis have no saying of him so I’ll link a Shia Hadith:
The servant of Imam al-'Askari (a) said, "Every once that Imam al-'Askari (a) went to the court of caliph, an unusual excitement and happiness was seen among people. The streets on his way became full of people who were riding their horses. When Imam (a) came, the crowd would become silent at once. He (a) passed through the crowd and entered the court."
For the birth of imam Mahdi AJ; older Sunni sources suggested that he died and sufis also believe this. However let’s see what the prophet SAWA says:
Narrated Zaid bin Arqam, may Allah be pleased with both of them: that the Messenger of Allah (ﷺ) said:"Indeed, I am leaving among you, that which if you hold fast to them, you shall not be misguided after me. One of them is greater than the other: The Book of Allah is a rope extended from the sky to the earth, and my family - the people of my house - and they shall not split until they meet at the Hawd, so look at how you deal with them after me."