Skip to content

About

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.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

Repository files navigation

LangChain: From Zero To Hero 🦜🔗

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.

📚 Chapters

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)

🛠️ Tech Stack

  • 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

🚀 Getting Started

1. Clone the repository

git clone https://github.com/moonmido/LangChain_From_Zero_To_Hero.git
cd LangChain_From_Zero_To_Hero

2. Set up a virtual environment (recommended)

python -m venv venv
source venv/bin/activate   # Windows: venv\Scripts\activate

3. Install dependencies

Each 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 chromadb

4. Configure your API key(s)

The notebooks read credentials from environment variables via python-dotenv. Create a .env file in the project root:

NVIDIA_API_KEY=your_nvidia_api_key_here

Get 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.

5. Run the notebooks

jupyter notebook

Open any Chapter-* folder and run the notebook top to bottom.

📂 Project Structure

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

🤝 Contributing

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.

📄 License

This project is licensed under the MIT License.

✍️ Author

Boutmedjet Abd Elmoudjib (MoonMido)

About

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.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages