Interactive flow: paste a broker email body → Parse with AI → review JSON, deal record, rent comps (subject row from the parse), and a screening memo. Steps 2–5 stay locked until parsing succeeds. There is no canned downstream data; everything after the email comes from the model response.
npm install
cp .env.example .env.local
# Add OPENAI_API_KEY to .env.local, then restart the dev server after changes.
npm run devOpen http://localhost:3000. The path /demo redirects to /.
- Edit the email body (default text is sample copy you can replace).
- Click Parse with AI to call the parser, or Run walkthrough to step through the stages with a parse at the JSON step.
- Click any step in the timeline to jump to that section.
- Reset clears the parse and restores the default sample body.
POST /api/parse-broker-email
JSON body:
| Field | Required | Notes |
|---|---|---|
body |
yes | Full broker teaser / email text |
subject, from |
no | If set, sent above the body to the model |
provider |
no | Default openai |
model |
no | Uses the registry default when omitted |
Success: { "listing": { ... } } - shape defined in src/lib/demo/listing-schema.ts.
src/components/demo/broker-flow-demo.tsx- UI and flowsrc/app/api/parse-broker-email/route.ts- structured extraction endpointsrc/lib/demo/listing-schema.ts- Zod schema for the listing objectsrc/lib/demo/broker-flow-data.ts- default sample email text and helpers to build deal / comps / memo from a parse