A municipal aid scheme (roads, street lighting, drinking water, sanitation, rivers) receives PDF applications filed by local authorities — communes, joint boards, intermunicipal bodies. Souverain Agent is a functional prototype that reads these files with OCR, analyses them with a language model run locally, applies an eligibility rules engine, and prepares the work of the instructing agent rather than deciding in their place.

A municipal aid application arrives as a PDF: a standard form, a project description, a costed funding plan. Before any decision, someone has to read the file, check that the amounts add up, that the commune is within the scheme's territory, that the project matches an eligible theme. It's repetitive reading work, not judgment work: the judgment comes after.
The funding ratio must not exceed a cap set by the scheme's regulation. The territory must be within the scheme's area. The project must fall under one of the covered themes. Three mechanical checks, done by hand on every file, before even reaching the real question: does this project deserve support.
Have the file read and checked by a chain of local OCR then local AI, to prepare an eligibility report — never to decide. The instructing agent remains the only one who approves or refuses: the machine reads, it does not rule.
Why local: a grant application holds data from public authorities and personal data about their representatives. Running OCR and the language model on infrastructure under our control, rather than sending every file to an external API, is the project's starting condition — not an option.
The file crosses a chain of four steps, orchestrated by containers (n8n for the sequencing, a dedicated language model and OCR service), before coming back as an eligibility report ready to be reviewed.
The local authority files its PDF application on a six-step portal (structure, project, finances, schedule, signature, summary), or enters it directly if it has no PDF on hand.
The PDF's text is extracted by an OCR service that runs in a container, never leaving the local infrastructure. The raw text is kept alongside the structured data, so the instructor can always go back to the source.
The extracted text is structured by a language model run locally (container orchestration via n8n) : identity of the project owner, project title and description, detailed funding plan. This step judges nothing, it turns free text into usable fields.
The structured fields pass through a rules engine that checks the funding cap, the territory and the theme, then computes a score and recommendations. The result is a report, not a decision: it awaits the instructing agent's validation.
What this changes in practice. The instructing agent opens a file that is already pre-filled, with an audit report and a list of points to check, rather than a PDF to pick apart field by field. The mechanical reading time shifts to the machine; the judgment stays human.
The eligibility engine is not a prompt hoping the model applies the regulation: it is a function that reads the structured fields and computes three criteria, each with its own verifiable logic.
| Criterion | What it checks | Who decides it |
|---|---|---|
ratio_financier | The requested grant amount does not exceed 50% of the project's total cost excl. tax. | Direct calculation, no call to the model. |
localisation | The local authority's address falls within the scheme's territory. | Check on the address field extracted by OCR. |
thematique | The project falls under one of the covered themes (road network, lighting, drinking water, sanitation, rivers). | Presence of a non-empty, usable theme field. |
The boundary that matters. The language model turns text into structured fields; it never computes the eligibility verdict itself. If the regulation changes its cap, one line of code changes — not a prompt that would need rewriting and blind re-testing.
Six screens cover the full cycle: filing on the local-authority side, instruction on the agent side, statistical tracking, and the document generated at the end of the analysis.






The language model reads and structures; a written, testable rules function decides. Holding this separation from the start avoids the temptation to let the model "judge" a regulatory criterion — a funding cap is a calculation, not an opinion, and it has to stay verifiable independently of whichever model is used.
The "to verify" banner, which precisely lists the fields the extraction could not confirm, is more useful than any overall score: it tells the instructor where to focus, instead of either trusting the extraction blindly or distrusting it wholesale.
The portal, the rules engine and the instruction screens run on synthetic files; moving to real files means qualifying the OCR and the local model on PDFs messier than the ones generated for the demonstration — a separate step from the work already done.