Mix all the dough ingredients well in a bowl, then set aside covered with plastic wrap for 30 minutes.
Caramelized onion filling:
Fry the onions over low heat while stirring until caramelized, about 10 minutes.
Combine all the ingredients in a food processor and grind.
Lemon ricotta filling:
Mix all the ingredients in a bowl.
Prepare the pasta:
Divide the rested dough into two portions. Roll out each portion separately using a pasta machine or a rolling pin. Aim for thin sheets, about 1/16 of an inch thick.
Lay one pasta sheet on a lightly floured surface or on a parchment paper-covered tray. Use a teaspoon to place small mounds of filling, leaving space between each mound.
Brush egg wash around the mounds of filling. Carefully lay the second pasta sheet over the first, pressing gently around the fillings to seal and remove air bubbles.
Use a ravioli cutter or a sharp knife to cut out individual ravioli squares or circles. Press around the edges to ensure they are properly sealed.
Cook the ravioli:
Bring a small pot of salted water to a boil. Gently add the ravioli and cook for about 3-4 minutes or until they float to the surface. Remove with a slotted spoon.
Warm up a skillet with butter. Add the ravioli, sprinkle the sage leaves and cook while stirring for 3 minutes.