RAG content
Content Preparation for RAG Retrieval: Website Headings
Prepare website content for RAG retrieval with clearer headings, self-contained sections, and a fixed-query test that keeps outcomes honest.
10 min read

Content preparation for RAG retrieval starts with website headings that name the subject, followed by sections that carry enough context to make sense on their own. Publishers can make those source pages clearer and easier to test. They cannot guarantee a retrieval result or control a vendor's ingestion stack.
In practice, focus on three things:
- describe the entity, task, rule, or condition in each heading;
- keep the direct answer, essential context, and exceptions together;
- freeze a query set and compare retrieval, citation support, and answer completeness separately.
Who, how, and why. This guide is for documentation leads and web-content owners. It combines a review of Achla's current crawl and grounded-answer implementation, dated primary documentation, and a publisher-controlled test protocol. The protocol has not yet been run, so every outcome is unknown. The purpose is to help publishers test changes they control—not to suggest that headings guarantee better answers.
What makes website content easier to retrieve in RAG?
Retrieval-augmented generation, or RAG, uses retrieved source material to ground a generated response. A retrieval system may evaluate a passage independently from the full page around it. Microsoft's Azure AI Search documentation, for example, describes subdividing large documents so portions can be matched independently. That is a description of Microsoft's system, not a universal heading formula.
For a publisher, retrieval-ready content is therefore content whose important sections remain understandable when encountered with limited surrounding context. A useful section states its subject, answers one coherent question, names relevant conditions, and keeps critical exceptions nearby. Clear structure makes the source easier to inspect and the experiment easier to reproduce; whether it changes a particular RAG result must still be measured.
What should you edit—and what stays in the retrieval stack?
The safest starting point for RAG content preparation is a strict boundary between the source page and the vendor's backend.
| Publisher-controlled content | Vendor-controlled ingestion and retrieval |
|---|---|
| Visible headings and hierarchy | Parsing and chunk boundaries |
| Section subject and scope | Chunk size and overlap |
| Direct answers, prerequisites, and exceptions | Embeddings and embedding fields |
| Lists, labels, and meaningful text for visual facts | Metadata and indexing formats |
| Page accuracy, version, and internal links | Retrieval pipelines, reranking, and thresholds |
What can a website publisher change?
You can rewrite vague labels, split mixed-topic sections, move an answer closer to its heading, name the affected product or audience, and add visible text for essential information that appears only in an image. You can also preserve a logical website heading structure: one page topic, major H2 sections, and H3 subsections that narrow their parent.
These are editorial changes. If you want the commercial use case rather than the authoring method, see AI search for documentation.
What does the retrieval vendor control?
Vendors decide how their systems parse, split, represent, index, retrieve, and rank content. OpenSearch, for example, documents text chunking as an ingest-pipeline step that splits long text into focused passages within model constraints. That OpenSearch implementation is useful for understanding the boundary; it does not show that Achla exposes chunk-size or embedding controls.
This guide also does not cover installation or backend architecture. Read how to add AI search without building a backend for that separate task.
How can you audit headings and sections before rewriting?
Review the page as if each section might appear without the paragraphs above it. The goal is not to make every paragraph repetitive. It is to find passages whose meaning depends on hidden context.
| Symptom | What may be missing | Publisher action |
|---|---|---|
| Heading says “Overview,” “Notes,” or “Exceptions” | The actual subject | Name the entity, task, or rule |
| One section covers several products or roles | A coherent scope | Split by decision or audience |
| Paragraph begins with “it,” “this,” or “they” | An explicit referent | Restate the subject naturally |
| A rule appears far from its exception | The condition that changes the answer | Keep the exception with the rule |
| Important facts exist only in an image | Crawlable, visible text | Add nearby text or a suitable text alternative |
Which headings hide the subject?
Look for generic labels that work only because a reader remembers the previous heading. A synthetic weak heading such as “Limitations” becomes more useful as “Limitations of offline report exports.” The rewrite names both the topic and the type of information without forcing a template onto every page.
Which sections mix decisions or depend on missing context?
Ask whether the section changes product, role, region, plan, version, or procedure halfway through. Also separate a vocabulary problem from a structural one: if visitors ask with terminology different from the page, use the evaluation ideas in when visitors use different words. If the right words are present but scattered across unrelated decisions, improve section context instead.
Which facts are trapped in images, tables, or labels?
Essential facts should exist in meaningful visible text. AWS recommends clear headings, focused documents, section context, and text descriptions for graphics in its RAG documentation practices. Treat those as AWS recommendations, not proof of an outcome for your site. Tables can remain useful for readers; add nearby prose when a key rule would otherwise be ambiguous.
How should headings preserve the subject and scope?
Write website headings for RAG as you would write signposts for a busy human: specific enough to predict the section, short enough to scan, and nested according to the page's real organization.
| Synthetic weak pattern | Stronger publisher-controlled pattern | What becomes explicit |
|---|---|---|
| “Setup” | “Set up SSO for contractor accounts” | Task and audience |
| “Exceptions” | “Refund exceptions for annual plans” | Rule and plan |
| “Europe” | “Data-retention periods for EU workspaces” | Topic and region |
| “Troubleshooting” | “Why CSV exports omit archived records” | Problem and object |
How do you keep hierarchy descriptive rather than decorative?
Use one H1 for the page's main topic, H2s for its major questions, and H3s for narrower questions within each section. W3C explains that headings communicate content organization and that lower-ranked headings form subsections of higher-ranked ones. Follow that semantic heading hierarchy because it benefits page structure and navigation—not because W3C claims a RAG gain.
Where should the direct answer appear?
Put the answer in the first sentence or short paragraph below the relevant heading. Follow it with prerequisites, details, examples, then exceptions. A heading that promises “Refund exceptions for annual plans” should not begin with company history and reveal the exception four paragraphs later.
Where should conditions and exceptions live?
Keep scope beside the statement it changes. Name the plan, role, product, region, version, or effective date in the heading or opening sentence when it materially changes the answer. Do not hide a decisive caveat in a generic notes section at the bottom of the page.
How can each section make sense on its own?
A self-contained section carries the minimum context needed to interpret its claim. It is a coherent evidence unit for readers first; it is not a prescribed backend chunk.
What belongs together in one section?
Keep one topic, decision, or procedure together, including prerequisites and essential exceptions. Split unrelated subjects. In a synthetic policy page, the cancellation deadline and the exception for regulated accounts belong together; upgrade instructions belong elsewhere.
How much context should you repeat?
Repeat only what resolves ambiguity. Replace “It is available after 30 days” with “Audit-log export is available after 30 days” when the subject would otherwise disappear. Avoid repeating the full product name in every sentence or padding the section with keyword variants.
How should lists and tables be written?
Use lists for ordered steps or comparable items, with labels that preserve meaning. Use tables when rows and columns genuinely clarify a comparison. If a cell contains an essential rule, summarize it nearby in prose. Reader comprehension stays the priority; no format has a universal retrieval advantage.
How do you run a fixed-query before-and-after retrieval test?
Use a versioned, privacy-safe experiment that changes only publisher-controlled content. This content retrieval evaluation keeps the source-page change separate from backend behavior. Achla's current implementation crawls permitted public same-site pages and its primary grounded-answer path requires answer text with citations or returns a miss/fallback. Those bounded behaviors make source retrieval and citation observable; they do not promise a gain from restructuring.
How do you freeze questions and expected sources?
Choose an authorized connected site. Create query IDs, preserve exact wording, and name the canonical source expected to support each answer. Include realistic paraphrases and honest no-answer cases. Do not include personal, confidential, account, or secret data.
Synthetic input example:
| Query ID | Fixed query | Expected source | Expected evidence |
|---|---|---|---|
| SYN-01 | “When can contractors use SSO?” | /help/contractor-access | Eligibility rule |
| SYN-02 | “Does the site state a phone support SLA?” | none | Honest no-answer case |
What should the baseline record separately?
For each query, capture whether the intended source appeared, whether the citation actually supports the answer, and whether the answer is complete. Treat this as cited source testing, and do not collapse those fields into one “accuracy” score. For a deeper verification workflow, test whether citations support the answer.
What can change during the test?
Edit only headings, section boundaries, explicit subjects, nearby answer text, conditions, exceptions, and text alternatives. Save the content version and diff. Do not change chunking, schema fields, embedding or indexing formats, retrieval pipelines, reranking, or thresholds—or imply that Achla provides those controls.
How should you rerun the same questions?
Let the connected site's ordinary crawl and index flow process the approved page change. Record the actual observation time rather than promising a refresh interval. If crawl access needs diagnosis, use the separate AISearchBot crawl details. Then rerun the identical query version and capture the same fields.
| Field | Before | After |
|---|---|---|
| Intended source seen | unknown | unknown |
| Citation supports answer | unknown | unknown |
| Answer completeness | unknown | unknown |
| Content version | unknown | unknown |
| Observation time | unknown | unknown |
| Outcome status | unknown | unknown |
How should you interpret positive, null, negative, or mixed results?
Record every result, including no change and regression. A correct source can appear without a supporting citation; a supporting citation can accompany an incomplete answer. Structure is only one variable, so the result should be scoped to the tested site, content versions, query set, and observation times.
What if the correct source is absent?
Check whether the source contains the expected fact in visible text and whether the page was available to the normal crawl. The cause may involve content completeness, crawl/index state, or retrieval. Do not diagnose hidden vendor settings without evidence.
What if the source appears but the citation or answer is weak?
Inspect whether the cited passage supports the claim and whether the answer omits a condition or exception. That distinguishes retrieval from citation correctness and answer generation. A heading change alone is not evidence that generation will improve.
What if there is no change, a regression, or a mixed result?
Keep it. A null outcome may show that the original structure was already sufficient or that structure was not the limiting variable. A regression may justify reverting the diff. A mixed result may support a narrower revision. In every case, report the observation without selecting only favorable queries.
What belongs on a publisher's RAG content preparation checklist?
- Keep the page's RAG-and-headings intent clear.
- Give the page one descriptive H1.
- Use H2s for major questions and H3s for narrower scope.
- Put a direct answer close to each heading.
- Keep one coherent topic, decision, or procedure together.
- Name products, roles, regions, versions, and exceptions where they apply.
- Add visible text for essential image-only facts.
- Separate publisher edits from vendor-controlled ingestion.
- Freeze queries and expected sources before the content-only restructure.
- Record retrieval, citation support, and completeness separately—including negative results.
What are the limits, and what is the next step?
Descriptive headings and self-contained sections are testable source-content variables, not guarantees of retrieval, citations, answer quality, rankings, speed, traffic, or conversion. No before-and-after result exists for this guide.
To run the protocol on an authorized public site through the ordinary product flow, Connect your site. For adjacent reading, browse the Achla AI search editorial guides.


