To build AI for a robot, you need basically three components: 1) Sensor, 2) Logic, and 3) Actor.
Sensors task is to observe the environment and send messages to the logic center. Sensors cannot sense everything, but the only thing they are planned to observe like: movement, heat, light, darkness, voice etc. Examples about organic sensors are: eye, ear, nose, and skins ability to sense cold and warm. Examples about artificial sensors are radars, and sensors for movent, heat, light etc.
Logic has to decide the funtionality based on the sensors observation and available contermeasures. Logic can be seen as software, which guides the robot’s functionality.
Actor is responsible about the functionality of the robot. Countermeasures against observed thing or event can be moving, stopping, firing and hitting. Whatever the robots task is.