Advanced analysis of data for extracting useful knowledge is the next natural step in the world of ubiquitous computing. So far, most of the ubiquitous systems process knowledge in problem-specific or domain-specific manners. This article introduces the concept of context knowledge discovery process, and presents a middleware architecture which eases the task of ubiquitous computing developers, while supporting data mining and machine learning techniques. We show how the middleware architecture supports building ubiquitous systems which are able to “learn” and “think” by introducing some learning – reasoning combination mechanisms, such as the context recognition and prediction, or the deductive rule learning and reasoning process. 1