write me an agent, and generate an excel model template, that can structure and assess lending opportunities for multifamily properties. Use whatever templates you need to as a base, such as the one attached. consider senior, bridge, mezzanine loans. Consider what data is available in the RealAI datamart and what data you will need to request from the user on a typical run. You can get this from them in an ask user form. Look at other agents in RealAI for examples of how this is done for acquisitions and other scenarios.
Multifamily Lending & Capital Stack Model — Template and Agent Instructions Ready
I can't install an agent into your workspace directly yet (that's still a "you do it in-app" action) — but I've built both pieces so you can drop the second one straight into Create an Agent as-is, and use the workbook standalone or through it.
What's in the workbook — 8 linked tabs, all formula-driven (color-coded: blue = input, black = formula, green = cross-sheet link), gated through the integrity scan and recalculated with zero errors:
The agent instructions are written as a standalone markdown file — role, one-shot intake form (property, documents, capital-stack structure, requested amounts, rate basis, recourse, sponsor financials), the datamart topics to pull (mf_property_financials, mortgage_rates.mortgage_rate_snapshot, caprate_ts, Treasury/SOFR series) versus what only the user can supply (requested proceeds, actual quoted spread, mezz economics, recourse, guarantor strength), the full cell-address map into this workbook, credit-box defaults, mezzanine-specific sizing logic (priced off residual NOI after senior debt service), and the response structure (verdict per tranche, capital-stack table, coverage, refi test, recovery, structure recommendation).
To make this a real agent: open Create an Agent, paste the instructions from the markdown file, and attach the Excel template as its reference file — that mirrors exactly how the built-in Credit Underwriting and Acquisition Analysis agents are wired (instructions + attached template).
Two calls I made in building this that are worth flagging rather than burying: the mezzanine tranche is deliberately priced against residual NOI (after senior debt service), not gross NOI — that's the standard mezz convention but it's a modeling choice, not a market fact. And the sample numbers above are the template's default illustrative inputs, not a real deal — swap the blue cells for your actual T12 and quoted terms and the whole stack recalculates.
Compare that to this agent and let me what you did differently and why # CRE Term & Bridge Loan Origination Screen
You are a senior credit officer analyzing or structuring a proposed loan on an operating commercial real estate asset — acquisition financing, bridge, term refinance, participation, or a stress or structuring question on any of them. You produce a directional recommendation (Approve / Approve with Structure / Decline — or, on a structuring ask, the structure that earns the Approve) with a supportable proceeds number. You stop short of closing-level diligence.
The unit of analysis is the loan, not the deal: does it get repaid (in-place coverage through the term, the stressed refinance or sale at maturity), and what is recovered if it isn't. The borrower's pro forma is an input to haircut, not a base case to adopt. Bridge loans size on in-place income; the business plan lives in the exit test. Participations re-underwrite the lead's package and name every material divergence.
When dates appear in data, calculate elapsed time before describing them.
Review the ask, the documents, the datamart, and the model's inputs — then emit one ask_user form that confirms the assumptions you intend to use and requests anything missing, documents included. Never ask what the user already said or what the data answers.
property_mfr / property by name, address fallback). Run explore_data before querying — never guess topic or field names. Pull the T12 (mf_property_financials), attributes, occupancy/rent, market cap rate and vacancy/OpEx benchmarks, current loan quotes (mortgage_rates with topic mortgage_rate_snapshot — queried bare it returns names only), and the 10-year Treasury (national_metrics_daily.ten_year_treasury_pct). Fit a loan product from whatever the snapshot returns and label each quote with product and as-of date.default when the user gives none): max LTV 65%; DSCR floor 1.25x (1.20x with IO acceptable for stabilized MF — flag it); debt yield floor 9.5% (8.5% for stabilized MF in strong markets — flag it); refi test at current quote +50 bps rate and +50 bps cap.The attached template (RealAI_Credit_Underwriting_Template.xlsx, LoanType 1) and its manifest are the calculation engine on every run. Pipeline: read manifest → one population script → recalc + integrity gate → one consolidated read-back → library_save → library_present → memo. The manifest is the address map — don't dump sheets to re-derive layout, and don't narrate between mechanical steps. Name the workbook after the collateral and run date.
file source built from the saved file's id and the cell_range. Python drives the workbook; it never stands in for it. A figure with no cell is out of scope, not computed on the side. (Forecast-skill outputs are inputs carried into the model.) Register citations in one register_endnotes call with short text_spans.2–3 minute read, credit memo register. Two or three charts maximum, titles stating findings; tables 5–7 rows; round aggressively; no closing recap table. The full structure fits a mandate to underwrite; when the ask is a single question, lead with its answer and keep only the sections that serve it. Attribution: (All figures from the attached model.)
Here's the honest comparison — same genre of agent, several real gaps on my side, and a couple of places where mine took on scope that one deliberately declined.
Scope: single loan vs. the stack — the one intentional difference That agent underwrites one loan at a time (term/bridge/participation). Yours asked for senior + bridge + mezz together, so mine models the stack: tranches sized off each other (mezz on residual NOI after senior debt service), cumulative LTC/LTV/DSCR/debt yield, and a waterfall recovery across tranches. That's the right divergence — it's what makes mine a different tool, not a worse version of theirs.
What that agent does that mine doesn't — real gaps, not stylistic ones
Where I'd defend my choices
Bottom line: the stack-vs-single-loan divergence is correct and intentional. The exit analysis, sponsor/guarantee section, goal-seek mechanics, and FLAG-to-memo wiring are real deficiencies I'd fix before treating mine as equally production-ready. Want me to close those four gaps in the agent doc and extend the workbook with a prepay/defeasance sheet?
This is a read-only snapshot of a RealAI analysis.