RAG (pour débutants)

RAG = Retrieval-Augmented Generation. Before answering, the LLM 'reads' relevant documents from your base. Result: it answers from YOUR data, not its training memory. The basic chain fits in seven moves, laid out by [Bashiri Smith](https://www.instagram.com/reel/Dd9QONJlGEG/): start from the documents (PDFs, internal docs); extract the text and repair broken formatting (Unstructured); split into short passages (LangChain text splitters); turn each passage into a list of numbers carrying its meaning with an embedding model (Cohere); store those vectors next to the text in a vector database (Pinecone, Weaviate, or pgvector if you already run Supabase); at question time, embed the question too and search for passages with close meaning; send those passages and the original question to the LLM, which writes the answer. The trap that breaks everything silently: the question must be embedded with the same model as the documents, otherwise the comparison measures nothing.

Strengths

Limitations

Best for

Official site

View on Coeurdar