The Pennyworth Project

Just another WordPress site

Genkanban, the context-sensing application for MacOS X

As I mentioned in my previous post, I am currently creating a context-sensing application for the Mac that will serve as the basis of my research into other context-aware applications. At the moment, that application is Genkanban.

According to my Japanese-English dictionary, the word genkanban is the closest Japanese equivalent to the English word concierge. Like a hotel concierge, Genkanban’s purpose is to watch and learn from you so that it can relay it’s nuanced understanding of your context to other parties that perform actions for you. In this case, Genkanban quietly runs on your computer, observing you. When your context changes (such as a task switch), Genkanban detects the change, calculates your new context, and relays that information on to other applications. For example, if I am switch from programming to writing, Genkanban can instruct iTunes to play something a bit more mellow and update my IM client’s status message accordingly.


Before I go any further describing the application, let me first define what I mean by context. The concept of context is easily understood, but sometimes difficult to define concretely. My own understanding of context is informed by the following definitions:

“By context, we mean environmental information that is part of an application’s operating environment and that can be sensed by the application.” Anid K. Dey (The Context Toolkit)

“Context-aware computing promises applications that sense an environment, model situations, and act appropriately.” James Fogarty (Subtle Toolkit)

“The circumstances that form the setting for an event and in terms of which it can be fully understood and assessed.” New Oxford American Dictionary

When Genkanban senses context, it is trying to identify a particular model of the world that surrounds a particular situation. Context is the evidence, and the situation is the conclusion. However, situation can be a complex item in itself, and to maintain my sanity, Genkanban predicts the location, activity, and social context properties of the current situation.

Returning to the application itself, it began life as a Mac implementation of the ideas expressed in James Fogarty’s Subtle Toolkit. At the core of Subtle is a machine learner that receives information from observers, and labels from its user. The machine learner treats the information from observers as features and the label as a classification. Using a collection of features and classifications, the machine learner constructs a model that can predict classifications from unlabeled lists of features. (For more information about the underlying idea behind classification, see the Wikipedia article on statistical classification.)


To train the machine learner, Genkanban implements a simple user interface that can be invoked as needed (the current prediction is incorrect) or on a fixed interval (“ask me about my context every X minutes”). This small interface collects labels and submits them to the learner to refine the learner’s mode. Users are not limited to a fixed set of labels, and can add new labels as needed.

Training Interface

Genkanban also adds some important functionality to basic ideas expressed in Subtle. Subtle used a relatively constrained interprocess communication (IPC) model where applications could synchronously query the user’s context using XML-RPC calls to a service running on the user’s local machine. Genkanban implements an asynchronous broadcast scheme where it automatically broadcasts a distributed notification of context changes that any application can listen to and adjust itself accordingly. (I’m using MacOS X’s NSDistributedNotification mechanism to accomplish this.) This approach eliminates any need for an application to poll for context, but applications using this IPC method still must be compiled to listen to for the notifications.

Genkanban also implements an action-oriented approach to disseminating context. Using the built-in AppleScript functionality, users can define actions as AppleScript files that are executed when the system predicts a new context. This is crucial for making third-party applications context-aware. The screenshot below illustrates a script that is used to set the status message of the Adium IM client when the local user’s activity changes. Genkanban ships with similar scripts for controlling other applications. These scripts are intended to be used as is, or as starting points for users wishing to customize the scripts for their own environment.

AppleScript Action

Like Subtle, Genkanban includes sensors that can observe various aspects of the local user’s environment. These sensors include wireless network detection, running applications, open websites, connected devices (USB and Bluetooth), and application-specific sensors such as current chat partner or current calendar event. Genkanban also extends this basic model by allowing other applications to contribute observations using the distributed notification approach. Currently, a Caller-ID application (Cidney, to be discussed in a future post) tells Genkanban when the phone is in use. A home automation application (Shion) tells Genkanban when local lights and appliances have been switched on or off. Finally, Genkanban implements an AppleScript interface where users can write their own sensors as scripts and use these custom sensors just as if they were compiled into the application.

Finally, the last major feature of Genkanban is its logging abilities. Since this is a research project for me, I need to collect information about its users to determine how it’s being used, if it’s accurate, and so on. Genkanban can be configured to log snapshots of the current environment at set intervals. (This functionality is disabled by default.) A logged snapshot consists of all of the observations at that point in time, the active predictions at that time, and an optional screenshot. For privacy purposes, users can elect to delete specific logs or disable logging for a fixed period of time.


This concludes the discussion about what Genkanban is. In a future post, I’ll describe how to use it.

Posted by admin at 11:28 am on January 27, 2008 . Filed under Pennyworth.


  1. But no code? You are an utter tease!

    (But it was interesting anyway :))


    Comment by Ricky Buchanan — January 28, 2008 @ 8:25 am

  2. I’ll post some soon. I need to do some documenting first. However, that’s coming soon.

    Comment by Chris J. Karr — January 28, 2008 @ 8:58 am

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.