1. Chop the onion. Core, seed, and chop the bell peppers. Mince the garlic. Rinse, stem, and thinly slice the mushroom caps (reserve stems for soup).
2. Heat the olive oil in a medium-size heavy saucepan over medium heat. Add the onion and bell pepper; stir-fry for a minute just to get them going. Cover the pan and simmer over medium heat until the onion and pepper are tender, 8 to 10 minutes.
3. Meanwhile, in a large saucepan, mix the buckwheat with the egg (or egg whites if you are on a no-cholesterol diet) with clean hands until each grain is coated. If the grains clump together, break them up with your fingers.
4. When the onion and pepper are soft, add the garlic and mushrooms and sauté for 30 seconds. Cover and simmer for 5 minutes over medium heat, then add the caraway seeds and broth. Bring to a boil over medium heat.
5. Place the pan with the kasha over medium-high heat. With a wooden spoon, flatten, stir, and chop the egg-coated kasha until the egg has dried and the kernels are hot and mostly separate, 3 to 4 minutes.
6. Averting your face to avoid any splattering liquid, gently ladle the boiling liquid, mushrooms, and other solids into the kasha. Bring the liquid back to a simmer, cover the pan tightly, and simmer until tender, about 10 minutes.
7. Meanwhile cut the ham into ½-inch cubes and mince the dill for garnish, if using. Remove the kasha from the heat, stir in the ham, and let the dish stand covered for 10 minutes to heat the ham through without toughening it.
8. Season the dish well with salt and pepper. Top with sour cream and sprinkle with dill.
For a spicier version: Substitute ¾ pound chorizo for the ham. Thinly slice the chorizo and sauté in a small skillet until somewhat crisp, 3 to 4 minutes. After the kasha is cooked, fold in the chorizo when you would have the ham. This is wonderful with sour cream.