Shulchan Arukh, Orach Chayim Siman 67
Can copy this into an AI, or connect the whole library to your assistant. For deeper learning, you can directly use the original seforim, sites, and apps.
דין ספק אם קרא קריאת שמע. ובו סעיף אחד
ספק אם קרא ק"ש חוזר וקורא ומברך לפניה ולאחריה אבל אם יודע שקראה אלא שמסופק אם בירך לפניה ולאחריה אינו חוזר ומברך:
Mishna Berura Yomi
The Law Regarding One Who Had A Doubt If They Recited the Recitation of the Sh'ma - Containing 1 section If one had a doubt if they recited the Sh'ma, they should go back and recite it [again] and make the blessing before and after it. But if they know that they recited it, but are doubtful if they blessed before and after it, they do not go back and bless.