Temple worship, Group worship is not mentioned in the Vedas,the Authority in Hinduism.
Yet one finds a lot of temples in India.
And , despite the Vedas mentioning the Reality as Abstract,A Principle beyond thoughts, Space and Time,we find a multitude of God’s and Goddesses being worshipped.
There is no contradiction in this.
Vedas call Reality Brahman as Beyond Name and Form,it also realised the limitation of Human Nature.
Humans are limited by mind,space and time while Brahman transcends these.
There is no point in imparting a system if it can not be followed or practiced.
The worship of Reality as Brahman as a Principle beyond Attributes is called Nirguna Aradhana.
The processes through which one can Realize Brahman are through,
Mind being limited,logic being a double edged sword which contradicts one conclusion while affirming it, emotions are more effective.
It is a fact that despite our assertion we are rational ,we are ruled by the heart, emotions.
So Hinduism provides four avenues to Realize Brahman.
Gnana Yoga,Path of Knowledge,
Karma Yoga,Path of Action,
Raja Yoga,Path of physical discipline that leads to Sprititual Awakening.
Bhakti yoga,Path of Devotion.
Gnana and Karma Yoga belong to the mental approach.
Raja Yoga ,the Physical approach and Bhakti,the Emotional Approach.
So the Vedas provide a source for emotional approach for self Realisation through Bhakti yoga.
This Emotional Approach was found in Yoga Sutras of Patanjali as Iswara Pranidhana.
The idea of Personal God,Iswara.
This along with the Agama provided the source for Bhakti.
The date of Agama is hard to fix.
Sage Viswamitra banished his sons to Dravida Desa.
Their descendant Apasthamba codified Vedas,incorporating some best practices of Tamils and formed the Apasthamba Sutra.
This sutra is followed by the majority south of Vindhya mountains.
It might be that Agama came later to this.
We have Bodhayana Treatise on Agama.
One finds a vast difference between South and North Indian temples in temple construction.
The South Indian temples are huge and intricate and Tamil kings right from Mahabharata period have constructed temples.
The designs of Dravidian temples are different and more elaborate.
The Shiva cult is more more in the South.
While the reference to Shiva limited in Vedas,Tamil abounds in Shiva reference and Shiva is attributed to have founded the Tamil language with his son Murugan,Subrahmanyam.
Shiva is considered to be the first Yogi,Adi Yogi.
One of his disciples Patanjali wrote the Yoga sutra,the first step of Vaasi Yoga of Shiva.
So the Agama tradition was followed in South much earlier.
And it is from Dravida Desa the Temple architecture spread to Far east, including at Angkor vat.
There are four systems in Agama.
Shiva,Shakti,Panchatantra and Vaikanasa.
The last two are for Vishnu Worship,Shiva for Shiva and Shakti for Devi Worship.