Louis Finkelstein argues that the synagogue has its origins in early prophetic institutions predating the exile.
Louis Finkelstein, "The Origin of the Bible," in The Synagogue: Studies in Origins, Archaeology and Architecture, ed. Joseph Gutmann (New York: Ktav Publishing House, Inc., 1975), 3–13
. . .
The various considerations that have been discussed, the evidence that prophetic gatherings took place in early biblical times on sabbaths and new moons, the implication in the "prayer of Solomon" at the dedication of the Temple that regular prayer meetings were established in its day, the a priori assumption to the same effect necessary to explain the historical events of the reigns of Manasseh and Josiah, and finally the history of the word midrash, seems sufficient to establish our thesis: first, that there were prayer gatherings under prophetic guidance even before the fall of Jerusalem in 586 B.C., and second, that out of these gatherings there grew imperceptibly the more definitely institutionalized synagogues that played so important a role in the Maccabean age.