RAG & Retrieval
From documents to context: every stage is a design decision
- Documents
- Embedding
- Vector store
- Retrieval
- LLM
01
The Pipeline
Retrieval-augmented generation is a pipeline, and answer quality is decided long before the LLM sees anything.
In
Documents
01
Parsing
02
Chunking
03
Embedding
04
Vector store
pgvector · Milvus · Zilliz
05
Retrieval
06
Context construction
Out
LLM
A standard RAG pipeline. Each stage has its own failure modes.
02
Vector Stores
- PostgreSQL + pgvector — vector search next to relational data, in one database.
- Milvus — a dedicated vector database.
- Zilliz — managed Milvus.
03
When Not to Use RAG
Not every document problem is a retrieval problem. On structured engineering data, deterministic matching beats similarity search — see Engineering Document Intelligence.
04
Future Experiments
- Hybrid search (keyword + vector)
- Reranking
- Context compression
- Retrieval evaluation