Add the herbs, garlic, Parmesan, cashews and olive oil in a blender or in a pestle and mortar. Beat everything until you get a uniform and very green paste.
Cook the spaghetti, drain the water and add the pesto. Mix well and add some of the cooking water.