What is Retrieval-Augmented Generation (RAG)?

What is it?

Retrieval-Augmented Generation (RAG) is an architecture that combines two steps:

  1. Retrieval — find relevant information from a Knowledge Base
  2. Generation — use an LLM to write an answer based on that information

"Augmented" means the LLM's answer is augmented with retrieved facts from your documents, not only its pre-trained knowledge.

Why does it exist?

Raw LLMs have limitations for business use:

  • They may hallucinate (confident but wrong answers)
  • They lack up-to-date or private information not in training data
  • They cannot cite your internal documents unless those documents are provided at query time

RAG addresses this by retrieving real content first, then asking the LLM to answer using that content.

How does it work conceptually?

User question ↓ Retrieve relevant chunks from Knowledge Base ↓ Build prompt: question + retrieved chunks ↓ LLM generates answer grounded in those chunks

Example

Knowledge Base: equipment manuals.

Question: "What maintenance is required after 500 operating hours?"

RAG retrieves the section about the 500-hour service interval, passes it to the LLM, and the LLM writes a clear answer based on that section.

Search, retrieval, RAG, and Chat

These terms are related but not identical:

Concept Role
Search Finds relevant information and presents it (snippets, links, ranked results)
Retrieval Selects content for a downstream process (may not show results directly to the user)
RAG Retrieval + generation — finds content and produces a synthesized answer
Chat Conversational interface; may use RAG underneath for each turn

Noulek Search emphasizes finding and displaying matching content. Chat uses retrieval plus LLM generation for conversational answers, often with source attribution.

Where does it fit in a RAG pipeline?

RAG is the full pattern connecting preparation, storage, retrieval, and generation:

Knowledge Base → Index → Retrieve → Generate → Answer

Individual concepts (chunks, embeddings, vector databases) each support one part of this pipeline.

How this relates to Noulek

Noulek is a RAG system for WordPress:

  • You build a Knowledge Base by uploading documents.
  • Noulek indexes them for semantic retrieval.
  • Search returns relevant indexed content.
  • Chat retrieves context and uses the configured LLM to generate answers.

Both require LLM and Vector DB configuration. See How does RAG work? for the step-by-step flow inside Noulek.