Skip to main content

Property AI Search API

RAG-powered natural language search for properties (lower-level than listing search).

Base path: /api/v1/search/properties or /api/v1/properties


Search Properties by Query

POST /api/v1/search/properties/search/ids
{ "query": "Pet-friendly villa in Goa near beach for 6 people" }

Response:

{
"propertyIds": ["prop_abc", "prop_def", "prop_ghi"],
"checkInDate": "2026-04-05",
"checkOutDate": "2026-04-07",
"adultCount": 6,
"childCount": null,
"infantCount": null
}

How it works:

  1. Query embedded via text-embedding-3-small
  2. pgvector cosine similarity finds top 50 property candidates
  3. Geo anchor resolved from query (e.g., "Goa" → coordinates)
  4. LLM re-ranks by relevance and extracts dates/guests
  5. Cached by date:normalized_query for 10 minutes