Bring a large pot of water to a boil over high heat. Add the sago or tapioca pearls and stir occasionally to prevent sticking. Reduce the heat to medium and simmer for twenty minutes. Turn off the heat, cover the pot, and let the pearls sit for ten minutes. Drain and rinse the pearls under cold water. Set aside.
In another pot, combine two cups of water, palm sugar, agar-agar powder, and salt. Bring to a boil over medium heat, stirring frequently until the sugar and agar-agar dissolve.
Once dissolved, divide the mixture evenly into two bowls. Add pandan extract to one bowl and ube extract to the other. Allow the mixtures to cool slightly, then refrigerate until firm.
Once set, cut the jelly into small cubes.
For the arnibal syrup, bring three cups of water and pandan leaves to a boil over medium heat. Add palm sugar and vanilla, and stir until completely dissolved. Remove from heat and discard the pandan leaves. Llet the syrup cool to room temperature.
To assemble, place some of the ice at the bottom of each glass. Layer the sago or tapioca pearls over the ice. Add chopped grass jelly if using. Pour the arnibal syrup over the pearls, then top with ice. Add the pandan and ube jelly cubes. Serve immediately.