In an agent-mediated distributed knowledge management system, knowledge is firstly produced and then delivered to a person or community of users that is interested in it. A common issue to this aim is the setting-up of communities that can drive the delivery of contents. In our study, knowledge-producing agents are arranged into separate interaction domains and a distributed interaction protocol is used to consolidate knowledge that is generated therein. Knowledge produced in this way can be used as the source data to dynamically build user communities that drive the delivery of knowledge amongst users. The multi-agent architecture presented here can be applied to the shared creation of various electronic resources, like learning objects, e-books or software artifacts.