This paper proposes a definition of the knowledge base of an agent using only patent statistics. It then develops a model of a knowledge production function that can be estimated at the firm level and the sector level using the knowledge base matrix. It identifies the impact of own knowledge base, absorptive capacity to exploit intersectoral spillovers, and absorptive capacity to exploit intrasectoral spillovers, on new technology generation. It permits a study of the dynamics of knowledge generation without having to resort to additional information on the r&d activities of firms. Finally, the paper illustrates the method with the case study of new biotechnology-based knowledge creation by firms in the foods sector.