Skip to content

Sourabh-Kumar04/LangChain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

25 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿฆœโ›“๏ธ LangChain Learning Hub

Python License: MIT LangChain Code style: black uv Package Manager

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.


๐Ÿ“– About This Repository

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.


๐Ÿ—๏ธ Repository Structure

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

๐Ÿš€ Quick Start

๐Ÿ”‘ Prerequisites

  • Python 3.10+

  • uv package manager (recommended over pip)

  • API keys for providers:

    • OPENAI_API_KEY (OpenAI & GPT-OSS-20B)
    • HUGGINGFACEHUB_API_TOKEN
    • ANTHROPIC_API_KEY
    • GOOGLE_API_KEY
    • (Optional) SERPAPI_API_KEY or DUCKDUCKGO for search tools

โšก Installation

  1. Clone the repository

    git clone https://github.com/Sourabh-Kumar04/LangChain.git
    cd LangChain
  2. Install dependencies using uv

    uv venv
    source .venv/bin/activate   # Linux/Mac
    .venv\Scripts\activate      # Windows
    
    uv pip install -r requirements.txt
  3. Set environment variables

    cp .env.example .env
    # Add your API keys in .env
  4. Run Jupyter

    uv pip install jupyter
    jupyter notebook

๐Ÿค– LLM Integrations

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

๐Ÿ“š Learning Path

  • ๐ŸŒฑ Beginner โ†’ Foundations, prompts, basic chains
  • ๐Ÿ”ง Intermediate โ†’ RAG, structured outputs, multi-step workflows
  • ๐ŸŽฏ Advanced โ†’ Agents, multi-LLM orchestration, production best practices

๐ŸŽฎ Example: Hugging Face gemini-2.5-flash Agent

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"))

๐Ÿ“‹ Requirements

Core

langchain>=0.1.0
python-dotenv
jupyter

LLMs

openai
huggingface_hub
anthropic
google-generativeai

Tools

duckduckgo-search
google-search-results
faiss-cpu
chromadb
pypdf

๐Ÿ› ๏ธ Development

uv pip install -r requirements-dev.txt
pre-commit install
pytest
black .
isort .
flake8 .

๐Ÿ“ˆ Roadmap

  • โœ… LangChain basics
  • โœ… Hugging Face OSS LLMs (openai/gpt-oss-20b)
  • โœ… Agent workflows
  • ๐Ÿšง LangGraph orchestration
  • ๐Ÿšง Advanced RAG (re-ranking, citations)
  • ๐Ÿšง Production deployment (Docker, Kubernetes, cloud)

๐Ÿ‘ค Author

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.


โญ Support

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.โ€


About

This repo is my LangChain learning journey, exploring prompts, structured outputs, retrievers, tools, and agents. It demonstrates building LLM-powered apps with practical notebooks and real-world workflows.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors