What algorithm can I use for a rule based system?
You don't need an algorithm.  Since you already have a set of rules, all you need to do is implement the rules.



The simplest implementation strategy is to simply re-evaluate all the rules each time something changes.  However, in some cases this might repeat work unnecessarily and there might be more efficient implement the rules.

For instance, if one of your rules is "IF the user has bought more than 1000 items today THEN sound an alarm", then re-evaluating this each time an item is bought might be unnecessarily inefficient.  A more efficient approach would be to keep a counter for each user that keeps track of how many items the user has bought today; each time an item is bought, increment the counter and sound an alarm if it is over 1000; and each midnight, reset all counters to zero.

So in some cases optimizations might be possible.  However, that is entirely depend on the specific of the rule, and there's not much we can say in general.  If you have a question about how to implement a specific rule efficiently, you can ask a new question specifically about that particular rule.