
Explore the LangChain course structure through organized sections with videos, written material lectures, and code resources, including Jupyter notebooks and zip folders, to reinforce learning.
Connect to a large language model API with OpenAI models, extendable to other providers, and fine-tune prompts using the prompt template module while building chains that pipe outputs into pipelines.
Text
Downgrade the OpenAI package below version 1 and align the long chain to a compatible 0.20.8.1 to resolve LangChain compatibility issues and restore chat functionality.
Explore building prompts with prompt templates in LangChain by importing templates, defining input placeholders like category, and composing system, human, and chat prompts into chains to derive subcategories.
Build a custom output parser by subclassing the base parser, splitting comma-separated text into a clean list, and integrating it with a LangChain chain for category outputs.
Wire LangChain's simple sequential chains to generate a play title and synopsis, using a from string function with prompt templates and a title and synopsis chain.
Conclude your introduction to Linkchain basics and look forward to the next video; see you there.
Load diverse data files and summarize text data using link chain modules, mastering automated strategies to summarize large texts with the latest LMS, through a practical tutorial.
Apply map-reduce and refine strategies in LangChain to summarize large data sets by chunking content, parallel processing, and iterative refinement to produce a final, comprehensive summary.
Demonstrate how to set up LangChain summarization chains, including load summarize chain, map reduce, and refine chains, using prompts and templates to extract themes from data.
Discover prompt engineering techniques to control LMS outputs, including few-shot learning, chain of thought, self-consistency, self ask, react, and plan and execute, for building software with LMS.
Explore the elements of a prompt in LangChain by inspecting a chat OpenAI model and a conversation chain, including input data, instructions, output indicator, and context history.
Explore few-shot learning by building a few example prompts and templates, formatting with chat prompt templates and a system prompt, and seeing how adding more examples can improve model accuracy.
Explore mimetic proxy, using cultural references to guide search understanding, and learn to build a prompt template and chain with a chat model for PhD- and kindergarten-level explanations.
Learn chain-of-thought prompting to add rationales to answers in a few-shot setup, using a Kaggle dataset and a system prompt to solve arithmetic questions with plus and minus.
Conclude the session on prompt engineering and preview many new topics to explore in coming sessions.
Explore how vector databases index data with vectors for approximate nearest neighbor searches, using product quantization, locality sensitive hashing, hierarchical navigable smallware, and maximal marginal relevance for diverse results.
Explore why indexing vector data speeds retrieval in LangChain by using approximate nearest neighbors to efficiently find nearest vectors among trillions.
Partition vectors into sub-vectors and cluster them with k-means to learn centroids that approximate data, enabling fast, memory-efficient nearest-neighbor retrieval while balancing accuracy and latency.
Leverage locality sensitive hashing to bucket vectors into partitions, project them with a random matrix, use axis-aligned hyperplanes to define quadrants, and retrieve similar vectors in constant time.
Explore hierarchical navigable small world graphs with multiple layers, where vectors are input at varying probabilities to create dense and sparse connections, enabling faster approximate nearest neighbor search.
Discover how maximum marginal relevance reranks retrieved vectors to balance query similarity with diversity from existing vectors, reducing redundancy and enriching prompts for richer LangChain context.
Explore how vector databases manage vector embeddings with indexing and approximate nearest neighbor search, enabling insert, delete, and update operations, metadata filtering, and scalable distributed processing with Lenchen.
Index a pdf by loading documents, splitting into 500-size chunks, embedding with OpenAI, and storing in a vector index; retrieve with cosine similarity and a retrieval chain.
Store data in a Pinecone vector database by creating a 1536-dimensional cosine index and embedding documents with OpenAI. Use LangChain retrieval on the db to answer questions from indexed content.
Display sources for answers by indexing news articles from a news API and attach them through a LangChain retrieval chain with documents and a sources prompt.
Learn to crawl and index a website with LangChain, create a loader, split content into chunks, and store embeddings in a chroma database for querying.
index GitHub repository by cloning the linkchain repo with a git loader, filtering Python files on master, and splitting code into 1000-token chunks for a retrieval chain with OpenAI embeddings.
Load a pdf, convert text to embeddings, and index it in a Chroma vector store, then use a stuff strategy retrieval chain to answer questions.
Learn how the map reduce strategy uses a language model to extract and combine information from vector-database documents, iterating prompts to fit context within the model's window, delivering better results.
Master the refine strategy in LangChain by iteratively refining an initial answer with sequential documents from a vector database to produce a final, better answer.
Master multi-vector retrieval by indexing data with OpenAI embeddings, chunking long documents, mapping sub documents to parent IDs, and performing efficient similarity search with a multi-vector retriever and retrieval chain.
Learn to answer questions from multimodal data using a rag pipeline. Explore Lava's vision transformer turning images into embeddings and parsing a pdf with the unstructured library.
Summarize text and tables to build a pipeline that indexes data in a vector database using a summarize chain and batch processing.
Describe images using lava with the lemma model, clone repos, install git LFS, build binaries, and run a bash script to generate detailed image descriptions.
Index the data into a database by converting all data modes into text descriptions, index them with vector embeddings, and retrieve text descriptions to answer questions using a rag pipeline.
End the course by outlining how the multimodal right pipeline will mature with future multimodal LMS adoption, and how Linkchain will adapt to generative AI trends and Rag pipelines.
Extract entities and relationships from text with LMS, build a graph with a knowledge base, and mount it on a local Neo4j database for fast entity search, using Deep Bert.
Import a knowledge base into LangChain, wire the GraphQL chain with a chat model set to temperature zero, and demonstrate retrieval augmented generation by querying North Pole and Timmy.
Pull and run a Neo4j docker image locally, exposing ports 7474 and 7687 and authenticating as Neo4j. Connect, import graphs from Diffbot, and refresh the schema after adding documents.
Explore how a knowledge base can augment a LMS and compare it to a vector database. Assess current maturity and the near-term advances expected in the coming years.
Explore the core ideas of LangChain by building agents that connect language models with tools and APIs, prompt design, and custom tool creation, including using a vector database.
Learn how an agent uses a language model to decide actions in order, orchestrate tools, observe results, and produce a final output through a chained sequence of actions and observations.
Explore the iterative prompt-based workflow of a language model, detailing tool usage (Wikipedia, calculator) and a thought-action-input-observation-template that guides successive iterations to a final answer.
Load and split a pdf into documents, index them in a chroma vector database with OpenAI embeddings, and create a retrieval chain to power a custom tool for an agent.
Build a smart voice assistant in Python that speaks to ChatGPT, using speech recognition for input, natural language processing, dialogue management, and text-to-speech, with Google search integration.
Set up a LangChain project in VSCode with docs and source folders, add agents and interface, and configure a virtual environment and an OpenAI API key file.
Learn to build an audio interface with listen and speak methods, using speech recognition and OpenAI’s Whisper to convert microphone input to text and back, with environment variable setup.
Install 11 labs Python package, set the API key as an environment variable, and use generate function to convert text to audio with Bella voice, then play it.
Build an intelligent conversational agent in LangChain by wrapping a chat model inside a conversation chain and wiring it to listen for input, process text, and respond.
Welcome to the Introduction to LangChain course! Very recently, we saw a revolution with the advent of Large Language Models. It is rare that something changes the world of Machine Learning that much, and the hype around LLM is real! That's something that very few experts predicted, and it's essential to be prepared for the future.
LangChain is an amazing tool that democratizes machine learning for everybody. With LangChain, every software engineer can use machine learning and build applications with it. Prior to LangChain and LLMs, you needed to be an expert in the field. Now, you can build an application with a couple of lines of code. Think about language models as a layer between humans and software. LangChain is a tool that allows the integration of LLMs within a larger software.
Topics covered in that course:
LangChain Basics
Loading and Summarizing Data
Prompt Engineering Fundamentals
Vector Database Basics
Retrieval Augmented Generation
RAG Optimization and Multimodal RAG
Augmenting LLMs with a Graph Database
Augmenting LLMs with tools
How to Build a Smart Voice Assistant
How to Automate Writing Novels
How to Automate Writing Software
The course is very hands-on! We will work on many examples to build your intuition on the different concepts we will address in this course. By the end of the course, you will be able to build complex software applications powered by Large Language Models!
Warning: during the course, I used a lot of the OpenAI models through their API. If you choose to use the OpenAI API as well, be aware that this will generate additional costs. I expect that reproducing all the examples in the course should not require more than $50 in OpenAI credits. However, all the examples can be reproduced for free if you choose to use open-source LLMs.