Welcome to LangChain Academy!
This is a growing set of modules focused on foundational concepts within the LangChain ecosystem.
Module 0 is basic setup and Modules 1 - 4 focus on LangGraph, progressively adding more advanced themes.
In each module folder, you'll see a set of notebooks. A LangChain Academy accompanies each notebook
to guide you through the topic. Each module also has a studio
subdirectory, with a set of relevant
graphs that we will explore using the LangGraph API and Studio.
To get the most out of this course, please ensure you're using Python 3.11 or later. This version is required for optimal compatibility with LangGraph. If you're on an older version, upgrading will ensure everything runs smoothly.
python3 --version
git clone https://github.com/langchain-ai/langchain-academy.git
$ cd langchain-academy
$ python3 -m venv lc-academy-env
$ source lc-academy-env/bin/activate
$ pip install -r requirements.txt
PS> python3 -m venv lc-academy-env
PS> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
PS> lc-academy-env\scripts\activate
PS> pip install -r requirements.txt
If you don't have Jupyter set up, follow installation instructions here.
$ jupyter notebook
Briefly going over how to set up environment variables. You can also
use a .env
file with python-dotenv
library.
$ export API_ENV_VAR="your-api-key-here"
PS> $env:API_ENV_VAR = "your-api-key-here"
OPENAI_API_KEY
in your environmentLANGCHAIN_API_KEY
, LANGCHAIN_TRACING_V2=true
in your environmentTavily Search API is a search engine optimized for LLMs and RAG, aimed at efficient, quick, and persistent search results.
You can sign up for an API key here. It's easy to sign up and offers a very generous free tier. Some lessons (in Module 4) will use Tavily.
Set TAVILY_API_KEY
in your environment.
.dmg
file here
Graphs for LangGraph Studio are in the module-x/studio/
folders.
$ for i in {1..4}; do
cp module-$i/studio/.env.example module-$i/studio/.env
echo "OPENAI_API_KEY=\"$OPENAI_API_KEY\"" > module-$i/studio/.env
done
$ echo "TAVILY_API_KEY=\"$TAVILY_API_KEY\"" >> module-4/studio/.env