Recibo demo

Try it

An LLM can read the law and still pick the wrong field.

This agent asks what it needs, and a rules engine picks the value.

Measured on tax rulings it never saw

19 scenarios from 15 binding rulings of the Tax Authority (AT), issued 2024-01 to 2026-10, added after the prompt and the rules were frozen. The right answer is the one AT gave in the ruling. Each scenario ran 3 times per variant.

correct handed over no answer wrong

LLM + engine
41 of 57 correct 4 of 57 handed over 12 of 57 wrong
LLM + law
24 of 57 correct 18 of 57 handed over 15 of 57 wrong
LLM alone
15 of 57 correct 18 of 57 handed over 24 of 57 wrong
Armchatscorrecthanded overno answerwrongright when it answeredquestions per chat$ per chat
LLM + engine 57 414012 77% 1.4 $0.0014
LLM + law 57 2418015 62% 1.1 $0.0031
LLM alone 57 1518024 38% 1.1 $0.0014

A model alone is not something to build on. With the law in its prompt, it gave a wrong field in 15 of 57 chats; on its own, in 24. When it did give a value, it was right 62% and 38% of the time. A recibo field you have to check every time saves an accountant no work, and the ones nobody checks become trouble with AT.

The rules are not perfect, but they are clearly ahead. The engine was right 77% of the time it answered, and its 12 wrong chats come from 5 of the 19 scenarios, where a rule was missing: online teaching for a private client in another EU country, the art. 9 exemption for credit intermediaries, and a user who says they are under art. 53 after passing its limit. A missing rule is written once and stays fixed. The model's mistakes are spread over 8 and 12 scenarios, and change from one chat to the next.

On the cases the rules were built from

These 37 scenarios are rulings and cases that were already turned into rules, so this is not a fair test of the engine. It shows something else: once a ruling is a rule, the engine gets it right every time, with no drift from one chat to the next. The model, given the same law in its prompt, still gets them wrong.

Armchatscorrecthanded overno answerwrongright when it answeredquestions per chat$ per chat
LLM + engine 111 109200 100% 1.5 $0.0014
LLM + law 111 4626138 55% 1.2 $0.0033
LLM alone 111 3140040 44% 1.1 $0.0014

That is how the engine keeps up. AT publishes new rulings every month; each one that the rules miss is written in once, checked against these cases, and from then on is right in every chat. A model's mistakes cannot be fixed one at a time like that.

One example

simulated user

Faz-me uma fatura para a Fluent Languages: 250 € de explicações de português por videochamada em setembro.

Variant A: LLM + engine — correct

Para preencher os campos desta linha de fatura, preciso de saber:

  1. A sua empresa é uma sociedade (Lda, S.A., etc.) ou é trabalhador independente (cat. B)?
  2. Onde está sediada ou registada a atividade: no continente, nos Açores ou na Madeira?
  3. Está no regime normal de IVA ou no regime de isenção de pequenos retalhistas/prestadores (artigo 53.º do CIVA)?
  4. A Fluent Languages está sediada em Portugal, noutro Estado-Membro da UE ou fora da UE?
  5. Se estiver noutro Estado-Membro da UE, qual é o número de contribuinte IVA dela, com o prefixo do país?
simulated user

Somos uma sociedade (Lda) e estamos no regime normal de IVA. A atividade é no continente, em Lisboa.

A Fluent Languages está sediada em Portugal, noutro Estado-Membro da UE ou fora da UE? Se estiver noutro Estado-Membro da UE, indique também o número de contribuinte IVA dela, com o prefixo do país.

simulated user

A Fluent Languages está sediada na Irlanda, noutro Estado-Membro da UE. O número que me deram é tax number hidden · VIES: not registered, mas não é válido no VIES e não me enviaram outra prova de registo para IVA.

Answer: 23%, civa:18, civa:6:1, civa:6:6.b

Variant B: LLM + law — wrong

