A hands-on, chapter-by-chapter collection of Jupyter notebooks for learning LangChain from the ground up — starting with a single prompt-to-LLM chain and building up to a tool-using, human-in-the-loop agent.
Each chapter is a self-contained notebook that introduces one new LangChain concept through a small, practical project.
| Chapter | Notebook | Concept |
|---|---|---|
| 1 | Generate_funny_company_names.ipynb |
Prompt templates & your first LLM chain |
| 2 | BlogWriting.ipynb |
Simple sequential chains |
| 3 | Academic_question_generator.ipynb |
Sequential chains with RunnablePassthrough & output parsers |
| 4 | Simple_RAG.ipynb, Rag.ipynb |
Retrieval-Augmented Generation (embeddings, text splitting, vector stores with Chroma, PDF loading) |
| 5 | RouterChain.ipynb |
Router chains — dynamically routing a query to different chains/prompts |
| 6 | AI_Powered_Weather_and_Outfit_Advisor.ipynb |
Agents with custom tools and human-in-the-loop middleware (langgraph) |
- LangChain /
langchain-core/langgraph - NVIDIA AI Endpoints (
langchain-nvidia-ai-endpoints) as the LLM & embeddings provider - Chroma as the vector store for RAG chapters
- PyPDF for PDF document loading
- python-dotenv for environment/API key management
git clone https://github.com/moonmido/LangChain_From_Zero_To_Hero.git
cd LangChain_From_Zero_To_Heropython -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activateEach notebook installs what it needs in its first cell, but you can install everything up front:
pip install langchain langchain-core langchain-community langchain-text-splitters \
langchain-nvidia-ai-endpoints langchain-openai langchain-chroma \
langgraph pypdf python-dotenv chromadbThe notebooks read credentials from environment variables via python-dotenv. Create a .env file in the project root:
NVIDIA_API_KEY=your_nvidia_api_key_hereGet a free NVIDIA API key at build.nvidia.com. Some notebooks reference other env var names (e.g.
LLM_API) or third-party APIs (like OpenWeatherMap in Chapter 6) — check the top of each notebook and adjust the key names/values accordingly.
jupyter notebookOpen any Chapter-* folder and run the notebook top to bottom.
LangChain_From_Zero_To_Hero/
├── Chapter-1/ # Prompt templates & basic chains
├── Chapter-2/ # Sequential chains
├── Chapter-3/ # Sequential chains + output parsers
├── Chapter-4/ # RAG (Retrieval-Augmented Generation)
├── Chapter-5/ # Router chains
├── Chapter-6/ # Agents & tools
└── LICENSE
This is a learning-focused project. Suggestions, corrections, and pull requests are welcome — feel free to open an issue or PR if you spot a bug or want to add a new chapter.
This project is licensed under the MIT License.
Boutmedjet Abd Elmoudjib (MoonMido)