PrincipleChatbots have own base of knowledge.In simple view there are set of users questions and program's answers.There some ways:Reaction on key words.Match phrase.Math sense.