Skip to content
AI Skills Central

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

Building with LLMs

Retrieval-augmented generation

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

Intermediate
Bookmark

Bookmarks are kept in your free account, so you can find this page again on any device.

Sign in to bookmark
On this page

Overview

Retrieval-augmented generation (RAG) answers questions from your own documents. Documents are parsed and split into chunks, the chunks are indexed (usually with embeddings, often with keyword search as well), and at question time the most relevant chunks are retrieved and placed in the prompt with an instruction to answer from them and cite them.

Most RAG problems are retrieval problems: bad parsing of PDFs and tables, chunks that cut ideas in half, or a search that misses the right passage. Building RAG well means inspecting what was retrieved, adding hybrid search and reranking when needed, and measuring retrieval and answer quality separately with a golden set of questions.

What you will practise

  • Parse and chunk documents while keeping headings and source locations
  • Inspect retrieved passages before blaming the model
  • Add hybrid search and reranking when plain vector search misses
  • Measure retrieval and answer quality separately with a golden set

Learning paths

  • AI foundations

    A free AI foundations course: the working vocabulary of modern AI, from prompting and structured output to retrieval, MCP, Agent Skills and prompt injection.

    Beginner3 h9 steps

  • Local models and fine-tuning

    Run open-weight models on your own hardware, use them on private documents, decide when fine-tuning beats RAG or long context, and try a small LoRA fine-tune.

    Intermediate11 h8 steps

  • RAG engineer

    A RAG course for engineers who want results they can measure: embeddings, pgvector, a pipeline built in a day, golden datasets, LLM judges and tracing.

    Intermediate14 h8 steps

Tutorials

  • Chunking strategies for RAG, tested

    Compare fixed-size, heading-based and semantic chunking on the same documents and questions, measure retrieval hit rate, and pick a strategy with evidence.

    Intermediate1 h

  • Hybrid search and reranking in Postgres

    Combine Postgres full-text search and pgvector with reciprocal rank fusion in one SQL query, rerank the top results with a cross-encoder, and measure the gain.

    Advanced1 h 15 min

  • Embeddings and vector search, hands on

    Embed documents, store them in Postgres with pgvector, index them and run similarity and hybrid search.

    Intermediate45 min

  • 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.

    Beginner30 min

Workflow recipes

Articles

Tools for this skill

9 of 27 tools tagged with this skill.

  • Amazon Bedrock

    AWS service for foundation models, RAG and agents.

    Models and local inferenceUsage-basedAmazon Web Services

  • Chroma

    Open-source embedding database that is quick to start locally, plus a hosted cloud.

    Retrieval and vector searchOpen sourceChroma

  • Crawl4AI

    Open-source crawler that turns web pages into clean Markdown or JSON for RAG and agents.

    Retrieval and vector searchOpen sourceCrawl4AI

  • Dify

    Visual platform for building and running LLM apps and agents, self-hosted or cloud.

    AutomationOpen sourceLangGenius

  • Docling

    Converts PDFs and office documents into structured output for LLM pipelines.

    Retrieval and vector searchOpen source

  • Faiss

    Meta's library for vector similarity search and clustering.

    Retrieval and vector searchOpen sourceMeta

  • Firecrawl

    Crawls and scrapes websites into LLM-ready Markdown or structured data.

    Retrieval and vector searchOpen sourceFirecrawl

  • Flowise

    Drag-and-drop agent and RAG builder, archived in August 2026.

    AutomationOpen sourceWorkday

  • Haystack

    deepset's Python framework for RAG pipelines and agents built from components.

    Agent frameworks and SDKsOpen sourcedeepset

Show 18 more

Key terms

Words you will meet while learning this, defined in the glossary.

Full glossary
  • Agentic RAG

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

  • Context precision and recall

    RAG retrieval metrics: precision is the share of retrieved chunks that are relevant, recall the share of needed facts found.

  • Contextual retrieval

    Adding a short, model-written note on where each chunk sits in its source document before embedding and indexing the chunk.

  • GraphRAG

    Retrieval-augmented generation that uses a knowledge graph of entities and relationships to connect related facts across many documents.

  • 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.

  • HyDE

    Hypothetical Document Embeddings: a model writes a fake answer to the query, and that answer's embedding is used to search for real documents.

  • Knowledge graph

    A structured representation of entities and the relationships between them, sometimes used alongside vector search to improve retrieval.

  • Query rewriting

    Using a model to turn a user's question into one or more better search queries before retrieval, to find more relevant results.

  • Reranking

    Re-scoring an initial set of retrieved results with a slower, more accurate model before passing only the best few on to the LLM.

  • Retrieval-augmented generation (RAG)

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