Listing intelligence: LLM-cleaned listings and ranking inside the database
Listings arrive from many sources in inconsistent shapes, and search must balance relevance with paid placement. We built an LLM pipeline that normalises, validates and de-duplicates listings with an agent reviewing under fail-closed rules, and replaced two search engines with ranking inside the database.
- Period
- Sep 2024 – present
- Duration
- 2 years, ongoing
- Role
- Engineering Manager – Backend Lead
- Organisation
- HouseNow, Housenow JSC
- Team
- Team work I led; two engineers wrote most of the pipeline code
Results
| Figure | Measure |
|---|---|
| +50% | meaningful user actions from the AI features2025: ranking, personalisation and LLM listing enrichment together. |
| 2× | data-cleaning throughputAutomated intake and review replaced manual clean-up. |
| 3 | search backends in nine months; the last one is the primary database itselfA hosted engine, then a self-hosted one, then vectors in the database (Mar–May 2025). |
Context and constraints
HouseNow lists apartments, houses and land across Hanoi and Ho Chi Minh City. Listings arrive from many sources with missing fields, inconsistent prices and duplicates.
Search has to mix three things: what the user asked for, what they have shown interest in, and business signals such as boosted, verified and paying listings.
- Moderation could not grow with volume.
- Ranking had to be explainable to brokers who pay for placement.
- Model spend had to stay predictable.
My role and decision rights
I started the intake application in November 2024, moved search from the hosted engine to a self-hosted one, then led the change to ranking inside the database and wrote its design documents.
A teammate designed and built the agent that reviews listings; I hardened it with durable outcomes, guard fixes and a daily concurrency cap. Two engineers wrote most of the pipeline code.
Decision rights: search and ranking architecture, and the rules a listing must pass before it is published.
Architecture
Decisions
Rank inside the database instead of syncing a search engine
Each external engine was another copy of the data to keep in sync and another bill.
| Option | Assessment |
|---|---|
| A hosted search service | Powerful, and every listing synced twice. |
| A self-hosted search engine | Cheaper, and one more system to run. |
| Engineered vectors and ranking inside the primary database (chosen) | One copy of the data. |
Each listing becomes a 32-dimension engineered vector (location, price, bedrooms, area, plus weights for boosted, verified and paying listings). Each user's last 200 actions, weighted from a view up to contacting a broker, form preference vectors clustered into at most two intent centroids. Ranking uses a hybrid distance: 60% features, 40% business weights.
Gained
- One less system to sync, and its bill gone.
- Ranking can be explained to brokers, number by number.
- No model hosting.
Paid
- Less semantic than learned embeddings.
- Weaker full-text search than a dedicated engine.
Let an agent review listings, but fail closed
LLM extraction is fast and occasionally wrong, and a wrong price published under the brand damages trust.
| Option | Assessment |
|---|---|
| People moderate every listing | Accurate, and it scales with headcount. |
| Publish whatever the LLM extracts | Fast, and wrong prices go live. |
| An agent applies explicit rules; anything outside them goes to people (chosen) | Throughput with an audit trail. |
An agent runs a written review workflow. For example, a land price per square metre must fall inside the 10th–90th percentile band of at least 15 approved listings of the same type in the same ward over 180 days. Evidence is hashed, attempts are versioned, outcomes are stored durably, and daily review concurrency is capped.
Gained
- Throughput without a moderation team.
- Every decision can be audited.
Paid
- Strict rules send more listings to people.
- The rules need tuning per region.
Outcomes
- Meaningful user actions rose by 50% in 2025 from the AI features, and data-cleaning throughput doubled.
- Production AI across the two marketplaces: LLM listing extraction, a conversational assistant for brokers, vehicle valuation, vector recommendations and licence-plate blurring.
- The self-hosted search engine was removed in May 2025; ranking moved to PostgreSQL with pgvector during the 2026 migration.
What I would do differently
Hold out a control group from the first ranking release, so the effect of ranking can be separated from the other AI features shipped the same year.
Stack
- Gemini on Vertex AI
- PostgreSQL, pgvector
- K-means clustering
- Codex (agent review)
- Next.js, Workflow SDK
- BigQuery, Metabase