Skip to content

AI and AgentsSimplified view

RAG pipeline

How retrieval-augmented generation works end to end, from loading documents into a vector store to answering a question with the closest passages.

  • RAG
  • Embeddings
  • Vector search
  • LangChain

8 stepsPress play, or use next and previous to follow the flow one step at a time.

All steps

What this shows

Retrieval-augmented generation (RAG) lets a model answer from your own documents instead of relying only on what it learned in training. The top row is the indexing path, prepared ahead of time. The rest is the answering path, which runs on every question.

Design notes

  • Index once, query many times. Loading, splitting and embedding happen before anyone asks anything.
  • Chunk size matters. Passages that are too large dilute the match, and passages that are too small lose context.
  • Grounding reduces guessing. Giving the model the retrieved text lets it answer from the source and makes the answer easier to check.

RAG is one of the core patterns in LangChain in Action. This is a simplified view.

More workflows

Test Automation

NL2Test, from a sentence to a Playwright test

How NL2Test turns a plain-language description into an executable Playwright test, with a model planning the test and an MCP server driving a real page.

10 steps 9 parts Simplified view

AI and Agents

How an MCP request flows

A walk through one Model Context Protocol request, from the client through authentication, memory and the model to a server that coordinates tools.

8 steps 8 parts Simplified view

AI and Agents

Multi-agent supervisor

A supervisor agent receives a request, hands sub-tasks to specialist agents one at a time, keeps shared memory, and combines their results into one answer.

8 steps 7 parts Simplified view