Skip to content

iparesh18/Learn-LangChain

Repository files navigation

Learn LangChain (By Paresh)


πŸ€– What is LangChain? (Beginner-Friendly)

LangChain is the framework that lets you build advanced AI systems like:

  • ChatGPT-style apps
  • Perplexity-style search agents
  • Autonomous AI agents
  • Tool-using AI (search, scrape, browser, DB queries)
  • RAG systems (Retrieval Augmented Generation)
  • Multi-agent workflows
  • AI automations

In simple words:

πŸ‘‰ LangChain = the API that gives your LLM a brain + memory + tools.

With LangChain you can give your model the power to:

  • Run functions
  • Use tools
  • Search the internet
  • Scrape websites
  • Execute multi-step workflows
  • Process data
  • Work with embeddings + vector search
  • Create intelligent agents

This repo teaches all of that step-by-step.


❓ Why Learn LangChain? (What It Solves & Why It Matters)

Modern AI apps are not just LLM calls anymore.

Real-world AI systems need:

  • Memory
  • Tools
  • Multi-step reasoning
  • Internet search
  • Web scraping
  • File processing
  • Database querying
  • Agents that can plan & act
  • Strong orchestration
  • Workflow control

LLMs cannot do these things alone.
This is where LangChain + LangGraph come in.


πŸš€ What LangChain Solves

βœ”οΈ 1. Turns your LLM into a β€œprogrammable agent”

LLMs alone = text in β†’ text out
LangChain = LLM + Tools + Memory + Functions
Now your AI can:

  • search the internet
  • scrape websites
  • run code
  • call APIs
  • access databases
  • use functions
  • follow workflows

This is how ChatGPT Tools, Perplexity, and BrowserGPT work.


βœ”οΈ 2. Standardizes tool usage (Functions, Runnables, Tools)

You don’t have to manually write:

  • LLM β†’ reasoning β†’ tool β†’ combine results β†’ final output

LangChain handles:

  • input formatting
  • tool calling
  • function schemas
  • conversions
  • parallel execution
  • mapping & sequencing

Everything becomes clean, modular, reusable.


βœ”οΈ 3. Gives LLM Short-Term & Long-Term Memory

With:

  • Runnables
  • Output Parsers
  • Embeddings
  • Vector Stores
  • RAG pipelines

You can build:

  • Memory agents
  • Knowledge assistants
  • Personal AI
  • Chatbots that remember context

βœ”οΈ 4. Play nicely with any LLM

Supports:

  • OpenAI
  • Gemini
  • Anthropic
  • Local models
  • Ollama
  • HuggingFace
  • Cloudflare AI

Your code stays the same even if the model changes.


