Case file · RAG / Legal
Swiss Tax AI is retrieval over Swiss federal and cantonal tax law. Ask a question and it returns an answer with citations back to the source provisions — never an unsourced assertion. Where a number is involved, it does not let the language model guess: it routes to deterministic calculators that compute the figure from the relevant rules, and the model only explains the result. Document extraction pulls the inputs out of uploaded paperwork so the question can be answered against the user's actual situation.
The split is deliberate. Language is good at finding and explaining the right rule; it is unreliable at arithmetic. So the model retrieves and narrates, and the code calculates.
Why it exists
Tax law is high-stakes, jurisdiction-dependent, and exactly the kind of domain where a confident-but-wrong answer is worse than none. It is the proving ground for a discipline I care about: an AI system that is allowed to be helpful only when it can show its sources and keep the arithmetic out of the model's hands.
Shape of the system
┌──────────────┐
│ question + │ user query, optional documents
│ documents │
└──────┬───────┘
▼
┌──────────────┐
│ extract │ pull figures from the paperwork
└──────┬───────┘
▼
┌──────────────┐ ┌──────────────────┐
│ retrieve │ ──▶ │ vector store │ fed + cantonal law
│ relevant law│ └──────────────────┘
└──────┬───────┘
▼
┌──────────────┐ ┌──────────────────┐
│ answer with │ ──▶ │ tax calculators │ deterministic,
│ citations │ │ (not the model) │ not guessed
└──────────────┘ └──────────────────┘
Three hard lessons
1. Numbers do not belong in the model. A language model that does tax arithmetic will be confidently wrong eventually. Routing every figure to a deterministic calculator is the single most important design decision.
2. A citation is a contract. The answer is only as trustworthy as the provision it points to. Retrieval quality, not generation quality, is what makes or breaks the system.
3. Cantonal variation is the real difficulty. Federal rules are tractable; the same question has twenty-six answers once you cross cantonal lines, and the retrieval layer has to know which one applies.
Stack