So I am assuming the brakes on your bike are Grimeca/AJP? I have had these issues as well. All of the suggestions so far are good, but I have not seen anyone talk about the brake master cylinder piston. This turned out to be the problem with mine, and several other bikes I have worked on. Of course, it could also be in your caliper, but it's easier to start with an examination of your master cylinder piston first.
You can lean the bike against your work bench on a slight angle, with the brake side out. Then take off your lever and then remove the c-clip that holds your piston in the cylinder bore. You should not lose too much brake fluid this way. Then take a magnifying glass (I have a 10x photo loupe) and look at the piston seals. With wear, the seals develop tiny tears, worn away spots... the are easily visible, and you will mainly see them on the inner cup seal. These micro-tears result in an imperfect seal, leading to the inconsistent braking. If the seals are damaged, replace the piston (the kit is sold as a piston and seals).
If there are no tears, you can try putting some silicone grease on the seals, as they may be sticking in the bore. I have had to do that on some bikes as well. Once you have the brake back together, right the bike and do a quick bleed, just to top up the reservoir and make sure there is no air in the system.
If none of these suggestions work, it may be time to split the caliper and change the seals in the caliper. This is not a bad job, but ruling out the master cylinder first will save a lot of time.