2026-09
CodeSquare
CAIXA credit simulation ~2 min by hand (the correspondent's estimate) → 15 s in live tests on real buyers' data; every form field filled from the documents, checked by 8 pre-submission rules
Gestão Nova Casa is an internal tool for a CAIXA Aqui correspondent, the partner that takes home buyers through CAIXA's mortgage process. The team drops a buyer's documents into the app; an LLM extracts the data, the app builds the buyer's record, checks it against a catalogue of 8 pre-submission rules (CPF check digit, postcode against address, validity of the proof of income, extracted income against declared income, highly variable income, maximum age, maximum term, income commitment), and, at one click, an agent drives Chrome on the attendant's own machine to run CAIXA's mortgage simulation and saves the result, which CAIXA's site does not keep — so nobody retypes anything. CAIXA changes its site's layout often but not its fields, as the correspondent confirmed, so the agent fills the form by reading the whole screen rather than relying on fixed selectors; when it cannot find a field or CAIXA rejects one, it stops, the attendant completes that step by hand, and the agent resumes. Daniel counts this loop as the most interesting decision of the design: when data is missing, the agent asks the attendant to fill it in the system, then resumes the flow, round after round until the simulation is complete. A simulation the correspondent estimates at about 2 minutes by hand took 15 seconds in live tests with the correspondent on real buyers' data, and when the documents are sent complete every form field is filled from them, never from the conversation with the buyer. Daniel chose the extraction model by measuring four of them on 16 real customer documents (82 fields): the one picked read 89% of fields correctly with 2 silent errors (a wrong value at confidence 0.9 or above), at about US$ 0.05 per buyer, over a model with the same accuracy that never answers "unreadable" and made more than three times the silent errors. Since no model read every photo right — all four got the same birth date wrong with high confidence — he designed the extraction to be verified, not just read: every field ends either confirmed by a check that cannot be wrong (CPF and CNH check digits, payslip arithmetic) or seen by a person with the document beside it, and all 13 wrong CPF and CNH readings in the test failed their check digit. Daniel ran the discovery with the correspondent through a questionnaire he wrote for them, modelled the whole system himself from its answers, and built the whole system — the Electron desktop app and its browser agent, the NestJS server with its AI gateway, the partner portal and the sales site — everything except the brand name and the visual identity, which came from a landing page designed by the CodeSquare team. Daniel left CodeSquare with the system in acceptance testing with the correspondent, in a staging environment; the correspondent released it to production in October 2026 — the desktop app and the partner portal at least, the sales site not yet seen live — so its production numbers are not known to him.
Daniel containerised the system himself: he wrote the Dockerfiles and the docker-compose file for its four services, which talk over a Docker network behind Caddy as reverse proxy and TLS, on a VPS.
TypeScript · Electron · Playwright · NestJS · Drizzle ORM · PostgreSQL · better-auth · Zod · React · TanStack Router · TanStack Start · OpenAI API · Docker · docker-compose · Caddy · CSS Modules · Zustand · TanStack Query