{
  "id": 21787012,
  "title": "Building a Kayak Hotel RAG Corpus in Python Without Mixing Booking Offers",
  "url": "https://urgent.news/2026/11/25/building-a-kayak-hotel-rag-corpus-in-python-without-mixing-booking",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-25T13:00:43.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/vexaloom-labs/building-a-kayak-hotel-rag-corpus-in-python-without-mixing-booking-offers-43k0"
  },
  "original_language": "en",
  "account": "To build a kayak hotel corpus in Python without mixing booking offers, it is essential to separate property facts from offer terms. Hotel records should be divided into descriptive retrieval text for property facts and separate structured evidence for the cheapest rate. This distinction is crucial for accurate retrieval and analysis.\n\nWhen creating atomic claims, it's necessary to ensure they have enough context to remain true. This approach involves collecting stay context alongside records, particularly when dealing with hotel searches that don't have fallback options when live access is blocked. Additionally, checking the run status message before interpreting an empty corpus can help determine if no matches were found.\n\nIn the example provided, hotel records contain property attributes, nightly and total prices, the cheapest-provider details, and up to 10 provider offers. Searches have specific parameters such as destination, dates, number of adults, and room count, along with sorting options. The Python script utilizes the ApifyClient to execute a search using these parameters and process the returned data accordingly.\n\nThe script defines several helper functions to canonicalize, digest, and pick specific values from the records. These functions assist in building stable identifiers for units and ensuring that only relevant fields are included. A custom `make_unit` function is also defined to create units with proper content identifiers, provenance, and grouping keys, ensuring that offer units correctly point to the source property unit.\n\nBy following these guidelines and utilizing the provided Python code structure, a corpus can be built that accurately separates property facts from offer terms, facilitating more precise language analysis and retrieval.",
  "summary": "The hotel is real; the offer your model assembled from its details may not be. You're turning hotel records into retrieval chunks, and the recommendation combines a cheap rate, a different provider, and free cancellation. Each detail looks plausible. The combination needs evidence. Lab note 155: can we preserve useful hotel context without letting retrieval assemble a booking option nobody…",
  "key_points": [
    "Separate property facts from offer terms in kayak hotel corpus",
    "Ensure atomic claims have enough context for accurate retrieval",
    "Utilize Python script with ApifyClient for parameterized searches"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}