Back to case studiesFlying Nana LLC logoCase study · AI serving & orchestration

Real Estate Pro Agent: A Personal Home-Search Assistant

How I built an AI assistant inside a brokerage's iOS app that learns what each client wants, answers from live MLS data instead of memory, pings them the day a matching home hits the market, and sends a personal market report every Friday.

Product
FlyingNaNa Realty iOS app
Timeline
Dec 2025 – Mar 2026
Stack
Python · FastAPI · LangGraph · Pinecone · AWS SageMaker
Models
Claude, GPT-4o + real-time MLS tools
00 · Overview

Four layers: conversation, facts, follow-up, and serving

The assistant does three jobs: answer clients in chat, alert them daily about new matches, and write a weekly report. All three share the same four layers, so a fact shown in an alert is checked the same way as one said in chat.

Client chats in the app · MLS feed updates · Daily and Friday schedules
1 · Orchestration
Stateful workflows with explicit tool contracts
Read the guide
LangGraph: property searchLead qualificationAppointment schedulingCheckpoints + recovery paths
2 · Grounding
Live facts from MLS, meaning from retrieval
Read the guide
Query rewritingHybrid retrieval (Pinecone)Real-time MLS toolsSelf-correction check
3 · Proactive engine
The assistant reaches out, not only replies
Read the guide
Client preference profileDaily new-listing matcherFriday report builderDelivery rules
4 · Serving & quality
Fast on a phone, measured, and safe to release
Read the guide
Async FastAPI + streamingModel routing + prompt cachingEvaluation setsSageMaker monitoring + rollback
Streamed answer in chat
Daily “new for you” alert
Friday personal report
Tour request → agent
01 · Context

A personal agent for every client, not a chatbot on a website

Home buyers and renters don't search once. They search for months, their preferences shift, and the market changes every day. The brokerage wanted every client in its app to feel like they had a dedicated agent paying attention.

Answer
“3-bed in Irvine under $1.4M near my office, good schools.” Search, compare, and explain homes in plain language, in a streaming chat.
Learn
Keep a preference profile per client: budget, areas, beds, must-haves, and deal-breakers. Update it from what they say, save, and dismiss.
Alert daily
When a new listing matches, tell the client that day, with one line on why it fits them.
Report on Friday
A weekly summary: new matches, price drops and status changes on saved homes, and a short market snapshot for their areas.
Hand off
Qualify the lead and book a showing, then pass it to a human agent with the full context.

FlyingNaNa is my own real-estate business, and I'm a licensed California Realtor (DRE #02214297). I built the assistant for my own clients, so it's designed around how agents actually follow up: what clients ask, when they lose interest, and what a good handoff to a human looks like.

Homepage of realestate.flyingnana.com, a luxury real estate services site

realestate.flyingnana.com, the brokerage's client-facing site

Ariana Li business card: AI-Powered Luxury Specialist, Realtor, CEO & Founder & AI Tech Lead at FlyingNaNa

AI-first brokerage: Realtor and AI tech lead in one role

The hard constraint was trust. A listing that says “Active” when it went pending yesterday, a made-up HOA fee, or an invented school rating does more damage than no answer at all. Prices and status change hourly, so anything the model memorized or a stale index returned was a liability.

02 · Walkthrough

One request, two designs

A client message (illustrative):

“Anything new in Irvine? 3 beds, under $1.4M, quiet street, close to Spectrum. Not another townhouse.”
One prompt + vector search
Fluent, confident, partly wrong
  1. 01Embed the whole message; take the top 5 similar listing descriptions
  2. 02Index is a day old: one result went pending this morning
  3. 03Model fills gaps: “top-rated schools”, “low HOA”, with no source
  4. 04Returns a townhouse because its description says “quiet”
  5. 05Nothing remembers “not another townhouse” next week
Graph + live tools
Every fact traced to a record
  1. 01Rewrite → filters {city: Irvine, beds ≥ 3, price ≤ 1.4M, type ≠ townhouse} + semantic “quiet street”
  2. 02Hybrid retrieval ranks candidates; MLS tool confirms live status and price
  3. 03Self-check: each claim in the draft must match a field in the listing record
  4. 04Stream 3 homes with commute and the reason each fits
  5. 05Profile update: excludes townhouses from now on

Hard constraints are filters, not suggestions. Retrieval decides what's relevant; the MLS tool decides what's true right now.

03 · Layer 1 — Orchestration

LangGraph workflows own the conversation's state

Search, lead qualification, and scheduling are separate graphs with explicit state. The model chooses within a step; the graph decides which steps exist and what happens when one fails.

Tool contracts
search_mls(filters) → Listing[]

Every tool has typed inputs and outputs. A malformed call fails at the boundary and is retried or rerouted, not passed on.

Checkpoints
state saved after each node

A conversation that drops on a phone resumes where it stopped, without re-asking questions or re-running tools.

Recovery paths
MLS timeout → cached result, labeled

Each failure has a defined next step: retry, fall back, or tell the client plainly. No silent guessing.

Lead qualification
timeline, pre-approval, budget

Collected naturally over the chat and written to the CRM once confirmed, so the human agent starts informed.

graph = StateGraph(SearchState)
graph.add_node("rewrite", rewrite_query)        # message -> filters + semantic query
graph.add_node("retrieve", hybrid_retrieve)     # Pinecone dense + metadata filters
graph.add_node("live_check", mls_live_status)   # price / status / DOM from MLS
graph.add_node("draft", draft_answer)
graph.add_node("verify", self_check)            # every claim must map to a record field

