Abstract: Context-aware systems exploit the use of situational information, or context, to provide relevant information and services to users. A great challenge remains in defining an architecture that supports context-aware systems. Critical research issues include modeling and reasoning (how to represent contextual information for machine processing and reasoning), knowledge sharing (how to enable agents to acquire consistent knowledge from unreliable sensors and agents), and user privacy protection (how to give users control of their private information that the system acquires). To address these issues, I developed a new agent architecture called the Context Broker Architecture (CoBrA). It uses the Web Ontology Language OWL to define ontologies for context representation and modeling, defines rule-based logical inference for context reasoning and knowledge maintenance, and provides a policy language for users to control the sharing of their private information. Central to CoBrA is a server agent called context broker. Its role is to maintain a consistent model of context that can be shared by all computing entities in the space and to enforce the user-defined policies for privacy protection. The major research contributions of this work include a broker-centric architecture for supporting context-aware systems, a standard pervasive computing ontology, a reasoning approach that integrates assumption-based reasoning and argumentation for resolving inconsistent contextual knowledge, and a privacy protection mechanism that exploits information granularity adjustment. To demonstrate the feasibility of CoBrA, I prototyped a context broker in the FIPA platform using the JADE API library. I showed its use in supporting EasyMeeting, a smart meeting room system that provides context-aware services for assisting speakers and audiences. Other contributions include the CoBrA Demo Toolkit (an open source software package for demonstrating various aspects of CoBrA) and the CoBrA Text Messaging Commands (a text messaging interface for mobile users to interact with a context broker via SMS messages). The lessons learned from this research are as the follows. (i) CoBrA's broker-centric design can help to reduce the time and effort to rapidly prototype context-aware applications. (ii) Ontologies expressed using the OWL language can provide a uniformed solution for context representation and reasoning, knowledge sharing, and meta-language definitions. (iii) Rule-based logical inference can help to develop flexible context-aware systems by separating high-level context reasoning from low-level system behaviors.