The problem
Same question — clearly different answers
Unchecked assumptions create drift — even for an identical prompt. 320 m of profiles in one answer, 350 m in the other.
320 m
350 m
The solution
Message loop: RAG, LLM, forms and functions
The loop finds the function, emits only missing fields as a FormSpec, and lets a deterministic function do the math.
The AI understands and explains — the function calculates exactly.
Our implementation
Chat picks the calculator
An open request becomes a concrete calculation. Two paths: wall dimensions or area.
The form asks only what is needed
Field type, unit and default come from the function schema. Required fields and ranges block incomplete input.
The function returns the result
Same inputs yield the same value. Parameters and result stay in the chat context.
Technical flow
From user text to an exact result
- User
- Chat UI
- Message Loop
- AI RAG · MCP · LLM
- Calculation function
- RequestUser
- ForwardChat UI
- Find function + contextAI
- Function + missing valuesAI
- Missing values → generate FormSpecMessage Loop
- FormSpecChat UI
- FormChat UI
- Enter valuesUser
- Calculate validated parametersCalculation function
- Exact resultCalculation function
- Result in contextMessage Loop
- ReplyChat UI
59 boards · 320 m profiles
59 boards
320 m profiles
Free-form LLM answers are guesses
Fewer follow-up questions
Dynamic instead of hard-wired
Only the parameters that matter
Traceable in the chat context
Reproducible quantities