What is RAG (Retrieval-Augmented Generation)?+
RAG is a technique where an LLM retrieves relevant documents from a knowledge base before generating a response. This grounds the model in real, up-to-date information and reduces hallucinations.
LlamaIndex vs LangChain for RAG — which is better?+
LlamaIndex is purpose-built for RAG and offers more retrieval primitives (hybrid search, query routing, reranking). LangChain is better if you need RAG as part of a larger agent pipeline.
What vector databases work best with RAG agents?+
Chroma and FAISS are popular for local development. Pinecone, Weaviate, Qdrant, and pgvector (PostgreSQL extension) are production choices. Most RAG frameworks support multiple backends.
How do I improve RAG accuracy?+
Key techniques: chunking strategy (semantic > fixed-size), embedding model choice, hybrid search (dense + sparse), reranking with a cross-encoder, and query expansion. Evals with RAGAS help measure improvements.