Repository for all of the code written for the FreeCodeCamp LangGraph Course, including solutions for all exercises. This repo provides practical examples of using LangGraph for building agent-based applications through Python scripts and interactive Jupyter notebooks.
LangGraph is a Python framework for designing and managing the flow of tasks in your application using graph structures. This course demonstrates LangGraph concepts through step-by-step exercises, agent implementations, and Jupyter notebooks.
LangGraph-Course/
├── Agents/ # Python agents for various tasks (e.g., RAG_Agent, Drafter)
├── Exercises/ # Jupyter notebooks with exercise solutions
├── Graphs/ # Jupyter notebooks illustrating LangGraph concepts
├── requirements.txt # Python dependencies
└── README.md # This file
Notable Directories:
- Agents/: Python scripts for agents such as Retrieval-Augmented Generation (RAG) and document drafting.
- Exercises/: Jupyter notebooks for each exercise (e.g.
Exercise_Graph1.ipynb). - Graphs/: Notebooks demonstrating LangGraph patterns (e.g., Hello World, Looping).
git clone https://github.com/rdtiv/LangGraph-Course.git
cd LangGraph-Coursebrew update
brew install pyenvAdd the following to your ~/.zshrc if it's not already there:
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv init -)"Restart your terminal or source your ~/.zshrc:
source ~/.zshrcpyenv install 3.12.6
pyenv local 3.12.6pipx install uv # Recommended, or:
pip install --user uvIf you don't have pipx, install it with:
brew install pipx
pipx ensurepathuv venv .venv
source .venv/bin/activateuv pip install -r requirements.txtIf you need API keys (such as for OpenAI), create a .env file in the root directory:
echo "OPENAI_API_KEY=your_openai_key" > .env
# Add other variables as neededuv pip install jupyterlab # Only if not already installed
jupyter lab- Open and run Jupyter notebooks in
Graphs/andExercises/for hands-on practice and exploration. - Run agent scripts in
Agents/for more advanced experiments. - All code is designed to work in a local, isolated Python environment managed by pyenv and uv.
- Explore the
Exercises/directory for self-contained solutions to LangGraph problems. - Example notebooks:
Exercise_Graph1.ipynb: Agent state and basic graph usage.Exercise_Graph2.ipynb: User input and graph visualization.Exercise_Graph3.ipynb: Personalization and skills-based responses.Exercise_Graph4.ipynb,Exercise_Graph5.ipynb: Advanced graph operations.
Core dependencies (see requirements.txt for full list):
- langgraph
- langchain
- ipython
- langchain_openai
- langchain_community
- dotenv
- typing
- chromadb
- langchain_chroma
Install all dependencies with:
uv pip install -r requirements.txt