Rules-first design
Using AI to build and maintain a rules base from the law, then running the rules, not the AI, when someone asks: what the Minnesota DWI advisor posts show, and where the approach is weaker than the first post claimed
A topic page: a summary of what my posts say, with each claim quoted from the post it came from. The posts are the authority. Last checked 2026-11-06.
Summary. In a rules-first design, a model helps build a rules base from primary sources, and at question time ordinary code applies the rules. The model's only job is reading the person's words into facts. I tried this for a Minnesota DWI advisor, and two posts report how well it worked and how I tested it.
What the posts say
The pattern, in one sentence.
“use AI to build and maintain a rules base for one body of law, and run the rules, not the AI, when someone asks” — Azure Foundry Agent (Part 6)
Why it is attractive: speed, cost and traceability.
“In this case the answers are cheaper and faster, and each figure traces back to the section of the law it came from.” — Azure Foundry Agent (Part 6)
Where the model sits.
“At question time only the rules run.” — Azure Foundry Agent (Part 6)
A small model is enough, because the job is small.
“Because that job is small, the model can be small: qwen2.5:7b, running locally, with no frontier model anywhere.” — Azure Foundry Agent (Part 6)
Plain rules already read most messages.
“Rules alone, with no model at all, read 73% of 150 fresh messages exactly.” — Azure Foundry Agent (Part 6)
Little is left for the model to get wrong.
“Everything with a legal consequence is code, so there was little for the model to get wrong.” — Azure Foundry Agent (Part 7)
A perfect reader and the real small model scored the same on the 2,000 tests.
“With a perfect reader the advisor also passed all 2,000, and the real small model matched it.” — Azure Foundry Agent (Part 7)
Search engines do not rank a statute above a blog post; the rules base does.
“A search engine ranks pages. It does not rank a statute above a law firm's blog post, and our advisor does.” — Azure Foundry Agent (Part 7)
The posts behind this page
- Azure Foundry Agent (Part 6) — Rules from the statutes, a small model that only reads, and a side-by-side test against GPT, DeepSeek and Google on the same arrests
- Azure Foundry Agent (Part 7) — 2,000 simulated conversations for the Minnesota DWI advisor, six of them told as fireside chats, and the traps that GPT with search, GPT-5.5 and DeepSeek fall into that a rules base built from the statutes avoids