You can improve your memory by keeping away from sin because the bad
effects of sin result in a bad memory and the inability to retain
knowledge. As for being intelligent or smart, this is from Allah and Allah
gave each one of us certain abilities to do certain things.
Kindly refer to the following link(s):
https://islamqa.info/en/38594
https://www.youtube.com/watch?