Skip to content

T02 — An Italian lease on one page, in plain English

Daniel has moved to Milan for work and is about to sign the lease of his first flat there: eight pages in legal Italian. He wants to know what he will pay, when, what he cannot do, and — above all — how and by when he can leave. This workflow reads the contract and gives him one page in plain English, with the figures and the dates computed by the workflow, not by a model, and the sentence he will have to send to give notice, already written in Italian.

The workflow in three stages. 1, read the contract: the lease, a PDF in Italian with seventeen articles, Via dei Glicini 14; Read the lease, AI copies the facts and explains each article, 17 articles; The facts are complete, a JSON Schema on dates, numbers and every key, valid. 2, check it against itself, compute: End date agrees, Date Calculation start plus term minus one day, gap 0 days; Rent agrees, Calculate yearly minus twelve times monthly, gap 0; Notice deadline, Date Calculation end minus the notice months, 30 April 2030. 3, write the page, lay it out: Write the page, AI with the articles in plain English and no figures, 5 clauses and 3 checks; Only if it agrees, Combine Conditions and Filter, passed; Render the summary, figures, dates and the notice text in fields, a one-page PDF.

The reference run, on the lease — 5.37 credits:

Delivered What is in it
Summary one page: the lease in one sentence, the rent, the deposit and the notice deadline, five clauses to know, three things to check before signing, the notice sentence in English and Italian
The facts the parties, the address, the dates, the terms, the amounts as printed, and what each of the seventeen articles says
Checks the printed end date against the computed one: 0 days apart; the yearly rent against twelve months: 0 apart
Notice deadline 2030-04-30

The summary: Lease at a glance — Via dei Glicini 14, Milano — Lease from 1 November 2026, 4 + 4 years, Elena Marchetti to Daniel Okafor, with an illustration of a Milanese apartment building with green shutters, balconies with plants and a courtyard arch. In one sentence: A residential lease with fixed rent, renewal, and clear rules on leaving, care, access, and shared costs. What it costs, when to act: €1,250 a month, by day 5; Deposit €3,750, 3 months; Notice by 30 April 2030. Clauses to know: Art. 5, Rent and payment; Art. 4, Leaving and renewal; Art. 8, Shared costs and utilities; Art. 7, Deposit return; Art. 10, Use and changes. Before you sign: check the flat and cellar match the stated condition; ask to see the energy-performance information; confirm the condominium advance and the utilities you will handle. The notice: I give notice to end the lease of the flat at Via dei Glicini 14, Milano, as of 31 October 2030 — in Italian, Comunico la disdetta del contratto di locazione dell’immobile di Via dei Glicini 14, Milano, con effetto dal 31 ottobre 2030 — registered letter or certified email (PEC) by 30 April 2030.

The lease is the common Italian 4 + 4: four years, renewed automatically for four more. It is a PDF of seventeen articles — the flat, its use, the term, leaving, the rent, the flat-rate tax, the deposit, shared costs, repairs, alterations, subletting, pets, handing back the keys, visits, the energy certificate, the court, the law:

Art. 3 — Durata
La locazione ha la durata di anni 4 (quattro), con decorrenza dal 1° novembre 2026 e scadenza il 31 ottobre 2030. …
Art. 4 — Recesso del Conduttore e disdetta
Il Conduttore può dare disdetta del contratto alla scadenza, … con un preavviso di almeno 6 (sei) mesi, da
comunicarsi a mezzo lettera raccomandata con avviso di ricevimento o posta elettronica certificata (PEC) …
Art. 5 — Canone
Il canone annuo di locazione è convenuto in € 15.000,00 (euro quindicimila/00), da corrispondersi in dodici rate
mensili anticipate di € 1.250,00 (euro milleduecentocinquanta/00) ciascuna, entro il giorno 5 (cinque) di ogni mese …

The lease, the parties, the address and every code in it are fictional, written for this example.

