0 1 0 1 2 3 4 5 6 7 8 9 0 0 1 2 3 4 5 6 7 8 9 0

An AI financial advisor for Salvadoran businesses that reviews the books every morning and writes, unprompted, when something needs attention — numbers by code, words by the model.

(01). PROJECT

Can an AI write to a business owner about their finances without ever inventing a number?

Marvin is Le Website Tech's own product: an AI financial advisor for small and medium businesses and NGOs in El Salvador. Every morning it ingests electronic invoices from the Ministry of Finance, the monthly closing sent by the accountant and exports from any accounting system, computes eleven indicators, checks twenty-seven legal obligations and, when something needs attention, writes a short email in Salvadoran Spanish — before anyone asks. Built with a partner firm of accountants, it is in its final stretch before launch.

We designed and engineered the product end to end: ingestion, deterministic engine, LLM redactor with four gates, tenant isolation and human approval.

Walkthrough – 2026

marvin-L1
marvin-L2
marvin-L3
marvin-diagram

(01) ABOUT THE PROJECT

What does it take for an LLM to be safe around someone's accounting?

Two rules shaped the whole architecture: the numbers are computed by code, never by the model, and nothing is asserted without traceability. Every figure Marvin shows opens up to its indicator, its formula and the source document it came from. The legal side is a hand-curated knowledge base — twenty-seven obligations with law, article, verbatim wording and fine — rather than a model's recollection of the tax code, and the thresholds that depend on the minimum wage refuse to guess when a value is missing.

The model is a redactor, not an analyst. Its LLM engineering is one system prompt that fixes the brand voice — Salvadoran voseo, calm, no exclamation marks — a forbidden-word list and a strict JSON contract; the finding goes in as JSON and a draft comes back at temperature 0.3 from Kimi K2 or Qwen, behind one provider interface chosen for cost. Four gates then decide whether the draft ships: schema validation, a confidence threshold of 0.75, a provenance check that rejects any digit not present in the input, and a voice check. If any gate fails, a deterministic template speaks instead: silence is a designed outcome, not an error. Token cost is stored on every message from the first customer, and with no key configured the templates ship on their own.

(02) DATA AND ISOLATION

Where does the data come from, and who is allowed to see it?

Three ways in: a parser for Hacienda's electronic invoices built against fifty-six real DTEs across two schema versions, with decimal-only money and size limits; closings by email to a per-company address that requires both a token and a registered sender; and any Excel or CSV export — Mónica, SAP Business One, Odoo, QuickBooks — where the sheet, columns and dates are inferred and a person confirms the account mapping once.

Isolation is enforced twice: row-level security in PostgreSQL keyed per tenant on every transaction, plus repository scoping, two database roles — the app cannot even boot with the migration role — and a tenant-isolation test suite that gates every release. Nothing critical reaches a client without the expert partner's approval in the review queue.

(03) WHAT COMES NEXT

The next milestone: retrieval over Salvadoran law

The legal base is designed as retrieval-augmented generation over a versioned corpus of labor, commercial and tax law: knowledge cards with norm, article, obligation, deadline, sanction, source and verification date, so Marvin can answer a question with the article, the citation and a confidence level, and escalate to a specialist when the risk is red. It is deliberately the second milestone: the deterministic engine had to be trustworthy first.

Underneath: Python 3.12 and FastAPI, SQLAlchemy 2 and Alembic on PostgreSQL 16, React and Vite on the front, 439 tests with ruff and strict mypy, Sentry with scrubbed payloads, one JSON log line per request and a heartbeat table that emails an alert if a morning run fails. Deployed on DigitalOcean with managed Postgres and email through an authenticated relay with SPF, DKIM and DMARC.

marvin-f-SQ1
marvin-f-PW1
marvin-f-PW2
marvin-f-SQ2

(04) PROJECT GOALS

Warn before the deadline, with the law and the figure, in words the owner reads in one minute.

Make every number traceable to its source document, and every message approved by a person before it is sent.

marvin-L1
marvin-L3
marvin-L2
marvin-L4

Marvin says less than a dashboard and gets read more: one clear message, with the figure and what to do, every morning.

Francisco Gonzalez Project Manager

NEXT PROJECT

Apps

Services