Preheat oven to 375°. Carefully pick over beans and rinse. Place in medium saucepan and add enough cold water to cover by 1 inch. Bring to a boil over high heat and boil rapidly for 1 minute. Remove from heat and let beans sit for 1 hour.
Put star anise in a small saucepan with 1 cup water, bring to the boil, and reduce liquid by half. Remove from heat and set aside. Meanwhile spread pumpkin seeds evenly on a baking sheet. Bake until lightly toasted, about 10 minutes. Let cool completely. Place pumpkin seeds in a food processor fitted with steel blade. Pulse for 3 minutes. The seeds will break up but bits of hull will still be visible. Do not overprocess, or they will become pasty.
Working in small batches, place the pumpkin seeds in a medium-mesh sieve over a bowl and shake the fine particles through. After each batch, pour a cup of water through the sieve to rinse as much as possible. Discard fibrous residue. Pour strained liquid into a pitcher. Any bits of hull will then rise to the top and can easily be skimmed off. Add strained liquid to semi-cooked beans.
Heat a griddle or small cast-iron skillet over medium-high heat. Rinse the chiles under cold running water, then dry roast them on the griddle, letting them cook for about 15 seconds on each side. Do not let them scorch, cook just until the aroma is released. Puree the chiles in food processor or blender with 1 cup chicken stock.
Add the puree to the beans and pumpkin seed liquid. Add dried shrimp, onion, epazote, anise infusion, and remaining chicken stock. Bring to a boil over high heat. Adjust seasonings. Reduce heat and simmer uncovered for 45 minutes or until beans are thoroughly cooked.