In Mahayana, Vacchagotta (also known as Shrenika, Srenika or Seniya The Wanderer) is considered an important character, in conversations with whom Buddha illustrates the main principle of Madhyamaka - emptiness of all mental constructs, liberation by wisdom that comes from careful analysis of dharmas, direct vision into nature of things beyond either existence no nonexistence. The idea here is that the Truth lies beyond such simplistic categories, and to be in touch with Truth we must cease our tendency to cling to flat/singlesided explanations. In my own words, reality is complex, "quantum", "multidimmensional", and our habitual attempts to "flatten" it constantly lead to failed expectations and to suffering. Enlightened mind can see reality as it is, unhindered by conceptual limitations, and so always stays in touch with "tatha" - the way things really are.
In Pali Canon, Vacchagotta is mentioned in a number of suttas, all going around similar topics, e.g.:
In Chinese Agamas, there is one long sutra known as SA 105 Discourse to Seniya that collects these ideas in single place.
Here I will paste explanation of Shrenika's role Eduard Conze gave in his introduction to The Large Sutra On Perfect Wisdom, commenting on the following verse in Ratnagunasamcayagatha:
As venerable Shrenika the wandering beggar,
Understanding acquired, without grasping the skandhas,
Just so a bodhisattva, intuits real nature of things (dharmas).
And does not seek cessation but abides in wisdom.
Srenika the Wanderer is, according to Nagarjuna, the Srenika Vatsagotra, who in the Pali texts is simply called Vacchagotta. A number of his conversations with the Buddha are recorded. They are scattered through the Pali Canon, but combined into one section in the Samyuktagama of the Sarvastivadins. The text refers here to a Sutra which, according to Nagarjuna, discussed “Srenika the Believer” and at the same time, according to the Vibhasha and Nagarjuna, preached the emptiness of all dharmas. Since Subhuti’s argument is difficult (here Conze refers to Chapter 8 of The Large Sutra On Perfect Wisdom, "How the irreversible Bodhisattva views things" - which is a fascinating read in itself -- AV), and since we are inclined to lean on signs, and do not see how we can have faith without a sign, “Subhuti here takes as his witness the Little Vehicle where it speaks of the emptiness of dharmas, How could those who practice the great vehicle not believe in it?”
Srenika showed “faith”, first, in that he believed that the Buddha could help him to find the path, and, second, in that he was willing to accept the Tathagata in spite of the fact that he could not be related to any of the skandhas, i.e. to form, etc. He entered into a “cognition with a limited scope” which, according to Haribhadra means that it was directed to the absence of a self in persons, and not also in dharmas). Srenika was concerned to find a true self, in other words, the Tathagata. Nagarjuna relates that Srenika originally took the person as one lump, and that therefore the Buddha asked him about its elements. He had also heard people speak of the “I” in two ways, as identical with the five skandhas, and as different from them. The skandhas are multiple, and the I is one – so they cannot be identical. The self would be born and perish as the skandhas do, and it would not be independent of causes and conditions – thus it would not be the true self. Therefore, how can something outside the five skandhas have the character of “I” or “self”? As Nagarjuna puts it, “Srenika’s second act of faith consisted in that, when he had heard that the Buddha denied the self, and said that from the beginning there was none, he accepted the fact that, because there is no self, the dharmas have no support, and are like a dream, a mirage, nonapprehensible. Having obtained power of faith, he entered into the true mark of dharmas, and did not mistake form for the Tathagata”
Srenika “did not take hold of form, etc.” The Buddha asked him: “Do you regard the Tathagata as form?” “No.” “As in form?” “No.” “As outside form?” “No.” “As the absence of form?” “No.” “When, under all these aspects, you do not see the Tathagata, should you doubt, and say: What is there fixed and definite in the Buddhas’ doctrine?” “No.” Srenika then won the path, and became an Arhat. This is how Nagarjuna recounts the Sutra.
Here's a quote from Chapter 8 of The Large Sutra On Perfect Wisdom:
Moreover, a Bodhisattva who courses in perfect wisdom should
not stand in form, etc. to: in decay and death. And why? Because
form is empty of form. What is the emptiness of form, that is not form;
nor is emptiness other than form; the very form is emptiness and the
very emptiness is form. And so for the other skandhas. By this method
a Bodhisattva who courses in perfect wisdom should not stand in form,
etc. to: consciousness. And the same method should be applied to the
If, when this perfection of wisdom is thus being taught and explained
through these modes, tokens and signs, the thought of a Bodhisattva
does not become cowed, stolid or regretful, and his mind does not tremble,
is not frightened or terrified, then certainly that Bodhisattva,
that great being, should be known as standing on the level of an irreversible
Bodhisattva — by way of not taking his stand anywhere.
For even more information, this whole topic of relationship between "world" and "mind" is expounded/elaborated in one of the most important of Mahayana's sutras, Lankavatara Sutra.