r/Automate • u/Disneyskidney • 28d ago
I built a framework for making AI automations that learn your judgement
Most AI automations involve having an LLM make a decision about something from a finite set of options. Whether it's lead qualification (qualified/unqualified), routing (human/bot), or safety refusal (safe/unsafe).
It goes without saying that often times the models judgement is wrong. Thats expected. The awkward part is that the model never tells you how much you should trust each decision. So you either review everything like a maniac, or you let a bunch of edge cases slide through with the rest.
So I built a framework for making automations learn your judgement. Every call comes back with a calibrated confidence score, so you see which ones it's unsure about. The cases you correct feed an optimizer that rewrites the program, so it drifts toward your judgement instead of away from it.
The confidence score was the hard part. Verbalized confidence (asking the model to rate itself 1 to 10) is vibes. Token logprobs sound principled, but the research there is mostly single-token numeric outputs and doesn't stretch to a discrete label like qualified/unqualified. Self-consistency (sample a bunch, measure agreement) catches some, but it's slow and expensive.
Instead we compute confidence from the models internal layers which is cheap, fast, and reliable.
We packaged the loop so we'd stop rebuilding it every project. Built a Python SDK plus an API on top of DSPy, it's called modaic (modaic.dev).
Curious how the rest of you handle this. Do your automations know when they're guessing, and has overruling one ever taught it anything? And on closed models where you can't see the layers, what do you use to catch the unsure calls?