Skip to content

RAG Technologies

Core technologies behind the RAG (Retrieval-Augmented Generation) pipeline — from raw document to generated answer.

Raw docs → chunk → embed → store → [query time] → retrieve → LLM → answer

1. Document Parsing

TechnologyRepresentative ToolsNotes
Multi-format parsingUnstructured.io, Docling (IBM)Layout-aware extraction from PDF/Word/HTML
PDF parsingPyMuPDF, PDFPlumberLow-level text/table/layout extraction
LLM-enhanced parsingLlamaParseCloud API for complex PDFs with tables and figures
PDF → MarkdownMarker, MinerUHigh-fidelity conversion, preserves structure
OCR cloud servicesAzure Document Intelligence, AWS TextractEnterprise-grade form and table recognition

2. Chunking Strategies

StrategyToolsNotes
Fixed-length chunkingLangChain CharacterTextSplitterSimple, breaks semantic boundaries
Recursive splittingLangChain RecursiveCharacterTextSplitterRespects paragraph → sentence → word hierarchy
Semantic chunkingLlamaIndex SemanticSplitterDetects topic boundaries via embedding similarity
Chapter-tree indexinghe-wiki-ragPreserves H1/H2/H3 hierarchy + breadcrumb path
Parent-child chunkingLlamaIndexRetrieve small chunks, return parent as context
Proposition chunkingCustom + LLMSplit into atomic facts — highest precision, expensive
Late ChunkingJina AIEmbed full document first, then split embeddings
RAPTORLlamaIndexRecursive tree summaries for hierarchical retrieval
Document-tree reasoningPageIndexLLM traverses summary tree — no vectors needed, 98.7% on FinanceBench

3. Embedding Models

ModelProviderNotes
text-embedding-3-large/smallOpenAIGeneral-purpose, 3072-dim large variant
Embed v3CohereOptimized for retrieval, 1024-dim
BGE-M3BAAI (open source)Multilingual, multi-granularity, strong Chinese
E5-Mistral-7BMicrosoft (open source)High-dim, top MTEB ranking
NV-Embed-v2NVIDIA (open source)MTEB leader among open models
nomic-embed-textNomic (open source)Fully open, local-friendly
jina-embeddings-v3Jina AI (open source)Supports Late Chunking

4. Vector Databases

DatabaseTypeNotes
QdrantOpen sourceRust, high-performance, strong filtering. 100k–10M scale.
MilvusOpen sourceBillion-scale distributed. Commercial: Zilliz Cloud.
WeaviateOpen sourceNative hybrid search (vector + BM25)
ChromaOpen sourceLightweight, embedded, best for prototyping
pgvectorExtensionVector search inside PostgreSQL
LanceDBOpen sourceArrow format, embedded, serverless-friendly
PineconeManaged SaaSServerless, zero ops

5. Retrieval Strategies

StrategyToolsNotes
Dense retrievalAll vector DBs (ANN)Cosine/dot-product semantic similarity
Sparse retrieval (BM25)Elasticsearch, OpenSearch, TantivyTerm-frequency keyword matching
Hybrid retrievalWeaviate, Qdrant, RRF algorithmDense + sparse, merged via Reciprocal Rank Fusion
Graph-augmented retrievalGraphRAG, LightRAGEntity/relation graph for multi-hop reasoning
Vector Graph RAGCommunityTriples vectorized instead of graph DB — 96.3% on HotpotQA
Agentic RAG (A-RAG)Custom + LLMAgent autonomously chooses keyword_search / semantic_search / chunk_read tools

6. Query Optimization

TechniqueToolsNotes
HyDELangChain, LlamaIndexGenerate hypothetical answer, use its embedding to retrieve
Multi-query / Query rewritingLangChain MultiQueryRetrieverLLM rewrites to multiple sub-questions
Step-Back PromptingLangChainAbstract specific question to general before retrieval
Self-RAGResearch implementationLLM self-evaluates retrieval quality, decides whether to re-retrieve
CRAGResearch implementationFalls back to web search for low-confidence retrievals

7. Reranking

ToolNotes
Cohere RerankCross-encoder commercial reranker
BGE Reranker (BAAI)Open-source cross-encoder, strong multilingual
FlashRankLightweight open-source reranker for local deployment

8. Orchestration Frameworks

FrameworkNotes
LangChainMost popular modular RAG pipeline framework
LlamaIndexData-centric RAG, richest chunking/retrieval strategies
HaystackEnterprise-grade NLP/RAG pipeline
DSPyProgrammatic LLM optimization, replaces hand-written prompts

9. Evaluation

ToolNotes
RAGASMost popular RAG eval — faithfulness, context recall, answer relevancy
DeepEvalUnit-test style RAG evaluation
TruLensProduction monitoring via RAG Triad
LangSmithLangChain's tracing and eval platform
Key metricsFaithfulness, Context Recall, Answer Relevancy, MRR, NDCG

See also: LLM Wiki Technologies · Paradigm Comparison

Released under the MIT License.