Skip to main content

πŸ“ Retrieval Augmented Generation (RAG)

Description​

< What is it? >​

Retrieval Augmented Generation (RAG) is a technique that combines the power of large language models (LLMs) with external knowledge sources to improve the quality and relevance of generated content. By retrieving relevant information from a knowledge base or database, RAG enhances the model's ability to generate accurate and contextually appropriate responses.

Langchain helps to implement RAG by providing tools and frameworks for integrating LLMs with external data sources, enabling developers to build applications that leverage both the generative capabilities of LLMs and the structured information from databases.

< Main advantages >​

  1. Up-to-date knowledge β€” you don't need to retrain the LLM when documents change.
  2. Private knowledge β€” company documents can be supplied at query time.
  3. Reduced hallucination β€” the model can ground its answer in retrieved documents.
  4. Citations/sources β€” you can tell the user which documents support the answer.

Key points​

Architecture​

RAG architecture​

RAG architecture diagramRAG architecture diagram

Neo4j graph database​

graph db

Crash course​

Reference​