In this paper, we present TOTA (“Tuples On The Air”), a novel middleware to coordinate the movements of a large number of autonomous components (i.e. agents) in a ubiquitous computing scenario. The key idea in TOTA is to rely on spatially distributed tuples for both representing contextual information and supporting uncoupled and adaptive interactions between application components. The TOTA middleware takes care both of propagating tuples across a network on the basis of application-specific rules and of adaptively re-shaping the resulting distributed structures accordingly to changes in the network structures. Application agents – via a simple API – can locally sense such distributed structures to achieve context-awareness and to effectively coordinate their movements.