In the wild, shrimp are a delicious and common food source for lots of fish and other aquatic dwelling creatures, just as in your fish tank they can also be seen as a tasty snack by predatory inhabitants.
For this reason, its important to select the correct right tank mates for your community tank.
The general rule of thumb is, if a fish is able fit a RCS in its mouth, then said shrimp is likely to become a tasty meal for the fish, who may also harass a shrimp until it dies from being stressed and again becoming a tasty morsel for someone.
A Few Options
A lot of the algae eating fish can be compatible with RCS with smaller non-aggressive species, such as danio, corydoras, otocinclus catfish and snails being best and a recommended choices.
There are other fish sometimes considered an option for large, adult RCS, such as pleco, cardinal tetra, guppy, harlequin rasbora, dwarf catfish, dwarf gourami, celestial pearl danio, flame tetra, boraras, minnow, dwarf pencilfish, forktail blue-eye fish and a few species of killifish, but al of these can be potentially hazardous, particularly to your shrimp babies as they are likely to be seen as food by fish other than the otocinclus and a few other herbivorous fish.
If your going to mix shrimp with questionable fish in your community tank, it is essential to provide plenty of hiding places such as live plants, chollo wood, rocks and shrimp caves. That way you give your shrimp colony the best possible chance of cohabitating long time with their finny friends.
It goes without saying that your shrimp should be kept away from any larger or predatory fish.
Gourami, oscar, cichlid, discus, angelfish, arowana fish as well as many species not mentioned here as friendly will inevitably be bad choice for your shrimp tank buddies, so avoid the temptation to mix them together.
And remember, if breeding shrimp is your intention, do this in isolation to your fish, for best results.