RAG
The RAG field guide
Retrieval-augmented generation from ingestion to cited answers: chunking, hybrid search and reranking, evaluation metrics, and choosing between pgvector and a vector database.
- Free PDF
- 5 chapters
- 42 min read
Get the PDF
Your download link appears after you submit.
What’s inside
Retrieval-augmented generation (RAG): a complete guide
How a RAG pipeline works from ingestion to cited answers, when long context or fine-tuning is the better choice, and the order to build things in.
Chunking for RAG: how to split documents so retrieval works
Fixed-size, structure-aware and document-type chunking explained with Python, plus a simple way to test chunk settings on real questions.
Hybrid search and reranking: getting the right passages to the model
Combine keyword and vector search with reciprocal rank fusion, then rerank with a cross-encoder. Includes the RRF formula, a worked example and code.
How to evaluate a RAG system: metrics, answer checks and test sets
Recall@k, precision and MRR with a worked calculation, faithfulness checks, building a test set from real questions, and validating an LLM judge.
pgvector or a dedicated vector database? How to choose
What pgvector supports today (HNSW, IVFFlat, limits, filtering) and a decision rule based on scale, filtering and operations.
Written by the SkillMaple editorial team from primary sources and reviewed by Bharathipriya Anandh, Co-Founder.