The KGB was the state intelligence service and a sort of federal police force. Kind of like the FBI and the CIA rolled onto one. Most of them were just concerned with normal police; work pretty much like the FBI. They also ran the spying networks in other countries; and attempted to manipulate the domestic affairs in different countries, much like the CIA.
But there was also what was originally called the “Counter-Revolutionary Activities” department which was the scary one. But it was not a racist. You didn’t want to be arrested by the them. But it made little difference whether you were black or white.
Anyway it isn’t as if the US state security forces didn’t commit the same kinds of crimes.
But neither of them were the same as the KKK.
Hope that clears it up for you.
By the way: The KGB no longer exists.