A marketing team needs content that reflects its workflow-automation product, proprietary insights, and current market developments. Generic language-model responses miss that context; manually searching scattered documents slows the work. Retrieval-augmented generation (RAG) connects the model to relevant information when it produces a response. section 7.1.2 section 7.0
RAG combines semantic search with language-model generation. Search retrieves relevant documents from a knowledge base; their contents augment the prompt; the model uses that context to answer a question or create content. This can improve specificity and factual grounding without retraining the model, but it does not guarantee accuracy or reproduce a brand’s voice on its own. section 7.3 section 5.4.3
Figure 7.9 Schema of a RAG system. Users prompt the system with a query, the results of which are fed into the embedding database. Those results generate an augmented prompt fed to an LLM, which generates a final response to the user query.
Trace the path from a user query through retrieved results and an augmented prompt to the generated response. section 7.3
A practical baseline separates the decisions that affect the answer:
- Choose a language model and construct a prompt that includes the retrieved chunks. Account for input-token cost and the model’s ability to use long contexts; decide whether answers should rely on database information alone or also draw on general knowledge. section 7.3.1
- Evaluate retrieval and generation separately, then assess the complete response. Search measures include precision, recall, and mean reciprocal rank; response checks include context relevance, groundedness, and answer relevance. section 7.3.2 section 7.4
- Refine weak results rather than treating the model as the only lever. Query expansion or classification can improve retrieval; prompt constraints can curb content unsupported by retrieved documents. Chunking, embeddings, lexical search, and metadata filters offer further retrieval options. section 7.3.3 section 7.4
A broad trend question
“What trends should we be aware of in AI?” may retrieve irrelevant industries. Expanding it into questions about SaaS platforms and workflow automation gives retrieval a more useful target. If the resulting report still introduces unrelated healthcare examples, prompt constraints can steer generation back toward retrieved evidence. section 7.3.3
RAG is an accuracy and relevance strategy, not a substitute for checking outputs. Keep evaluating with real user queries: a response that sounds confident but misses the customer’s domain can cost trust and require extensive editing. section 7.0 section 7.3.2































