This paper investigates the process of knowledge exchange in inter-firm Research and Development (R&D) alliances by means of an agent-based model. Extant research has pointed out that firms select alliance partners considering both network-related and network-unrelated features (e.g., social capital versus complementary knowledge stocks). In our agent-based model, firms are located in a metric knowledge space. The interaction rules incorporate an exploration phase and a knowledge transfer phase, during which firms search for a new partner and then evaluate whether they can establish an alliance to exchange their knowledge stocks. The model parameters determining the overall system properties are the rate at which alliances form and dissolve and the agents' interaction radius. Next, we define a novel indicator of performance, based on the distance traveled by the firms in the knowledge space. Remarkably, we find that - depending on the alliance formation rate and the interaction radius - firms tend to cluster around one or more attractors in the knowledge space, whose position is an emergent property of the system. And, more importantly, we find that there exists an inverted U-shaped dependence of the network performance on both model parameters.