Input Who provides it Example
The lease the landlord or the agency, before signing a PDF uploaded as an asset
Link to the contract optional: where the full contract is kept printed as The full contract →
  • The model copies; the workflow computes. Document Analysis reads the PDF and copies the facts exactly as printed — dates as YYYY-MM-DD, amounts as numbers, the term and the notice in years and months — and says in a sentence what each article means for the tenant. Its brief forbids computing, rounding or converting anything. A schema checks the copy; from then on no model touches a figure. See Reading video and documents and Structured answers.
  • The contract is checked against itself. A contract states some facts twice. Date Calculation adds the term to the start and takes off a day — a four-year lease from 1 November 2026 ends on 31 October 2030 — and measures the days between that and the printed end; Calculate subtracts twelve monthly rents from the yearly rent. Two Predicates require both gaps to be 0, Combine Conditions requires both, and a Filter lets the page’s words reach the template only then. A misread digit — or a contract that contradicts itself — stops the page before the costly illustration is painted. See Calculating — Dates and Deciding.
  • The deadline is computed, not read. The lease never prints the last day to give notice; it says six months before the end. Date Calculation subtracts the notice months from the end: 30 April 2030. That is the figure a tenant most needs and the one a model most easily gets wrong by a day or a month.
  • The notice is written, word for word, by the workflow. Two Text Templates fill a fixed sentence — Comunico la disdetta del contratto di locazione dell’immobile di [address], con effetto dal [end]. and its English version — with the copied address and the computed end, written as Italian and English dates by Format as Text. The legal sentence a tenant will send is never improvised by a model.
  • Plain words, no figures. Text Generation writes the page’s sentence, the five clauses to know and three checks before signing, from the articles alone. Its brief forbids amounts, dates, durations and counts — in figures or in words — and the schema refuses any digit in them; the figures reach the template through their own field inputs (byline, step_1…step_3, the notice fields). It is told not to give advice beyond what the articles say.
  • Names as people write them. Italian contracts print the parties in capitals. On the first run the page said ELENA MARCHETTI to DANIEL OKAFOR; the reading’s brief now asks for the names as a person writes them.
  • One template, used again. The page is the layout of T01 — itself the gallery’s visual summary — copied with new headings and a green palette: Lease at a glance, What it costs · When to act, Clauses to know, Before you sign.

The PDF is read by the model directly: Madoo has no step that extracts a PDF’s text without a model, so the copy of the facts is checked by the arithmetic above rather than against the extracted text.

The figure above tells the workflow as stages; the exact graph is the workflow (as a diagram), node by node in the table.

Node Type Why
The lease / Link to the contract input/document, input/text The PDF; where the full contract is kept
Read the lease ai/document_analysis, JSON mode The parties, the address, the dates, the terms, the notice and how to give it, the rent, the deposit, the condominium advance, and every article in a sentence
The facts are complete utility/json_schema_validate, fail Every key, dates as YYYY-MM-DD, whole numbers where they must be, at least five articles
Landlord, Tenant, …, Deposit utility/extract ×13 The checked facts, typed
Start plus the term / End, computed / Printed end minus computed end utility/date ×3 add years, subtract one day, difference in days
Yearly rent minus twelve months utility/calculate rent_annual - rent_monthly * 12
The end date agrees / The rent agrees / The contract agrees with itself utility/predicate (equals 0) ×2, utility/boolean_combine (all) Both checks at once
Last day to give notice utility/date The end minus the notice months
Deposit in months of rent utility/calculate deposit / rent_monthly
Rent, Deposit, …, End in Italian, Notice date text/format ×10 (en-GB, it-IT) The figures and dates as the page prints them
Byline, Step 1–3, The notice in Italian and in English, How and by when text/template ×7 The page’s fixed sentences, filled with the facts
The articles as text / Write the page text/format json, ai/text_generation JSON mode The sentence, four or five clauses, three checks, an illustration prompt
The words fit the page utility/json_schema_validate, fail Lengths for the printed page; no digits in the AI’s words
Only a consistent contract goes to print utility/filter The page’s words pass only if the contract agrees with itself
Illustration prompt / Paint the illustration utility/extract, ai/text_to_image The picture of the building — painted only after the filter
Render the summary design/template_render The AI’s words on data_0; title, byline, steps, notice and picture on their fields
Outputs output/pdf, output/image, output/json ×4, output/text The summary, the facts, the two checks, the deadline and the layout report

Reading a run: End date check and Rent check are 0 when the contract agrees with itself; any other value names the gap, and the page is not made. The layout report says whether every text fitted its box.

Cost: under half a credit to read the lease and write the page, 5 for the illustration — 5.37 in all. Without the illustration the summary costs under 1 credit.

The example installs into your workspace with an API key, through the public API only — see Installing an example. It installs the document template too:

Terminal window
node madoo-install-example.mjs t02-lease-key-terms --api <your Madoo API URL> --key <key.json> --run

--run uploads the example lease and summarises it (about 5.4 credits). To summarise your own, run the workflow with your PDF on the input The lease.

  • Another kind of lease: a 3 + 2 agreed-rent lease or a short transitional one changes only the facts; the checks hold. For a lease with no automatic renewal, drop renewal from the byline.
  • Another document: an employment contract (salary, probation, notice), an insurance policy (premium, excess, renewal), a supplier agreement (price, delivery, termination). Change the keys the reading copies, the checks that tie them together and the notice sentence.
  • Another reader: the page’s brief says in plain English; ask for French or Spanish, and rewrite the template’s headings and the notice translation.
  • No illustration: disconnect Paint the illustration and give the template a fixed picture on its illustration field.
  • Before relying on it: the page summarises; it is not legal advice. The notice sentence is the common form — have it checked for a contract with unusual terms.

manifest · workflow · the complete graph · the template · the lease