rag training

guides Mar 23, 2026 5 min read

retrieval-augmented generation (rag) is when an llm uses a search tool to find relevant information before answering a question. a rag agent can be finetuned to a specific corpus, learning to formulate better search queries and reason more effectively over your data. castform provides the full pipeline for this, from chunking documents through training.

rag step-by-step

next steps

for more detail on each stage of the RAG pipeline: