Codele / LLMs, RAG and agentic AI
RAG: answers from your documents
Instead of hoping a model remembers the answer, look it up first and hand it over. This is retrieval-augmented generation, or RAG.
- RAG means look the answer up first, then hand it to the model inside the prompt.
- The steps are: question, find the most relevant passages, build the prompt, and the model answers and cites the passage.
- If nothing relevant is found, a good system says I could not find that instead of inventing.
- RAG cuts down invented answers but does not remove them. Weak retrieval or a misread passage can still go wrong.
- This is a toy: we find passages by counting shared words. Real systems usually use embeddings, as in the last lesson.
Loading the playable lesson…