graph.add_edge("rewrite", "retrieve")
graph.add_edge("retrieve", "live_check")
graph.add_edge("live_check", "draft")
graph.add_edge("draft", "verify")
graph.add_conditional_edges("verify", route_after_verify,
    {"ok": END, "revise": "draft", "requery": "rewrite"})   # bounded by state.attempts

app = graph.compile(checkpointer=checkpointer)
Property-search graph (simplified). The verify step can send a draft back for another pass, but no more than twice.
04 · Layer 2 — Grounding

Retrieval for meaning, MLS tools for facts

This is the layer that cut hallucinations by 75% on the evaluation sets. Three changes did most of the work: rewriting the query before retrieval, splitting “relevant” from “true”, and checking the draft before it reaches the client.

Query rewriting
A client's message mixes hard constraints (“under $1.4M”) with soft taste (“quiet street”). Rewriting splits them into metadata filters and a semantic query, so a price limit is never left to similarity.
Hybrid retrieval
Dense vectors in Pinecone for descriptions and neighborhood notes, combined with keyword and metadata filters. Exact terms like a school name or “ADU” don't get lost in embedding space.
Live MLS tools
Price, status, days on market, and open houses come from the MLS at answer time. The vector index never answers “is it still available?”
Self-correction
Before streaming, a check compares each factual claim in the draft to the listing record. Unsupported claims are removed or rewritten; if too many fail, the graph re-queries.
Stale status

The index says Active; the home went pending this morning.

Status is always read live from MLS before it's shown.

Invented details

“Top-rated schools” and “low HOA” appear with no source.

Claims without a matching record field are dropped by the self-check.

Soft vs. hard constraints

A $1.6M home ranks first because its description is a close match.

Budget and beds are filters, applied before ranking.

05 · Layer 3 — Proactive engine

Daily alerts and the Friday report

Most of the value came from the assistant reaching out first. Both jobs read the same client profile and the same MLS data as chat, so an alert never says something the chat would contradict.

Preference profile
budget, areas, beds, must-haves, deal-breakers

Structured fields, not a chat history. Updated from what the client says, saves, and dismisses, and visible to the human agent.

Daily matcher
new MLS listings × profiles

New and back-on-market listings are filtered by hard constraints in code, then ranked. The LLM writes only the one-line “why this fits you”.

Delivery rules
dedupe · daily cap · quiet hours

A home is announced once. Only the best matches are sent, so alerts stay worth opening.

Friday report
matches · price drops · status changes · market

One personal weekly summary per client, with next steps such as tours for saved homes still on the market.

async def daily_alerts(day: date) -> None:
    fresh = await mls.listings(changed_since=day - timedelta(days=1), status=["Active"])
    for client in await profiles.active():
        matches = [l for l in fresh if passes_hard_filters(l, client.profile)]
        ranked  = rank(matches, client.profile)              # hybrid score, no LLM
        new     = [l for l in ranked if not sent_before(client, l)][:DAILY_CAP]
        if not new:
            continue
        reasons = await explain_fit(new, client.profile)     # one line per home, checked against the record
        await push.send(client, render_alert(new, reasons), respect_quiet_hours=True)
Daily alert job (simplified). Matching is deterministic; the model only explains the match.
06 · Layer 4 — Serving & quality

Fast on a phone, safe to release

A mobile client notices every second of latency and every outage. Serving changes delivered 30% faster responses and 99.9% uptime.

Async FastAPI + streaming
tokens reach the app as they're generated

MLS calls and retrieval run concurrently, and the client sees the answer start immediately instead of waiting for the full reply.

Model routing
Claude and GPT-4o, chosen per task

Lightweight steps like rewriting and classification take the cheaper, faster path. Open conversation and report writing use the stronger model.

Prompt caching
stable system prompt + tool schemas

The large, unchanging part of each prompt is cached, which cuts both latency and cost on every turn.

Releases on SageMaker
monitoring · rollback-ready

Every release is measured against the evaluation sets and watched in production. A regression is rolled back, not hot-fixed in a prompt.

07 · Trade-offs

Decisions I made, and what they cost

Vector index vs. live MLS

Rejected: index everything and answer from the index. Fast, but wrong whenever the market moves.

Chosen: an MLS call at answer time for anything that changes. A little slower; handled with concurrency and streaming.

LLM matching vs. code matching

Rejected: ask the model which new listings each client would like.

Chosen: filters and ranking in code; the model only explains. Cheap at scale and easy to debug.

Free-form agent vs. graphs

Rejected: one agent with every tool deciding its own path.

Chosen: separate LangGraph workflows. More upfront design, but failures are reproducible and recoverable.

More alerts vs. better alerts

Rejected: notify on every match to maximize engagement.

Chosen: dedupe, a daily cap, and quiet hours. Fewer pushes, but clients keep notifications on.

08 · Results & next steps

What changed, and what I'd do next

  1. 01Hallucinations down 75% on the evaluation sets, from query rewriting, hybrid retrieval, live MLS facts, and self-correction.
  2. 0230% faster responses and 99.9% uptime after async execution, streaming, prompt caching, and model routing on SageMaker.
  3. 03Clients get a daily alert when a matching home lists and a personal report every Friday, without an agent writing either one.
  4. 04Next: learn preference weights from tours and offers, not just saves, and let the Friday report suggest when a client's budget or area should change.

Want an assistant that follows up on its own?

Live data in, grounded answers out, and proactive updates your clients actually open. I can help you scope and build it.

Talk through your use case