Skip to content

Repository files navigation

Broker email pipeline demo

Interactive flow: paste a broker email bodyParse 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.

Run it

npm install
cp .env.example .env.local
# Add OPENAI_API_KEY to .env.local, then restart the dev server after changes.

npm run dev

Open http://localhost:3000. The path /demo redirects to /.

Using the demo

  1. Edit the email body (default text is sample copy you can replace).
  2. Click Parse with AI to call the parser, or Run walkthrough to step through the stages with a parse at the JSON step.
  3. Click any step in the timeline to jump to that section.
  4. Reset clears the parse and restores the default sample body.

Parser API (used by the demo)

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.

Demo code (main files)

  • src/components/demo/broker-flow-demo.tsx - UI and flow
  • src/app/api/parse-broker-email/route.ts - structured extraction endpoint
  • src/lib/demo/listing-schema.ts - Zod schema for the listing object
  • src/lib/demo/broker-flow-data.ts - default sample email text and helpers to build deal / comps / memo from a parse

About

Interactive pipeline demo - AI-powered parsing of multifamily broker teasers into structured JSON, with deal/comps/memo views driven only by the parse.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages