Imam is basically a leader in Islam. The title is often given to the person who leads the prayers in the mosque. However, for Shias, imams have a different meaning. They are the religious scholars of slam who gained a lot of knowledge and helped propagate that knowledge.
There are a total of 12 imams who are each the son of the one before them. There is one exception which is Husayn Ibn Ali who was the brother of Hasan Ibn Ali. The first imam among them is the Imam Ali (AS). He was the son of Ibn Abu Talib.