RAG in AI: LangChain and LangFlow
Build assistants that answer from your documents, with LangChain and LangFlow.
- Duration
- 21 h · 3 days
- Level
- Advanced
- Format
- On site · Remote · Blended
- Max. group size
- 12 participants
Overview
This program explains and puts into practice RAG (retrieval-augmented generation), the technique that lets a language model answer from an organization's documents. Participants build a complete system: ingestion, chunking, embeddings, vector database, retrieval and generation. They first build it in code with LangChain, then visually with LangFlow, before tackling quality improvement and going to production.
Who this program is for
- Developers, data analysts and engineers wishing to build assistants on their data
- Architects and technical project managers involved in AI projects
- Training centers offering an advanced AI path
Prerequisites
- Programming basics, ideally in Python
- Basic knowledge of prompting and APIs
- Comfortable with the terminal and a code editor
Learning objectives
- Explain the architecture of a RAG system
- Prepare, split and index documents
- Choose and use embeddings and a vector database
- Build a question-answering chain with LangChain
- Visually design a RAG flow and an agent with LangFlow
- Improve relevance: hybrid search, reranking, evaluation
- Expose and monitor your assistant in production
Detailed curriculum
7 modules · 21 h · 3 days
Language models, embeddings and vector search
- How a language model works and the context window
- Embeddings: representing meaning with vectors
- Similarity and vector search
- Model limits and the value of RAG
Compute embeddings and observe how close sentences are.
Architecture of a RAG system
- Ingestion: loading PDFs, web pages, databases
- Splitting documents and chunking strategies
- Indexing in a vector database
- Retrieval, context assembly and generation
- Citing your sources
Build a minimal RAG without a framework to understand each step.
LangChain: getting started
- Models, prompts and structured outputs
- Chains and composition
- Conversation memory
- Tools and agents: principles
Building a RAG with LangChain
- Document loaders and splitters
- Vector database and retriever
- Question-answering chain with sources
- Managing conversation history
Build an assistant that answers questions about a corpus of company documents.
LangFlow: building visually
- Installing and launching LangFlow
- Components, flows and variables
- Reproducing the RAG visually
- Exposing a flow through an API
Design the flow, test it in the interface and call it from a script.
Improving RAG quality
- Hybrid search and reranking
- Query rewriting and multiple queries
- Measuring quality: relevance, faithfulness, recall
- Diagnosing errors
Going to production
- Exposing the assistant through an API
- Security, access rights and privacy
- Observability, costs and document updates
Tools and technologies
Teaching methods
- Alternating theory and hands-on coding work
- Capstone project: an assistant on a fictional company's documents
- Code and results reviews
- Comparison of code and low-code approaches
Assessment
- Graded exercises in each module
- Demonstration of the RAG built and its evaluation
- Knowledge-check quiz
Required equipment
- A computer with Python 3 installed and a code editor
- A language model API key (provided or personal)
- An internet connection
Resources provided
- Notebooks and code repository for the workshops
- Exercise document corpus
- RAG system evaluation grid
Career outcomes
- A working document assistant
- A method to evaluate and improve a RAG
- Skills sought for enterprise AI projects