A comprehensive collection of LangChain tutorials, examples, and implementations โ from basic concepts to advanced AI agent workflows.โจ Curated and built by Sourabh Kumar with โค๏ธ as part of my hands-on journey exploring the real-world power of LangChain and open-source LLMs.
This repository is a learning and experimentation hub for LangChain, designed to guide you from the basics to production-ready AI systems.
It covers:
- ๐งฑ Core components of LangChain
- ๐ค LLM integrations (OpenAI, Hugging Face, Anthropic, Google Gemini, etc.)
- ๐ Chains, Agents, and Tools
- ๐ RAG systems (Retrieval-Augmented Generation)
- ๐ ๏ธ Production practices (error handling, monitoring, optimization)
If you want to learn LangChain hands-on or bootstrap your own AI projects, this repo is for you.
LangChain/
โโโ ๐ Foundation
โ โโโ 01_Introduction_to_LangChain.md
โ โโโ 02_LangChain_Components.md
โ
โโโ ๐ค Models & Integration
โ โโโ 03_LangChain_Models/
โ โโโ 04_Prompts_in_LangChain/
โ โโโ 05_Structured_Outputs/
โ โโโ 06_Output_Parsers/
โ
โโโ โ๏ธ Chains & Workflows
โ โโโ 07_Chains/
โ โโโ 08_Runnables/
โ
โโโ ๐ RAG Implementation
โ โโโ 09_Document_Loader/
โ โโโ 10_Text_Splitters/
โ โโโ 11_Vector_Store/
โ โโโ 12_Retrievers/
โ โโโ 13_RAG/
โ
โโโ ๐ ๏ธ Advanced Features
โ โโโ 14_Tools_in_LangChain/
โ โโโ 15_Agents/
โ โโโ 01_web_search_agent.ipynb
โ
โโโ ๐ Configuration
โโโ requirements.txt
โโโ pyproject.toml # Managed by uv
โโโ .env.example
โโโ README.md-
Python 3.10+
-
uv package manager (recommended over
pip) -
API keys for providers:
OPENAI_API_KEY(OpenAI & GPT-OSS-20B)HUGGINGFACEHUB_API_TOKENANTHROPIC_API_KEYGOOGLE_API_KEY- (Optional)
SERPAPI_API_KEYorDUCKDUCKGOfor search tools
-
Clone the repository
git clone https://github.com/Sourabh-Kumar04/LangChain.git cd LangChain -
Install dependencies using uv
uv venv source .venv/bin/activate # Linux/Mac .venv\Scripts\activate # Windows uv pip install -r requirements.txt
-
Set environment variables
cp .env.example .env # Add your API keys in .env -
Run Jupyter
uv pip install jupyter jupyter notebook
This repo demonstrates multiple LLM providers:
- OpenAI โ
gpt-4,gpt-3.5 - Hugging Face โ
openai/gpt-oss-20b - Anthropic Claude โ
claude-3.5-sonnet - Google Gemini โ
gemini-2.5-flash - Local Models via
transformers+langchain
- ๐ฑ Beginner โ Foundations, prompts, basic chains
- ๐ง Intermediate โ RAG, structured outputs, multi-step workflows
- ๐ฏ Advanced โ Agents, multi-LLM orchestration, production best practices
from langchain_huggingface import HuggingFaceEndpoint, ChatHuggingFace
from langchain_google_genai import ChatGoogleGenerativeAI
from langchain.agents import create_react_agent, AgentExecutor
from langchain_core.tools import tool
from langchain_community.tools import DuckDuckGoSearchRun
from langchain_core.messages import HumanMessage
from langchain import hub
from dotenv import load_dotenv
import requests
load_dotenv()
# Hugging Face model
llm = ChatGoogleGenerativeAI(
model="gemini-2.5-flash", # or "gemini-1.5-pro" if you have access
temperature=0,
convert_system_message_to_human=True
)
# Web search tool
search = DuckDuckGoSearchAPIWrapper()
tools = [Tool(name="WebSearch", func=search.run, description="Search the internet")]
# Initialize agent
agent = initialize_agent(tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True)
print(agent.run("3 ways to reach Goa from Delhi"))langchain>=0.1.0
python-dotenv
jupyter
openai
huggingface_hub
anthropic
google-generativeai
duckduckgo-search
google-search-results
faiss-cpu
chromadb
pypdf
uv pip install -r requirements-dev.txt
pre-commit install
pytest
black .
isort .
flake8 .- โ LangChain basics
- โ
Hugging Face OSS LLMs (
openai/gpt-oss-20b) - โ Agent workflows
- ๐ง LangGraph orchestration
- ๐ง Advanced RAG (re-ranking, citations)
- ๐ง Production deployment (Docker, Kubernetes, cloud)
Hey ๐, Iโm Sourabh Kumar โ a CS undergrad at the University of Delhi. Iโm passionate about AI, LangChain, and open-source LLMs and this repo is a way of documenting + sharing my journey with the community.
- ๐ GitHub/Sourabh-Kumar04
- ๐ผ LinkedIn/sourabh-kumar04
- ๐ Always open to collaboration, feedback, or just a good tech chat!
If this repo resonates with you or saves you time:
- โญ Star it (makes my day ๐)
- ๐ด Fork it (use it as your learning base)
- ๐ Contribute (PRs welcome)
๐ก โLearning is best when shared โ this repo is my small contribution to make LangChain approachable for everyone.โ