In the previous essays, we gave the actor an inference loop and followed its tool calls into the distributed system. That actor can interpret a request and ask other services to do work, but answering a question about the business also requires information those decisions can depend on. Someone asking whether a hotel booking needs approval expects an answer based on the company’s policy. A retrieval tool can supply the relevant material for inference, provided we have prepared the policy so that what comes back still means what the business wrote.
Preparing that information is ETL: extracting it from its sources, transforming it for the consumer, and loading it into a system that can serve it. Retrieval-augmented generation, or RAG, then selects material for a question and includes it in the model’s context to help produce an answer. The preparation has much in common with the pipelines we build for reporting and analytics, where the downstream use determines the representation we need. Here, the consumer is inference, often working from selected passages rather than a complete document. Following that change through ETL explains the work behind a retrieval tool before we choose a chunk size or a vector store.
The consumer determines what must survive
A reporting pipeline prepares data for an agreed representation of the business. An amount travels with a currency, an order line has a product identity, and dates have defined meanings. Those relationships let downstream queries join and aggregate records without having to rediscover what each field represents. Discarding the currency while retaining the amount can leave a perfectly loadable record that produces a meaningless financial report. Preparing data for the consumer includes preserving the relationships its calculations depend on.
Inference depends on relationships too, but it encounters them through whatever retrieval selects for the question. A document’s title may establish which product it describes, a heading may define the population in a table, and a note may qualify a rule several paragraphs earlier. A person reading the document can move between those elements. If the actor receives only a fragment, the model has to work from the relationships we carried into that fragment or make another request to obtain them. The preparation pipeline determines what remains available for either path.
Consider an invented travel policy with a table listing London at 180 and other UK locations at 140. Its heading establishes that the amounts are nightly limits in GBP, including tax, for standard rooms. A note says that exceeding a limit requires manager approval before booking. Returning London | 180 may match a search about London hotels, yet it leaves out much of what the model needs to answer the approval question. The number is useful only in relation to the conditions around it.
A BI consumer can recover related information through a schema and defined joins. For inference, the corresponding work is to make the relevant relationships available in the context supplied to the model. The questions will vary in wording, but we can still define the application’s purpose and prepare the information needed to support it. That gives us an output contract to work backward from: the hotel passage must communicate what the limit applies to and when approval is required, however we choose to extract, store, or retrieve it.
Extract the relationships as well as the words
To produce that passage, we first have to establish which policy we are reading. A current document, an archived version, and a proposed revision can all contain similar language and plausible limits. Extraction carries their identities and standing into the pipeline so the serving system can distinguish them. Otherwise, the model may receive competing statements without the information needed to tell an adopted rule from a proposal. Source selection is already part of ETL; the change here is that an unresolved distinction can become material from which inference constructs an answer.
Within the chosen source, the table heading supplies the units, the columns connect places to amounts, and the note explains when approval is required. Flattening the document into a string can retain every word while losing those associations. I would retain the sections, table headers, rows, and note references in a structured intermediate representation, giving the transformation step the relationships it needs to work with. The source format determines how we obtain that structure. Where it is explicit in XML or HTML, we can parse it directly; where it exists only in a scanned page, OCR or a model-assisted parser has to recover it from the layout.
The structured XML drug labels in my AI on AWS playground illustrate why that distinction matters. Their sections and tables are already represented in the source. Bedrock Knowledge Bases’ document ingestion path accepts formats such as HTML and Markdown but does not list XML among its supported formats, so those labels require conversion. We can preserve their known structure during that conversion instead of rendering it into a page and paying another model to discover it again. A scanned policy presents a different extraction problem, even if both sources eventually produce the same kind of retrieval passage.
In either case, validate the recovered structure before using it to divide the document. For the hotel policy, the amounts must still belong to the correct cities, and the approval note must still qualify the limits. Comparing extracted content with the source can reveal missing text, while checking the table relationships catches errors that word counts would miss. Once those relationships are represented correctly, transformation can decide which of them need to travel together into inference.
Package information that can be understood in pieces
The actor has a finite context and token budget, so sending the entire policy for every question has a cost. It also leaves the model to locate the relevant material inside everything we supplied. Dividing the document into smaller units, usually called chunks, gives retrieval something more focused to select. The transformation has to choose those units with the downstream reading in mind: a passage should be small enough to retrieve usefully while carrying the context needed to interpret what it says.
For the hotel table, a row can travel with its heading, column labels, and applicable approval note. Repeating that context is deliberate denormalization, placing information needed to interpret a record beside the record. We already prepare reporting data this way when the consumer should not have to reconstruct every relationship through joins. With inference, the same choice lets the model read the selected limit together with its units and conditions, even though the rest of the policy remains outside its context.
That does not require a separately wrapped passage for every row. Several rows may share one qualification, making the group a useful retrieval unit; a smaller search hit can also retain a link to a larger section that supplies its surroundings. The choice follows the source’s dependencies and the amount of material the actor needs to receive. Fixed overlap between chunks can help with nearby text, but a note outside the overlap still gets lost. I would start with the relationships, choose a unit that carries them, and use size limits to determine where further division is necessary. This gives chunking a purpose beyond satisfying an embedding model’s input limit.
The prepared unit also serves the software selecting it. Retrieval needs document identity, version, applicability, and access fields it can use to choose eligible passages, while inference needs the currency and approval condition in the content it receives. Some information serves both purposes, but the distinction affects where we put it. Writing “internal only” in the prose does not enforce access, and storing “GBP per night” in a field that never reaches the model does not explain 180. The transformation therefore produces both the passage to read and the metadata needed to serve it correctly.
Load for the way we intend to search
Loading makes that prepared representation available through the access paths the consumer will use. In a reporting pipeline, we load records into tables and establish the structures needed for queries. For retrieval, we store passages and metadata, then build indexes that can find them from a person’s question. Keyword search connects words to the passages containing them, so “London hotel limits” has a direct route to our policy. Someone asking “Do I need permission to spend more on accommodation?” presents the same information need with different wording, which gives us a reason to provide a search path based on meaning as well.
Semantic search uses an embedding model to produce that representation. During preparation, we pass each complete passage through the model and obtain a vector in its learned embedding space. The loader stores the vector in a searchable field or index, associated with the passage that produced it. At query time, a compatible embedding of the question lets retrieval compare its position with those of the stored passages. We will work through how those comparisons find useful material in the next essay. For this pipeline, the requirement is to generate and load a representation of the prepared passage, including the context that makes the hotel rule meaningful.
The text remains part of the loaded record because it is what inference will read after a match. The vector helps locate the rule; retrieval returns the passage, together with the source information and context the actor needs. Keyword and vector indexes can provide two routes to that same record within one service, as Azure AI Search does with vector and nonvector fields. We can choose the search implementation without changing the relationship between the searchable representation and the content supplied to the model.
This gives the load step a concrete completion condition. Each published passage needs its text, required search representations, and serving metadata in agreement. If the text was stored but embedding failed, the passage is not available through the same searches as one that completed both steps. The pipeline can reject that publication or explicitly support a text-only path, according to the application’s requirements. Either way, checking the loaded record against the intended representation tells us more than a batch job reporting that it finished.
Updates follow the same path. When version 8 changes the hotel limit, the load replaces the applicable passage and its search representations so the vector describes the text being served and the old rule is no longer presented as current policy. A staged index swap or a controlled incremental load can provide that publication boundary. Retaining the source and preparation recipe lets the pipeline rebuild the collection when a parser or embedding model changes, using the same checks as an ordinary update. ETL is maintaining the representation through which inference encounters the business’s information, just as it maintains the representation through which BI queries the business’s records.
Choose how much preparation to hand to a service
With the output defined, we can decide which parts of the pipeline to build and which to delegate. I would begin with representative sources and inspect whether the proposed ingestion path produces passages that satisfy the contract. The hotel limit gives us a concrete test: it must arrive with the applicable units, scope, and approval condition, and the correct policy version must be available for retrieval. A service that performs that preparation well can remove substantial implementation and operating work. The choice follows what the source needs and what the team already knows how to maintain.
For standard documents and a team without an established pipeline, the managed path in its existing cloud is a sensible starting point. On AWS, Bedrock Managed Knowledge Bases manages ingestion, storage, indexing, and retrieval infrastructure. An Azure team can use Azure AI Search’s Document Layout skill to produce structured Markdown or text within its indexing pipeline, while Google Cloud’s Document AI layout parser provides structure and context-aware chunks for downstream retrieval. These delegate different amounts of preparation, so the output inspection matters more than treating them as interchangeable boxes. The useful starting point is the supported path that fits the team’s platform and preserves the relationships in its sources.
An established data team may already operate source extraction, revision handling, and domain-specific transformations. I would extend that investment to publish a retrieval representation, keeping those responsibilities where the team understands them. Unusual formats or complex document relationships can also justify owning preparation further into the pipeline, then handing prepared material to a managed indexing service. That handoff needs the same inspection: if we attached an approval condition to a passage, downstream parsing must not split it away again. Whether our code or the service performs the transformation, the acceptance criterion comes from what inference needs to receive.
What the business must own
A small RAG demonstration often begins with information somebody has already made usable. They chose the documents, knew which versions mattered, and asked questions those sources could answer. Extending that result across the estate means turning their implicit knowledge into a repeatable preparation process. The ETL framing puts that work with the source owners and data teams who can establish what the information means, rather than treating it as an assumed property of the model platform.
I would start with a bounded information domain whose owner can resolve conflicting sources, agree which questions the application should support, and establish how quickly changes must become available. Those decisions give the pipeline a target and the operating team a responsibility it can actually fulfill. If a revision fails to load, the business needs an agreed response: continue with the known version where permitted, narrow what the application can answer, or withhold the affected material. Maintaining transformations, processing revisions, and resolving exceptions all belong in the cost of that service. Existing data and content teams may already carry much of the responsibility, so use their capability and fund the remaining work.
AI won’t fix your data, although it can help extract and organize it. Its output still needs an owner who can establish whether the transformation represents the source correctly and is fit for the intended use. When inference is the consumer, ETL must produce material that can be found and understood after retrieval separates it from its original surroundings. We now have a source, a prepared representation, and a serving system. The next question is how to search that system for the evidence worth putting in front of the model.