An AI assistant for real estate sales
Search live listings, compare apartments, and talk to sales inside a 3D tour.
- Problem
- Buyers inside a 3D property tour had to jump between filter tables, 60-page PDF brochures, and lead forms just to check a price or book a viewing.
- My role
- I proposed and shipped the assistant end to end: LangGraph orchestration, SQL + pgvector retrieval, voice UX, browser actions, Salesforce sync, and LangSmith evals. The VisEngine team built the 3D platform.
- Solution
- A LangGraph agent that queries live inventory with SQL, grounds building specs via pgvector and a cross-encoder reranker, and drives the 3D camera through typed Pydantic UI actions.
- Outcome
- Shipped across 5+ luxury real-estate developments. We observed roughly 25% more apartment-viewing bookings after rollout.
Picture a buyer halfway through a 3D property tour. They stop on the sixth floor and ask two questions in one breath: “Do you have a two-bedroom above the fourth floor under €450,000, and can I install an EV charger in the garage?”
Here is the uncomfortable truth about standard AI chatbots: they fail on at least half of that sentence. Put apartment prices into a vector database and the model will eventually invent a discount or sell a unit that was reserved an hour ago. Use a rigid SQL filter and it has no idea what the 60-page building specification PDF says about garage amperage.
And even if a text widget answers both questions, the buyer is still staring at the wrong building. A real salesperson does not just talk; they walk you over to the right floor, open the architectural plan, and book the viewing while you are still interested.
I proposed and built the assistant that does all three inside the 3D tour. Examples and diagrams here use generalized project details under NDA.
A chatbot that only talks is half a salesperson
Every message reaches FastAPI with the buyer's current viewport attached: active building, floor plate, apartment ID, and camera angle. Before the model sees a single token, SQLAlchemy resolves those IDs into verified database records inside the LangGraph state.
When someone asks “Does this apartment have a terrace?”, the assistant does not guess from five turns ago. It checks the exact home on screen.
Each turn returns a dual Pydantic contract: a spoken or written answer, plus a typed UI command that moves the 3D camera, opens a floor plan, launches a 360-degree room tour, or draws a route on the map.
Never let an LLM guess a number that lives in SQL
Fact: language models are bad accountants. Another fact: real-estate buyers care deeply about exact numbers. So I split retrieval into two strict paths inside PostgreSQL.
For prices, square metres, floor levels, and availability, the inventory tools build parameterized SQLAlchemy queries backed by Redis. The model translates intent into filter arguments; the database returns the truth. Those exact rows populate both the assistant's reply and the comparison cards on screen.
For building specs, parking rules, and neighbourhood lore, I chunked project brochures by section and indexed them in pgvector. Search narrows candidates by building metadata first, then a cross-encoder reranker scores the top passages before anything reaches the prompt. Every client deployment lives in its own vector database and schema mapping, so one development never leaks into another.
The catch? When a buyer's filters return zero apartments, naive agents silently loosen the budget and show homes the buyer cannot afford. I changed the tool to diagnose which single constraint killed the match (floor level vs. budget) and ask the buyer which trade-off they want to make.
18 tools, four domains, zero prompt soup
Dumping 18 tools into one flat prompt is a reliable way to confuse a model and burn tokens. Instead, I grouped the graph into four explicit domains: five tools for inventory (search, compare, unit details, floor plan, payment plan), five for show homes (360-degree tours, room jumps, finishes, gallery, window views), six for exploration (masterplan, amenities, schools, commute routes, brochure RAG, map pins), and two for sales (lead capture and viewing slots).
And when a buyer simply taps “Show floor plan” in the UI? The intent is already clear. Deterministic routing in LangGraph skips the LLM entirely and invokes the handler directly, saving a full model round-trip.
Keep talking while the building turns
Typing on a phone while rotating a 3D building is no one's idea of fun. Buyers can hold the microphone button, speak naturally, review the transcript, or cancel mid-sentence. If someone taps and releases the button before the browser even finishes opening the microphone permission prompt, the state machine catches the release and closes the stream cleanly.
Voice and camera move on the same cue. When an interior tool opens a 360-degree kitchen panorama, the narration waits for the scene transition to settle, so the assistant starts talking about the island countertops the moment you are actually looking at them.
Handing a warm lead to a human, without stalling the chat
By the time a buyer asks for a callback, they have already told the assistant their budget, move-in date, and top two apartments. The sales tool validates their contact info with Pydantic, deduplicates against Salesforce, and attaches a clean summary of everything they cared about.
Want to talk right now? The backend spins up a live video room with screen sharing and a one-hour expiry, then pages the sales rep with the buyer's active apartment already open on screen.
Early on, slow Salesforce API calls froze the chat for seconds at a time. I kept Pydantic validation in the request path and moved CRM enrichment and transcript logging into background workers with retries. The buyer gets an instant confirmation; Salesforce gets the full story a moment later.
When “this apartment” meant the wrong building
Three-turn demos always look great. Fifteen-minute tours are where agents break. A buyer would inspect a flat in Building A, fly the camera over to Building B, and ask, “How big is the balcony on this one?” In LangSmith traces, we caught the model reading old tool outputs from Building A that were still sitting in the message history.
I rewrote the LangGraph state reducer to compact older tool outputs into rolling summaries and refresh the active apartment and building record on every single turn. Your budget and bedroom preferences follow you across the estate. Answers about “this apartment” are locked to what is on your screen right now.
Every bad answer becomes a permanent test
Whenever a production trace exposed an edge case, I turned it into a test case inside our LangSmith regression dataset. Before any prompt or tool change ships in GitLab CI, the pipeline replays multi-turn tours to verify tool selection, SQL filter accuracy, lead fields, and out-of-scope refusals.
In production, we track tool latency, time to first token and token usage alongside an automated evaluator that checks whether every claim about a building is actually backed by the retrieved pgvector passages.
The outcome
The assistant shipped across 5+ client projects, each wired to its own live inventory and document store. Across those deployments, we observed roughly 25% more apartment-viewing bookings after rollout.