The RETE algorithm is a very efficient option for the development of a rule-based system, but it supports only boolean, first order logic. Many real-world contexts, instead, require some degree of vagueness or uncertainty to be handled in a robust and efficient manner, imposing a trade-off between the number of rules and the cases that can be handled with sufficient accuracy. Thus, in the first part of the paper, an extension of RETE networks is proposed, capable of handling a more general inferential process, which actually includes several types of schemes for reasoning with imperfect information. In particular, the architecture depends on a number of configuration parameters which could be set by the user, individually or as a whole for the entire rule base. The second part, then, shows how an appropriate combination of parameters can be used to emulate some of the most common, specialized engines: 3-valued logic, classical certainty factors, fuzzy, many-valued logic and Bayesian ne...