The architecture of matching networks