I built Reverbot, the iPhone app this is about. This post is about one feature, Job mode, and a retrieval problem anyone building "ask your documents" tools will hit.
Job mode is for work where your hands are busy. You upload your own manuals, SOPs, spec sheets and parts lists, each set in its own workspace. Then, through your earbuds, you ask: "hey job, what's the torque for an M10 grade 8.8 bolt?" The requirement is strict: the exact value from your sheet, or a plain "that isn't in your documents". A plausible guess is worse than no answer.
The first version did what most retrieval tutorials do. It cut each document into runs of sentences about 400 characters long, found the runs that best matched the question, and gave them to the AI to answer from.
That works for prose and fails for tables. A torque chart reached the AI as "M10,8.8,49", with the column headings three passages away. Nothing in the text the AI saw said which number was the torque. Size tables, drill charts and parts lists all failed the same way, and those are exactly the documents people look things up in.
A document is now read for its structure before it's cut up:
Nobody says "M10" out loud. They say "M ten", "three eighths", "quarter twenty" or "newton metres", and that's what speech recognition hears. The matcher converts between spoken and written forms, so a size said in words still finds the row written in digits. Numbers, sizes and part numbers count for more than other words when ranking passages: in a reference question, they're the part that has to match.
The search runs entirely on the phone, with no network call: keyword matching plus an on-device English sentence model for meaning. Other languages are matched by their words. The best passages go to the AI with the question, and the answer names the document it came from. If nothing relevant is found, it says so instead of answering from general knowledge.
An obvious reference question, one that carries a number, size, code or unit, or that matches a passage strongly, goes straight to the documents without an extra AI step to decide what kind of question it is. That saves a round trip when someone is waiting with a wrench in their hand.
After "what's the torque for M10?", the next question is often just "and M12?". On its own that matches almost nothing. So a follow-up is searched together with the question before it, and the AI sees both.
Reverbot is on the App Store for iPhone, and Job mode is turned on in Settings.
Written with help from an AI assistant.
原文来源:dev.to