Skip to content
AI Skills Central

Type to search Agent Skills, workflows, tutorials, tools and the glossary.

Retrieval-augmented generation (RAG)

Topic: Retrieval and RAGAlso called RAG

Definition

Retrieving relevant documents and adding them to the prompt before the model generates an answer from them.

In more detail

A RAG system has an indexing side (parse, chunk, embed, store) and a query side (search, optionally rerank, then generate with the retrieved passages). It lets a model answer from private or recent information without retraining.

When RAG answers are wrong, check retrieval first: most failures come from the right passage not being found.

  • Chunking

    Splitting documents into pieces sized for embedding and retrieval, ideally along natural boundaries such as sections or paragraphs.

  • Embedding

    A vector representation of text or other data that places items with similar meaning close together, so they can be searched by similarity.

  • Grounding

    Tying a model's answers to specific provided sources or retrieved data, so that each claim can be traced back to a source and checked.

  • Hybrid search

    Combining keyword search, such as BM25, with vector search and merging the results into one ranking, often with reciprocal rank fusion.

  • Agent memory

    Information an agent keeps beyond a single context window, such as user preferences, past decisions or task notes, and retrieves when needed.

  • Agentic RAG

    Retrieval-augmented generation in which an agent decides when and how to search, often running several searches and refining queries.

  • RAG fundamentals: retrieval before generation

    What RAG is and how retrieval-augmented generation works, when it beats long context or fine-tuning, and a minimal working pipeline in about 80 lines of Python.

    TutorialBeginner30 min

  • RAG pipeline in a day with Postgres and pgvector

    Ingest your documents, answer with citations and measure retrieval against 20 questions written first.

    WorkflowIntermediate1 day7 steps

  • RAG troubleshooting cheat sheet

    Why a RAG system gives wrong answers, and what to check first: wrong document, right document but wrong answer, missing recent data, slow queries, with fixes.

    Cheat sheetIntermediate

  • Retrieval-augmented generation

    Fetching relevant documents and adding them to a prompt to ground answers.

    SkillIntermediate