Agents & MCP · A real-estate developer's finance team · 2026
Document-grounded review assistant for lender and partner agreements
Reviews loan, guaranty and partnership agreements clause by clause against the team's key terms. Every flag carries a verified quote and a proposed redline, and the assistant proposes changes that a person applies.
A first-pass review where code checks every quote and number the model gives, and nothing changes until an analyst presses Apply. The demo runs on public SEC EDGAR filings.
- Role
- Sole engineer
- Stack
- Python · FastAPI · PostgreSQL · Alembic · OpenAI API · Tool calling · OpenTelemetry · Docker · pytest
A real-estate developer's finance team reviews loan agreements, guaranties and partnership agreements against its own standard positions. I built a tool that does the first review. It checks every clause, down to each sub-paragraph, and each issue comes with the exact wording from the draft, a proposed redline, the fallback position and a precedent. The demo runs on public SEC EDGAR filings behind a passcode, with sample users in different roles.
The review is a background pipeline where code and model each do what they are good at. Code parses the draft into clauses and shortlists candidate pairs of clause and key term. A model judges each pair in parallel and returns structured JSON: a verdict, a materiality level, a verbatim quote and the numbers it relied on. Code then verifies. The quote must be an exact span of the clause, every number in the reason must appear in the clause or the key term, and limit comparisons are recomputed in code. Anything that fails is dropped and logged. Redlines must touch only the flagged span and keep every defined term, or the tool falls back to the standard wording.
The assistant answers questions about the drafts with read tools for drafts, clauses, key terms, precedents and the document library, and lists the sources it actually read. Every write tool comes in two halves. The describe half shows a proposal card. The apply half runs only when a person presses Apply, and the server checks that person's role. Only the terms keeper can change key terms, and only an admin can manage model keys.
For evaluation I built a gold set: two models label every clause and term pair blind, agreements go straight in, and each disagreement is adjudicated by reading the clause, with the reason logged. Candidate judge models are scored against it on recall of material issues, precision, materiality agreement and stability across repeated runs. The test suite never calls a model provider, so the evidence guarantees hold whichever model is chosen.
Screens




