Chapter 059 min read
Data & intelligence layer
Zilia's intelligence is not a bigger model. It is a structured memory of each traveler, a travel knowledge graph, proprietary price history, and one strict rule: models explain decisions, while data and code make them.
Key decisions in this chapter
Ranking is learned, not generated: gradient-boosted learning to rank decides the order; a model writes the explanation.
Travel DNA is typed and inspectable: every preference has a value, a confidence and a source.
The knowledge graph lives in Postgres first. A graph database only if traversal needs prove it.
Every search writes to price history from day one. By month six it is pricing intelligence nobody else has.
The model never types a number the traveler pays. Prices, times and policies render from data.
5.1
Travel DNA: preference modeling
A typed profile that improves with every trip, scoped so that business habits never leak into family holidays, and visible to the traveler at all times.
// One profile per traveler, scoped by trip typeTravelDNA { companions: [{ id: "c_ana", relation: "partner" }, { id: "c_mia", relation: "child", age: 3 }] hard: [{ key: "no_red_eye", value: true, source: "stated", confirmed: "2026-11-02" }] soft: [{ key: "hotel_style.boutique", weight: 0.72, confidence: 0.81, source: "inferred" }] value_of_time: { currency: "EUR", per_hour: 38, confidence: 0.6 } budgets: { city_break: [600, 1200], family_summer: [3500, 5500] } comfort: { seat: "aisle", max_layover_min: 150, red_eye_ok: false } pace: "balanced" loyalty: [{ program: "airline", tier: "gold", number: "vault:ly_19" }] risk: { refundability_bias: 0.7 } scopes: ["leisure", "family", "business"]}| Signal | Example | Weight | Decay |
|---|---|---|---|
| Stated | "I'm vegetarian." "Never connect in Frankfurt." | Highest, written at once | None until changed |
| Choice | Picked the boutique hotel over a cheaper chain | Medium, as a pairwise preference | 12-month half-life |
| Behavior | Opened every review that mentions noise | Low | 6-month half-life |
| Outcome | Rated a stay 2 out of 5 for noise; complained about a 45-minute connection | High | 24-month half-life |
| Context | Business trip or family holiday, with or without kids | Scopes all the others | Not applicable |
Solving the cold start
Sixty-second Travel DNA
Six visual either-or choices during onboarding: boutique or chain, early or late, packed or slow.
getmyhotels history
With consent, past bookings seed hotel style, budgets and favorite cities from day one.
Forward your confirmations
Travelers forward booking emails to their own Zilia address. No mailbox access to request, and the traveler stays in control.
Link loyalty programs
Status and points shape routing and hotel choices from the very first trip.
The ranking pipeline
- 01
Candidates
Supplier search plus hard-constraint filters. Anything that breaks a must-have never enters ranking. - 02
Features
Price against the market, distance to the traveler's anchors, review aspects, preference fit, supplier reliability, flexibility. - 03
Learning to rank
A LightGBM LambdaMART model trained on choices and outcomes, with margin excluded as a feature. - 04
Diversify
Three candidates that differ in a meaningful trade-off, never three near-duplicates. - 05
Explain
A small model writes the why, grounded in the features that actually drove the rank.
5.2
Knowledge graph and structured memory
A graph of places, properties and people that lets Zilia say 'a quiet courtyard room near a neighborhood like the one you loved in Lisbon', with every word grounded.
- Mayavisited, loved itAlfama, Lisbon
- Alfama, Lisbonsimilar_to 0.86Gràcia, Barcelona
- Gràcia, Barcelonanear, 6 min walkHotel zh_88412
- Hotel zh_88412has_room_typeCourtyard rooms (quiet)
- Mayaavoids, after Rome 2025Street-facing rooms
- Hotel zh_88412mapped_togetmyhotels, Rapid and Hotelbeds codes
Entities
- Traveler
- Trip
- Booking
- Destination
- Neighborhood
- Place of interest
- Hotel (canonical)
- Room type
- Airport
- Airline
- Route
- Supplier
- Event
- Season
Relations
- located_in
- near (walk minutes)
- good_for (tag)
- similar_to
- served_by
- mapped_to (supplier codes)
- has_room_type
- visited (with rating)
- avoids
- reliability_of
- Depth over breadth: the 30 launch destinations get editor-reviewed neighborhood profiles covering vibe, walkability, family fit, nightlife and safety notes. Thirty destinations done brilliantly beat three thousand done generically.
- Built with AI, checked by people: profiles are drafted by extracting from licensed content and verified by editors before any agent may cite them.
- Supplier reliability scores per supplier and property: booking failure rate, amendment speed, overbooking incidents and mismatched rooms. They feed ranking and supplier routing.
5.3
Pricing intelligence and optimization
Every search Zilia runs becomes a price observation. Together with getmyhotels' booking history, that turns into pricing intelligence competitors cannot buy.
MVP
- All-in normalization: taxes, resort fees, currency
- De-duplication across suppliers: same room and terms, best net rate wins
- Deal badges grounded in history, such as 18% below this hotel's 60-day median
- Re-shop scheduling for Price Guardian
Phase 2
- A fair-price index per hotel and date
- Fare-trend signals per route, such as fares usually rise in the last 21 days
- Dynamic packaging: package rates unlocked with a flight, where contracts allow
- Markup optimization within a band, never above public parity
Phase 3
- Buy-or-wait predictions with calibrated confidence
- Demand-aware prioritization of Price Guardian re-shops
- Negotiated rates backed by aggregated Zilia demand
// Total-trip optimizer, solved for every set of candidatesminimize all_in_price + value_of_time × extra_hours + risk_weight × risk_penaltysubject to every hard constraint in the TripBrief the budget ceiling supplier and fare rules- Margin never boosts rank beyond breaking a tie between equivalent options.
- Never hide the cheaper equivalent. If the same room is cheaper elsewhere in our supply, the traveler sees it.
- Upsell only on value: an upgrade is offered when its value per dollar clears a threshold for this traveler, never by default.
- Name the supplier on every booking, so the traveler knows who holds their reservation.
5.4
Safety and hallucination control
Booking actions are where a hallucination becomes a financial loss. The defense is structural: models can propose, only code can commit, and every number comes from data.
Model side · proposes
Agents reason over grounded options
BookingIntent@1 { items, quote_ids, total, travelers: vault refs }
Verifier: constraints, policy and Mandates
Code side · commits
Transaction Service: six gates, all must pass
- 1
Fresh quote
The quote exists and is under 10 minutes old, and it is re-priced live at commit.
- 2
Price within tolerance
The live total matches what the traveler approved, within the absorb limit.
- 3
Valid approval
A signed token from a traveler tap or an active Mandate, bound to amount, items and expiry.
- 4
Right travelers
Names and documents from the vault match the booking exactly as on passports.
- 5
Policy check
Cancellation terms shown word for word, entry rules met, supplier rules respected.
- 6
Limits and idempotency
Spend limits per traveler, per Mandate and globally, and an idempotency key on every write.
Only then: suppliers, payment capture and confirmations
Slot-filled rendering
Numbers, times, names and policies render from structured fields. The model writes the sentence around placeholders such as {offer.price}; it never types the value.
Grounded claims
Every factual claim about a place, rule or supplier must cite a tool result or a knowledge-graph entity. The Verifier strips or flags anything unsupported.
Structured handoffs
Messages between agents are structured outputs validated against schemas. Free text never crosses an agent boundary.
A second opinion for high stakes
Recovery actions and cancellations get an independent cross-check by a second model before they reach the commit boundary.
Prompt-injection defenses
- Supplier descriptions, reviews, emails and web pages are untrusted data, read by a quarantined model with no tools.
- Write tools need approval tokens that no text can produce, so an injected instruction cannot book, cancel or pay.
- Browsing, where allowed, is limited to allow-listed domains, and every fetched page is logged.
- Injection test suites run on every prompt and model change.
| Layer | What | When |
|---|---|---|
| Golden scenarios | 500 trip requests across personas, each with expected constraint outcomes | Every prompt or model change |
| Simulated travelers | Model-driven travelers for multi-turn conversations, including confused and adversarial ones | Nightly |
| Shadow mode | New agents and Mandate types run silently beside production | Two weeks before they may act |
| Online metrics | Constraint satisfaction, grounding rate, booking success, recovery time, escalation rate, cost per trip | Continuously, with alerts |
| Red teaming | Prompt injection, fraud and abuse attempts | Before every new autonomy level |
| Human review | A daily sample of conversations, plus every autonomous action above a threshold | Daily |
5.5
Compliance
Being a real agency means real obligations. Most are known and manageable if they are designed in from week one rather than bolted on before launch.
| Area | What it means for Zilia | When |
|---|---|---|
| Seller of Travel (US) | Register in California, Florida, Washington and Hawaii, and wherever else required, before selling to their residents. | Before US launch |
| Package travel (EU and UK) | Selling a flight and a hotel together can create a package or a linked travel arrangement under the EU Package Travel Directive, with insolvency protection and liability, and ATOL rules apply in the UK. Choose the entity, insurance and bundling design before bundles launch in Europe. | Decide in weeks 1 to 4 |
| Price display | All-in prices that include mandatory fees, as the US FTC rule on hotel fees and EU consumer law require. | MVP |
| Payments | PCI DSS scope minimized with Stripe and the vault; Strong Customer Authentication with 3-D Secure in Europe. | MVP |
| Privacy | GDPR and CCPA rights, data processing agreements with every model provider, and memory deletion that reaches backups. | MVP |
| AI transparency | Tell travelers they are talking to an AI, label AI-generated content and keep a human escalation path, in line with the EU AI Act. | MVP |
| Messaging consent | WhatsApp opt-in and template policies, and SMS consent rules such as the TCPA in the US. | MVP |
| Accessibility | WCAG 2.2 AA for the web app and, later, the mobile apps. | MVP |
getmyhotels already operates as a hotel seller, so parts of this exist today: payment flows, supplier contracts and customer-service obligations. What is new is flights, bundling, autonomous actions and AI transparency, and those deserve a named owner from the first sprint.