I have heard about homes being built with gray water systems, meaning water form laundry, dish washing, and shpwering is sent to a cistern, then used for watering the garden.
Since this water has been used, already, it carries with it many substances that aren't fit for human consumption.
How is it purified before it is used as water for vegetables you plan to eat later?