AI Search
Natural language search powered by vector embeddings + LLM re-ranking. Works for both properties and listings.
How It Works
"Pet-friendly villas in Goa for 6 adults this weekend under 20k"
│
├─ 1. Embed query → text-embedding-3-small → float[1536]
├─ 2. Vector similarity → pgvector cosine → top 50 candidates
├─ 3. Geo anchor → Google Places API → Goa coordinates
├─ 4. LLM re-rank → GPT ranks by relevance + extracts filters
│
└─ Result:
listingIds: [ranked by relevance]
checkInDate: "2026-04-05"
checkOutDate: "2026-04-07"
adultCount: 6
city: "Goa"
propertyType: "Villa"
budgetPerNight: 20000
petFriendly: true
Two Search Types
| Property Search | Listing Search | |
|---|---|---|
| Table | property_embedding | listing_embedding |
| Returns | Property IDs | Listing IDs + extracted filters |
| Combines with filters | No | Yes (merges with rawParams) |
| Endpoint | /api/v1/search/properties/search/ids | /api/v1/crs/listings/ai-search |
Caching
Same query on the same day returns cached results (no token burn):
Cache key: "2026-04-03:pet-friendly villas in goa this weekend"
TTL: 10 minutes
Max entries: 5000
Date is included in the key so "this weekend" resolves correctly across days.