This post is for the engineers and technical product owners building a retrieval-augmented chatbot on top of a hospital website, and for the marketing leads who own the content it will draw from. It assumes you know what retrieval-augmented generation (RAG) is: documents are split into chunks, indexed, retrieved by similarity to a question and handed to a language model that composes the answer. The question here is how to split hospital content so the answers are right.
Hospitals are a hard case for naive chunking. The content is full of entities that change often: doctors who join, leave or change timings; packages whose inclusions and prices are revised; departments that open new services. A generic pipeline that crawls pages, splits them into fixed-size blocks and embeds them will answer "Which doctor treats knee pain?" with a fragment of a department page, a different fragment of a profile and last year's package. It will sound sure of itself throughout.
The argument of this post is that hospital knowledge should be stored as records for entities, not as blobs of pages. The sections below give a record design for doctors, packages and departments, the metadata that makes retrieval filterable, a freshness policy and an evaluation method. Examples use hypothetical data, labelled as such.
Why page-based chunking fails here
Three failure patterns recur.
Split entities. A page about a doctor includes qualifications, specialities, timings, locations and a biography. Fixed-size chunks cut across these. The chunk with the timings might not contain the doctor's name, so a question about timings retrieves a fragment no one can attribute.
Mixed entities. A department page lists ten doctors and fifteen procedures. A chunk may contain parts of three doctors' descriptions. The model blends them, and you get a plausible but wrong statement about who does what.
Stale truth. The page was updated but the index was not, or two versions of the same page coexist. The model has no way to know which is current.
A fourth, quieter problem: marketing prose. Text written to persuade ("renowned for compassionate care") is rarely what a patient asks about, yet it matches many queries and crowds out the factual chunks.
The unit of retrieval is an entity record
Instead of chunking pages, build a record per entity, derived from your source systems (CMS, doctor master, package catalogue), and chunk records.
For a hospital, the main entity types are:
- Doctor
- Department or service line
- Package (health check, procedure bundle)
- Location or facility
- FAQ item
- Policy (visiting hours, insurance acceptance, preparation instructions)
Each record has an ID, a type, a text body written for retrieval, structured metadata and a last-verified date. Think of the text body as a short, complete, standalone description, and of the metadata as the fields used to filter and to cite.
Doctor records
A doctor record should be understandable if it is the only thing the model sees. Include the doctor's name and designation in every chunk of the record, which is a form of contextual prefix.
Illustrative fields for a hypothetical record:
- id: a stable doctor ID from your master system
- name and designation
- department and sub-specialty, using a controlled vocabulary
- conditions treated and procedures performed, as lists
- languages spoken
- locations and consultation timings per location
- consultation modes: in person, video
- accepting new patients: yes or no, if you track it
- profile URL
- last verified
This mirrors the properties of a public vocabulary. The schema.org Physician type defines properties such as medicalSpecialty, availableService, hospitalAffiliation, isAcceptingNewPatients, openingHours and knowsLanguage. If your website already publishes structured data on doctor pages, reuse the same fields for the RAG record, so one source feeds both search markup and the chatbot, and they cannot disagree.
Chunk a doctor record into two or three chunks at most: a profile chunk (who they are, what they treat, languages) and a schedule chunk (where and when). Repeat the name, designation and department in both chunks. Keep timings in their own chunk because they change most often and need the shortest refresh cycle.
Package records
Packages are the most error-prone entity because they combine inclusions, exclusions, preparation, price and validity.
Illustrative fields:
- id, name, category (preventive health check, maternity, surgery bundle)
- inclusions as a list of tests or services
- exclusions and conditions
- price and currency, with an effective date, if the hospital allows quoting prices
- eligible age or sex, where relevant
- preparation instructions such as fasting, if clinically approved
- location availability
- valid from and valid to
- last verified
One rule helps a lot: never split an inclusion list across chunks. A chunk that holds half the tests under a package heading will cause the model to state an incomplete inclusion confidently. If a package is too long for one chunk, restructure it, for example into a summary chunk and a full-inclusions chunk that begins by naming the package.
Put the price and validity in the same chunk as the package name, and have the chatbot's instructions tell it to quote prices only from records within their validity dates and to show the verified date. If your policy is to avoid giving prices over chat, exclude the field and let the bot route the question to staff.
Department and service-line records
Department pages are narrative, which makes them the closest to ordinary document chunking. Even so, treat them as records:
- A summary chunk describing what the department treats and for whom.
- Condition and procedure chunks, one per item, each starting with the department name.
- A pointer list of doctor IDs and facility IDs rather than copies of their profiles. The model follows the pointers by retrieving those records.
This keeps one source of truth for each fact. Our guide to hospital service-line pages describes how to write the pages well, and the approach in department-level SEO applies the same entity thinking to search. A well-structured service-line page is also a good source for the record.




