Skip to main content
All tutorials

The RAG Field Guide.

A visual route from documents to evidence-backed answers. Understand embeddings, see chunking strategies side by side and run a small baseline locally.

Visual chunking examples in the RAG Field Guide comparing how a sample PDF is split

Start with the right questions.

Independent educational project with synthetic documents. The model-free example demonstrates mechanics, not semantic understanding. Production data access, OCR quality and capacity need separate validation.

What is RAG?

Retrieval-augmented generation finds relevant evidence before asking a language model to answer. Its quality depends on ingestion, retrieval, context selection and answer generation; a better prompt cannot repair missing source material.

What is an embedding?

An embedding represents an input as a numeric vector. Learned embeddings can place related meanings near each other. Our simple model-free example illustrates vector arithmetic and similarity, but does not understand synonyms or meaning like a trained model.

Which chunking strategy should you use?

Start with the structure of the document. Preserve headings, clauses and tables where possible. Compare fixed-size, recursive and structure-aware chunks against representative questions; smaller chunks improve focus but can lose the context needed to interpret a passage.

How do digital and scanned PDFs differ?

Digital PDFs may contain extractable text, but layout, columns and tables can still cause errors. Scanned pages need OCR. Keep page references, inspect extraction quality and route low-confidence pages for review before indexing.

When does hybrid retrieval help?

Keyword search is useful for exact names, identifiers and specialist terminology. Dense retrieval can help with paraphrases. Hybrid retrieval combines the signals; evaluate retrieval and optional reranking on your own questions before choosing the extra complexity.

How do you change an embedding model?

Create a separate versioned index and re-embed the source chunks with the new model. Use the matching query model, evaluate both versions, switch traffic deliberately and retain a rollback path. Do not mix incompatible embedding spaces.

What should you evaluate?

Measure whether the retrieved passages contain the answer, whether citations support the response and whether the system declines unsupported questions. Track latency and cost alongside quality. Permission checks must apply before evidence reaches the model.

Run the complete interactive guide locally.

Install and start Docker, then run these commands. The first build downloads dependencies. Open http://localhost:8000 once the services are ready. The default lab uses model-free teaching vectors and returns quoted evidence; optional local-model instructions are in the repository.

git clone https://github.com/buildrlab/rag-tutorial.git
cd rag-tutorial
docker compose up --build

Need RAG for your own documents?

Tell us the outcome you need, what you already have and your target timeline. We’ll help define a useful first milestone.

Discuss your project