What are the most important components in the algorithm of a minimum AI? If someone wants to develop a basic AI with some code modules,Let us say the AI just has to provide an action when stimulated in a certain situation based on its previous understanding of situations. 

I can think of at least 3 of such components:


Real-time Understanding/Learning: Using Deep Learning/ConvNets, Supervised/Unsupervised.
Logical Decision-Making: Calculating the results of various decisions when applied on current situation based on previous understanding and choosing the most appropriate one logically.
Action/Reaction: Acting precisely in the new situation according to the decision-made.


Any ideas?
Some good places to start would be cognitive architectures and as mentioned in another answer intelligent agents. The question is broad but you definitely want to look into planning &amp; decision making. You might also want to check out the L5 and L6 layers of Hierarchical Temporal Memory (As in Nupic) as it relates to feedback, behavior and attention.

If I were you I'd aim for more cognitive solutions (I realize that term is a bit ambiguous itself when we talk about machines). There's also new AI initiative going on involving probabilistic programming. See Probabilistic Models of Cognition made by Goodman (Stanford University) and Tenenbaum (MIT) or Anglican made by Wood (University of Oxford) et al.