To make the knish dough, combine the flour, baking powder, and salt in a large bowl. In another medium bowl, whisk together the melted butter, water, and vinegar. Make a well in the center of the dry ingredients and pour in the beaten egg and wet ingredients. Using a spatula or wooden spoon, gently stir the mixture together until it starts to form a loose dough.

Pour the dough out onto a floured surface and knead it a couple times until the dough comes together (don’t over-knead it or your dough will be tough). Place the dough in a clean bowl, cover with a clean kitchen towel and let rest for at least one hour at room temperature. You can also make this dough ahead of time, cover the bowl with plastic wrap, and let rest overnight in the refrigerator.

While the dough is resting, make the knish filling: Melt the butter in a large heavy-bottomed skillet over medium heat. Add the onions, salt and pepper and stir to combine. Reduce the heat to medium low, cover the pan, and let the onions slowly cook, stirring occasionally until they begin to turn translucent and begin to breakdown, about 15 to 20 minutes. Uncover the onions and stir in the teaspoon of sugar. Continue to cook on medium-low heat, stirring occasionally, until the onion is caramelized and has turned golden brown, about another 15 to 20 minutes.

Stir in the leeks and 1/4 cup water into the caramelized onion mixture, cover, and continue to cook over medium-low heat until the leeks are soft, about 10 to 15 minutes. Remove the onion and leek mixture from the stove and set aside.

While the onions and leeks are cooking, cook the potatoes. Place peeled potatoes in a medium saucepan and cover with cold water. Bring to a boil over medium-high heat and cook the potatoes until tender, about 20 minutes. Drain the cooked potatoes well.

In a large bowl, mash together the cooked potatoes, reserved onion and leek mixture, cream cheese, chives, and the Parmiaigno-Reggiano until combined (I like a more rustic, chunkier filling, but if you want a smoother filling, you can use put the potatoes through a ricer before combining with the other ingredients). Season with salt and pepper to taste.

Preheat the oven to 350° F while you assemble the knishes. To assemble: Divide the dough in half. On a well-floured surface, shape half the dough into a rectangle and roll out into a very thin sheet. It should end up being about roughly about 18 x 8 inches.

With the long side of the rectangle facing you, create about a 1 1/2- to 2-inch thick log from half of your potato and onion mixture on the bottom of the dough. Roll the filling up in the dough, creating a long log, making sure not to roll it too tight—a little slack will help your knish not burst open when baking. You should be able to roll it about 2 to 3 times (this will result in delectably flaky layers in the finished product).

Using your finger, make indentations across the log every 2 1/2 inches. Gently twist the dough at each indentation (the log will resemble links of sausage). With a sharp knife or dough cutter, cut the dough at each twist.

To form the knish, take one of the cut segments, pinch closed the twisted ends, place one of the twisted ends down, and gently flatten the knish into a squat round. Pinch the top closed and make a small indentation in the center of the knish—another way to prevent them from breaking open in the oven. Repeat with the remaining cut segments, placing the finished knishes on a parchment-lined baking sheet about 1 inch apart.

Repeat the rolling and assembling process with the remaining half of the dough and filling. You should end up with about 12 to 16 small knishes.

For the everything bagel topping, mix together the sesame seeds, poppy seeds, caraway seeds and dried onion flakes in a small bowl. In another small bowl, whisk together the egg and the remaining teaspoon of water. Brush the top of each knish with the egg wash and sprinkle with the everything bagel mixture.