GTM Engineering term, AI and agents

Retrieval-augmented generation

Retrieval-augmented generation (RAG) is a method where a system first retrieves relevant passages from a knowledge source and then has a language model answer using those passages.

Also called: RAG, retrieval augmented generation, grounded generation

Retrieval-augmented generation sits under every stage: it's part of the data and systems the whole funnel runs on, near related terms like Embeddings, Vector database and Hallucination (the blue squares).

Retrieval-augmented generation (RAG) is a pattern where an AI system first searches a knowledge source for the passages relevant to a question, then gives those passages to a language model to write the answer. It keeps answers tied to your actual documents, which cuts hallucination and lets you update what the AI knows without retraining anything.

How it works

RAG has an indexing phase and a query phase.

Indexing (done ahead of time):

  1. Collect sources: product docs, security questionnaires, case studies, pricing rules, call notes.
  2. Split them into chunks, often a few hundred words each, keeping headings attached.
  3. Turn each chunk into embeddings, numeric vectors that capture meaning.
  4. Store the vectors and the original text in a vector database or a search index.

Query (every request):

  1. Embed the user's question the same way.
  2. Retrieve the top matching chunks, often 3 to 10, sometimes mixing vector search with keyword search.
  3. Optionally rerank them so the best few go first.
  4. Insert them into the prompt with instructions like "Answer only from the sources below and cite them. If the sources don't cover it, say so."
  5. The model answers inside its context window, citing chunk IDs.

Example

Say a sales team fills out 30 security questionnaires a quarter, each with about 150 questions. A sales engineer spends roughly 6 hours per questionnaire, or 180 hours a quarter (assumption).

They index their SOC 2 summary, policies and the last 20 completed questionnaires. The RAG tool drafts every answer with a cited source. In review, the engineer accepts about 70% of drafts as-is and edits the rest, cutting time to around 2 hours per questionnaire. That is 30 × 4 hours saved, or 120 hours a quarter. At a loaded cost of $90 an hour, about $10,800 a quarter goes back into live deals. The cited sources are what make the review fast: the engineer checks the passage instead of hunting for it.

RAG vs fine-tuning vs long context

RAG answers "what does the model know right now". Fine-tuning answers "how does the model behave". Long context windows let you skip retrieval for small corpora by pasting everything in, which is simpler but costs more per call and gets less precise as the pile grows.

Our view for GTM teams: start with the simplest retrieval that works, often keyword search plus a well-organized doc set. Add vectors and reranking when answers start missing relevant documents. Most RAG problems we see are content problems (outdated docs, three conflicting pricing pages), not model problems. That is a sales enablement cleanup job as much as an engineering job.

Common mistakes

  • Indexing every document ever written, including stale pricing and retired features.
  • Chunking without headings or titles, so retrieved passages lose the context that gives them meaning.
  • No instruction to say "not in the sources", which invites the model to fill gaps from memory.
  • Never testing retrieval on its own, so you can't tell if a bad answer came from search or from the model.
  • Skipping access control, so a rep's assistant can surface board decks or HR files.

FAQ

What is RAG used for in sales and marketing?

Common uses are sales assistants that answer product and security questions from your docs, RFP response drafting, support deflection, and content tools that stay on-message by pulling from approved positioning. Anywhere the answer lives in your own documents is a RAG candidate.

Is RAG better than fine-tuning?

For knowledge, usually yes. RAG lets you update facts by updating documents, and it can show sources. Fine-tuning is better for teaching a consistent style or a narrow task format, and the two can be combined.

Do I need a vector database to do RAG?

Not always. Small knowledge bases can use keyword search, a spreadsheet lookup or simply paste the whole document into a large context window. A vector database becomes worth it when you have thousands of documents and need meaning-based search.

See all AI and agents terms ↳

Used in these articles