Day 33 of building DocuPulse AI. Two people ask the same question differently: "What's the confid...Day 33 of building DocuPulse AI. Two people ask the same question differently: "What's the confid...
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started
Day 33 of building DocuPulse AI.
Two people ask the same question differently: "What's the confidentiality period?" and "How long do confidentiality obligations last?" Same answer. But to a computer they're different strings — so a normal cache treats them as different questions and pays the AI to answer twice.
Today I built a cache that works on meaning instead of text. It turns each question into the same kind of "meaning fingerprint" I use to search the contract, and checks whether a semantically-similar question was already answered. If so: instant answer, zero AI cost.
The entire difficulty is one number: how similar is "similar enough"? I didn't guess it — I measured. Real paraphrases of the same question sat around 0.2 apart. Genuinely different questions sat around 0.76 apart. Wide gap, so I set the cutoff at 0.35 — comfortably catching the paraphrases, comfortably rejecting the different ones.
Then I tested the failure that actually matters: I asked about termination, then about confidentiality — two different things that could sound related. The cache correctly refused to match them. Because in legal software, a cache that serves a slightly wrong answer confidently is far more dangerous than one that occasionally pays for an answer twice.
Set the cutoff too loose and you're fast but wrong. Too tight and you're safe but wasteful. When the wrong answer is the catastrophic one, you err toward safe. Every time.
#AIEngineering #Laravel #BackendEngineering #BuildInPublic
Back to feed
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started