In my perspective, we are inside a realm where we are servants, underdogs, slaves, puppets, whatever you name it, to a hierarchical cosmic system. The chosen terminology is not relevant. The material world is some sort of sandbox. A prison to shape your (originally indomitable) soul, so we are trained, after countless incarnations, to become gradually more obedient, domesticated, tamed, jaded, compliant. So we can get comfortable with being controlled by external circumstances, never being ensured of anything, while constantly sacrificing everything. So we get used to slowly dissolve into collective thought-forms and eventually let go of our ancient memory that contains the story of what actually happened to us. You could deduce this by observing reality's mechanisms. None of this is set to make your way any easier if your interests are not aligned with the hive. If you are, the process gets incredibly simpler. Just let your individuality go and blend in.
There is an inherent purpose for the creation of this world and the cosmos around us. It is a representation of the creator's mind and we cannot scrutinize it sufficiently, because we are set to be inferior, limited and inside it's reflection. Which already tells us a lot. We can only see the effects of an (almost) inscrutable cause. We are never quite adapted to the contingencies, of course, because we are conscious rational beings, exceptions to the nature around us, so we perceive the flaws, the disparities, the unbearable imbalance between Will and the fabricated reality.
This points to the inference that we might have originated elsewhere, so we were trapped and modified, not created. Human consciousness is an anomaly compared to this universe. Humans can be ethically superior to the phenomena around them (the material universe has no space for mercy, pondering, charity, love, etc.), so, if the cosmos is a representation of the creator's will, we are also potentially ethically superior to the creator itself, who've created abhorrent mechanisms to ensure the maintenance of it's own system (incarnation and reincarnation are good examples of it, along with pain, suffering and sorrow). All myths (I know) revolving the creation of the universe eventually stumbles upon some sort of tragic mistake, error or misleading process that made us descend into this place. All of the good aspects of this world are reflections of our own virtues. Other creatures cannot appreciate the beauty of this world. Only rational minds could do so, only minds of a creator could do so. Even our depiction of a gracious God, a heaven, a plethora of benevolent angels: merely the reflection of our own virtue and ethical superiority to the creation and the creator itself. A glimpse of our own nature, in contrast with the external nature of matter, collective behavior and expected human endeavors (working, building civilization, surviving, etc.).
So, our purpose? I guess it is entirely based on choice, although the rule set doesn't collaborate with us any more than to make us increasingly weaker and subservient. So you could go with the flow and get finally assimilated, forgetting all about who you actually are, to let your ego die along with your autonomy and serve the game, or you could reverse engineer your way out of it solo. Magic is one of the ways you can do both types of alchemy. To accelerate your process of dissolution, which is the expected, easier path. Or to escape the cosmic process, or to take your revenge against it, or to transcend the whole process as an individual being. Or other processes I'm not familiar with.