πŸ”₯ What LangGraph Solves (Why It's the PERFECT Combo)

LangChain gives you tools,
but LangGraph gives you the brain to control them.

LangGraph provides:

  • Nodes (steps)
  • State management
  • Conditional edges
  • Routing
  • Multi-agent flows
  • Cycles + loops
  • Workflow orchestration
  • Re-entry + persistence

This is EXACTLY how:

  • Perplexity agents
  • ReAct agents
  • Supervisors
  • Tool routers
  • Multi-agent systems
    are built.

🀝 LangChain + LangGraph = The Agentic Power Combo

Together they let you build:

πŸ”· Autonomous multi-step agents

LLM thinks β†’ chooses tool β†’ uses tool β†’ updates memory β†’ repeats.

πŸ”· Perplexity-style search systems

Search β†’ scrape β†’ summarize β†’ final answer.

πŸ”· Browser automation agents

Use Puppeteer β†’ extract content β†’ feed to LLM.

πŸ”· Real-world AI backends

With:

  • routing
  • memory
  • tools
  • scraping
  • search
  • pipelines
  • multi-agents

Exactly what modern AI companies use.


🎯 One Line Summary

Learn LangChain to give your AI tools.
Learn LangGraph to give your AI a brain.

Together they let you build real AI systems, not toy chatbots.

πŸ“Œ About This Repository

This is an open-source, ongoing, continuously-evolving LangChain JS learning project created by Paresh.
The goal is simple:

πŸ‘‰ Teach LangChain JS from absolute zero to advanced with clean, runnable examples.
πŸ‘‰ Each topic = a self-contained lesson (folder) with its own README + code.
πŸ‘‰ Explained in ELI5 style: super simple, super practical.

This repository is structured like a hands-on course, not just random scripts.


🧱 How to Learn This Repo (Start β†’ End)

Many people get confused where to start, so here is the official recommended order:

βœ” Start with index.js

This gives you:

  • How model initialization works
  • How a basic .invoke() works
  • Simple structure before learning chains/tools

βœ” Then follow numeric order:

01 β†’ 02 β†’ 03 β†’ 04 β†’ 05 β†’ 06 β†’ 07 β†’ 08 β†’ 09 β†’ 10 β†’ 11 β†’ 12 β†’ 13

Each file builds on top of the previous one.

Flow of Learning:

  1. Basic LLM usage β€” index.js
  2. Prompt Template + Chains β€” 01, 02
  3. Output parsing β€” 03
  4. Custom steps / preprocessing β€” 04
  5. Embeddings + vector search β€” 05
  6. Basic RAG β€” 06
  7. Tools (RunnableLambda) β€” 07
  8. Scraper tool β€” 08
  9. LLM as a tool β€” 09
  10. Agent with scraper β€” 10
  11. Basic LangGraph agent β€” 11
  12. Multi-agent system β€” 12
  13. Advanced multi-agent with real search & scraping β€” 13

After these 13, you understand: βœ” LLM basics
βœ” Chains
βœ” Tools
βœ” RAG
βœ” Embeddings
βœ” Agents
βœ” Multi-agents
βœ” LangGraph
βœ” Routing
βœ” Real scraping
βœ” Real internet search

This is full AI backend mastery.


🎯 Purpose

Building real AI applications requires more than calling an LLM.
You need:

  • Chains
  • Tools
  • Agents
  • RAG
  • Embeddings
  • Web scraping
  • Automation
  • Multi-agent systems
  • LangGraph workflows

However, official docs are scattered and lack practical examples.

This repo fixes that by providing:

βœ” Simple explanations
βœ” Real code you can directly run
βœ” Modern LangChain v1 structure
βœ” Multi-agent + tool + automation examples
βœ” Practical steps for real-world AI development


🧠 Why This Repo Will Help You

βœ” Makes LangChain JS extremely beginner-friendly
βœ” Every lesson works directly via node <filename>
βœ” Covers everything needed for modern AI backend development
βœ” Perfect for MERN developers transitioning into AI
βœ” Each concept explained with clarity + comments
βœ” Updated continuously with new lessons & examples
βœ” Helps you build production-grade AI systems, not toy demos
βœ” Great for your resume + GitHub profile


🚧 Status: Ongoing (New Chapters Coming)

This project is actively being improved.
The author will continuously push updates, new folders, and new explanations.


πŸ“ Current Chapters (Already Included)

Right now, topics are single JS files.
Soon each will have its own dedicated folder + README + code.

01 - Prompt Chain
02 - Pipe (Basic Chaining)
03 - Output Parser
04 - Custom Step Logic
05 - Embeddings + Vector Search
06 - Basic RAG
07 - Tool Basics
08 - Web Scraper Tool (Puppeteer + Cheerio)
09 - LLM as a Tool
10 - Agent Demo with Scraper
11 - LangGraph Agent Basics
12 - Multi-Agent System (Basic)
13 - Multi-Agent System (Extended)
index.js – Starter example

πŸ› οΈ Tech & Packages Used

  • LangChain JS
  • LangGraph
  • Google Gemini 2.0 Flash
  • Puppeteer
  • Cheerio
  • Zod
  • dotenv
  • Node.js
  • Embeddings
  • Vector Search
  • RAG
  • Tools
  • Agents
  • Multi-agents

This repo will eventually become a full Agentic AI backend learning resource.


πŸš€ Roadmap (Future Topics To Be Added)

These are topics planned for future lessons. Exact filenames/folders will be decided later.

  • Advanced RAG techniques
  • Structured outputs
  • Using multiple tools together
  • Agent memory systems
  • LangGraph advanced flows
  • Multi-agent workflows with supervisor
  • Multi-agent research systems
  • Combining LangChain + Tavily search
  • Browser automation agents
  • Error handling + retries + guardrails
  • Practical real-world agent workflows
  • AI-powered automation pipelines (end to end)

More topics will get added as the repo grows.


🧩 How to Run Any Example

  1. Clone the repo:
git clone https://github.com/iparesh18/langchain-js-zero-to-advanced
  1. Install dependencies:
npm install

This will install the following dependencies used across all chapters:

  • @langchain/core β€” core LangChain components
  • @langchain/classic β€” legacy abstractions
  • @langchain/google-genai β€” Gemini 2.0 models
  • @langchain/openai β€” OpenAI models (optional)
  • @langchain/langgraph β€” multi-agent + workflow engine
  • dotenv β€” load .env API keys
  • openai β€” direct OpenAI SDK
  • serpapi β€” Google Search API
  • zod β€” schema validation
  1. Create .env:
cp .env.example .env
  1. Run any lesson:
node 01-prompt-chain.js

Each example is fully self-contained.


🀝 Contributing

This is an open-source learning project β€” contributions are welcome.

You can contribute by:

  • Improving explanations
  • Adding new lessons
  • Fixing bugs
  • Adding better examples
  • Enhancing tool/agent demos

Submit a PR anytime.


πŸ† License

Licensed under the MIT License.
Free for everyone to learn, modify, and build on.


⭐ Support the Project

If this repo helped you, consider giving it a ⭐ on GitHub β€”
It motivates the author to push more chapters and make this project world-class.

About

End-to-end LangChain JS learning repo with real examples: prompts, tools, RAG, agents, and LangGraph workflows.

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors