Modularity divides a complex system into separate components, each responsible for a distinct function. In generative AI, retrieval, generation, validation, and safety filtering can operate as coordinated parts rather than one end-to-end model invocation. section 10.20
Separating responsibilities gives developers more control: they can intervene in one component, inspect failures, or modify a pipeline without redesigning everything. The tradeoff is added complexity. Coordination can create new failure points and make overall behavior harder to interpret, so modularity does not automatically improve reliability. section 10.20 section 8.24
A modular AI pipeline
One component retrieves relevant documents, another generates a draft, and a final layer screens the response for safety. In agentic systems, modular design can also support human-in-the-loop processes and evaluation suited to long-term, open-ended behavior. section 10.20 section 8.24
Figure 10.4 A schematic diagram for an LLM accessing data stored in a vector database and retrieving search results from the web
Use the schematic to visualize how retrieval can function as one module within a larger language-model system. section 10.20









