Skip to content

Crash course to master LangChain and LangGraph from basics to advanced workflows like RAG, intelligent web-search agents and text classifiers.

License

Notifications You must be signed in to change notification settings

pabroux/langchain-langgraph-crash-course

Repository files navigation

🦜🔗 LangChain LangGraph Crash Course

License Badge Pixi Badge CI Badge

LangChain LangGraph Crash Course (LLCC) is a hands-on course designed to teach you LangChain and LangGraph from the ground up. In this course, you will learn how to build Retrieval-Augmented Generation (RAG) workflows, intelligent agents doing web searches, text classifiers, and much more.

Note

Unlike official tutorials, LLCC provides pure Python scripts instead of Jupyter or Colab notebooks, delivering clean, ready-to-run code. Each script is extensively commented for complete clarity and ease of understanding. Additionally, LLCC sometimes includes extra steps not found in official tutorials, such as LCEL.

Table of contents

Requirements

If you want to run the examples, you will need to install the following:

You'll also need to have an OpenAI key.

Install

Inside the repository, install the dependencies as follows:

pixi install -a

Cost

All examples utilize the OpenAI API, specifically employing the gpt-4o-mini model as the language model and/or the text-embedding-3-large model for embeddings. You can access these services under the free tier, which typically incurs no cost.

Course

Tip

It's recommended to follow the course in the given order.

1. LangChain

Task Description File
Chat models & prompts Simple LLM application with prompt templates and chat models simple_llm_application.py
Semantic search Search over a PDF with document loaders, embedding models and vector stores semantic_search_engine.py
Classification Classify text into tags using chat models with structured outputs text_classifier.py
Extraction Extract structured data from text using chat models and few-shot examples data_extractor.py

2. LangGraph

2.1 Agents

Task Description File
Agent Simple agent with a memory and able to do web searches agent.py
Agent & human in the loop Agent empowered to request a human intervention agent_human_assitance.py
Agent & time travel Altering an agent output by changing its memory agent_time_travel.py

2.2 Retrieval augmented generation (RAG)

Task Description File
RAG Simple RAG with an introduction to self-query (an advanced RAG technique) rag.py
RAG & conversations Delegating (multi-step) RAG calls to a LLM rag_delegation.py

Resources

The resources described here are sorted in order of importance. For instance, to better understand and grasp each LangChain concept, you should have knowledge of LLM theory and LLM engineering.

LLM theory

LLM engineering

LangChain

LangGraph

About

Crash course to master LangChain and LangGraph from basics to advanced workflows like RAG, intelligent web-search agents and text classifiers.

Topics

Resources

License

Stars

Watchers

Forks

Languages