Cook your pasta according to packet instructions. When the pasta is cooked, drain and set aside. Reserve about 1 cup of pasta water.
While the pasta is cooking, heat oil in a saucepan and then cook the onion until lightly browned and softened.
Next, add the minced garlic and cook for a further 1 to 2 minutes.
Mix through the stock. Then bring the liquid to a gentle simmer and season with salt and pepper.
Reduce the heat to low medium. Add the cooked and drained pasta, pesto, and ricotta cheese. Break up the ricotta cheese if necessary. Then, taste for seasoning and adjust as desired. (see note 1).
Turn off heat. Serve, garnished with finely chopped green onions, grated Parmesan cheese and roughly chopped pine nuts (or cashews).