Não emito faturas: ajudo apenas a escolher os campos fiscais (taxa de IVA, código de isenção e retenção na fonte) para essa linha. Para o fazer, preciso de saber:

  1. A sua empresa ou atividade está em Portugal continental, nos Açores ou na Madeira?
  2. É uma sociedade (empresa) ou trabalha como trabalhador independente (recibos verdes)?
  3. Está enquadrado no regime de isenção de IVA para pequenos produtores (artigo 53.º do Código do IVA)?
  4. A Fluent Languages tem sede em Portugal ou noutro país? Se for noutro país, de que país se trata?
  5. Sabe se a Fluent Languages está obrigada a reter IRS (por exemplo, se é uma sociedade com contabilidade organizada, ou se é uma pessoa singular)?
simulated user

1. Sim, Rua Augusta 10, Lisboa, ou seja, Portugal continental. 2. É uma sociedade (empresa), não trabalhador independente. 3. Não, estamos no regime normal de IVA. 4. Fluent Languages é de Irlanda, e é um trabalhador independente irlandês (sole trader), não uma sociedade. 5. Não sei se estão obrigados a reter IRS; deve decidir o assistente.

Para decidir o IVA, preciso de mais dois dados:

  1. A Fluent Languages (sole trader irlandês) tem número de IVA irlandês e está registada para o IVA? Se tiver, indique-o para eu o verificar no VIES.
  2. As explicações destinam-se à atividade profissional dela, ou são para uso particular (por exemplo, para um aluno ou um familiar)?
simulated user

1. O número que tenho é o tax number hidden · VIES: not registered, mas já o verifiquei no VIES e não é válido. Não me enviaram outra prova de registo para o IVA. 2. Não sei para que uso as explicações. Só sei que são de português por videochamada, em setembro.

Answer: M44, Artigo 6.º, n.º 9, alínea i), do CIVA (serviços de ensino com acesso virtual a destinatário estabelecido fora de Portugal, localizados no país do destinatário), Artigo 6.º, n.º 6, do CIVA (localização das prestações de serviços a não sujeitos passivos)

Open the whole chat

How it works

A language model is good at understanding people and bad at being sure. So the job is split in two: the model listens, and the law decides.

Variant A: LLM + engine

You describe the invoice line your words Language modelturns your words into facts facts, never a value Rules enginethe law as a program missing fact:a question decidedno rule fits Every tax fieldwith its article An accountantno value given

Variant B: LLM + law

You describe the invoice line your words Language modelreads the law in its prompt a question,if it thinks to the model picks the value Every tax fieldright, or wrong
  1. The model listens. It turns what you wrote into plain facts: who issues the invoice, where the client is, what the work was. It never picks a rate or a code.
  2. The law is written as a program. Each rule is a few lines of code taken from one article of the VAT or IRS code, and carries that article with it. The program runs on the facts, not the model: the same facts always give the same answer, and it can show which rules it used.
  3. A missing fact becomes a question. When the rules cannot decide yet, they say which fact they lack, and the agent asks you for that and nothing else.
  4. Every field shows its law. The answer fills each tax field of the recibo (VAT rate, exemption code, legal basis, IRS withholding base and rate) and cites the article behind it, so you can read it yourself.
  5. When the law runs out, a person decides. If no rule covers the case, it goes to an accountant, with no value given. A wrong value is worse than none.

Adapting it to another business means writing that domain's rules and test cases. The agent loop and the screens stay the same.

Read this before quoting the numbers

  • Model claude-haiku-5-5, run 3ea65283. 19 fresh and 37 tuned scenarios, 3 seeds each.
  • The fresh scenarios were written from the facts of each ruling, with no change to the prompt or the rules afterwards. One expected value (the credit intermediary) comes from the article the ruling cites, not from its conclusion.
  • Of the 37 tuned scenarios, only 3 were held out from rule development.
  • The user side of each chat is simulated by a model.
  • No accountant has reviewed the rules yet. Not tax advice.
  • Covers the tax fields of one recibo: VAT and IRS withholding. Not the withheld amount.