Model or dataset
BrandPeng/Langchain1.0-Langgraph1.0-Learning avatar
BrandPeng/Langchain1.0-Langgraph1.0-Learning

Langchain1.0-Langgraph1.0-Learning: a four-phase agent course in Python

这是一个 LangChain 1.0 和 LangGraph 1.0 的学习仓库,学习如何进行agent开发,涵盖从基础概念到实战项目的完整学习路径。

688 stars127 forksPythonMIT

At a glance

What is it?
This repository is a graded learning path for LangChain 1.0 and LangGraph 1.0, twenty-three numbered modules and three capstone projects, written for readers who want to build agents rather than read about them. It is a curriculum, not a library, and it is written in Chinese.
Who is it for?
This repository fits a developer who knows Python and wants a structured path through the LangChain 1.0 and LangGraph 1.0 APIs, with runnable code at every step and a Groq-first setup that starts without a paid key. It is the wrong choice if you want a reference implementation to copy into a product, since the projects are teaching exercises, or if you cannot read the Chinese-language documentation and module comments.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 16 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.

Editorial analysis

A curriculum with phases, weeks and module numbers

This is a learning repository, and its structure is the point. The README describes a systematic path for studying LangChain 1.0 and LangGraph 1.0, from basic concepts through to hands-on projects, and lays it out as four progressive phases across roughly eight weeks. Each phase is named with a week range: fundamentals in weeks one and two, practical skills in weeks three and four, advanced topics in weeks five and six, and capstone projects in weeks seven and eight.

The repository layout matches that plan exactly. The root holds phase1_fundamentals, phase2_practical, phase3_advanced and phase4_projects, plus a docs directory, a requirements.txt, an .env.example and a tests directory. Inside each phase the folders are numbered and named after their topic, from 01_hello_langchain through 06_agent_loop in the first phase, 07_memory_basics through 15_tools_and_agents in the second, 16_langgraph_basics through 23_error_handling in the third, and three project folders in the fourth.

One inconsistency is worth knowing before you plan your time. The README states the repository contains 22 modules and 3 projects, while the phase listings run to 23 numbered modules. The directory tree is the reliable source, since that is what you will actually open.

The documentation is written in Chinese, including the module descriptions and the inline comments, so the code is the part you can read without translating anything.

Phase 1 ends with create_agent and a tool decorator

The first phase builds up in a deliberate order: a first model call, prompt templates, message types and conversation history, custom tools, then a simple agent and the agent execution loop. The phase table is specific about what each module covers, and the first one lists `init_chat_model` and the `invoke` method alongside environment configuration, the message module covers HumanMessage, AIMessage and SystemMessage, and the tools module covers the `@tool` decorator, parameter types and the importance of the docstring.

The running example of the phase shows the whole shape of a LangChain 1.0 agent in a few lines:

python
from langchain.chat_models import init_chat_model
from langchain_core.tools import tool

model = init_chat_model("groq:llama-3.3-70b-versatile")

@tool
def my_tool(param: str) -> str:

    return "result"

Two details are the point of the phase. The model is addressed by provider and model name in a single string, and the tool is a plain function with a typed parameter that the `@tool` decorator turns into something the model can call. The README is explicit that the docstring matters, since it is what the model reads to decide when to use the tool.

The create_agent example that follows uses `model=model`, a `tools` list and a `system_prompt` argument, and the README notes that the system prompt is passed as that parameter in LangChain 1.0.

That API is new. The README dates the LangChain 1.0 major release to October 2025 and lists what changed in it: the framework is built on the LangGraph runtime, which brings persistence, streaming and human in the loop, the `create_agent` API simplifies agent creation, a middleware architecture with hooks such as before_model, after_model and wrap_model_call gives fine-grained control over execution, text, images, video and files are all handled, structured output is defined with Pydantic models, and the 1.x series commits to keeping the API stable.

The middleware list is the part the course only skims. Module 10 in phase two is a single entry on custom middleware and hook functions, so the specific hook names are the most useful thing a reader takes from the top of the README, since they are what you reach for when an agent has to be cheaper, safer or more talkative than the default.

Phase 2 makes agents stateful, phase 3 makes them graphs

The second phase is where the interesting engineering starts, and the module list reads like the concerns of a real agent service. Module 07 covers memory basics with the InMemorySaver and session management. Module 08 covers context management, with message trimming and the context window. Module 09 moves to checkpointing, with SQLite persistence and state recovery. Module 10 introduces middleware and hook functions.

The rest of the phase is about making the outputs usable and the failures survivable. Structured output with Pydantic models and output parsing is module 11, validation and retry handling is module 12, and the two RAG modules cover document loading, chunking, vector storage and retrieval, then hybrid search, reranking and advanced retrieval. Module 15, tools and agents, is described as the advanced stage of the same topic.

Two things are missing from the table and worth asking about. There is no module on cost or latency, and none on deployment. This phase teaches you to make an agent correct and persistent, not to run it economically at scale.

The third phase starts with LangGraph itself. Module 16 covers StateGraph, nodes, edges and checkpoints, which is the runtime underneath the LangChain 1.0 agent API. Module 17 covers multi-agent systems with the Supervisor pattern and collaborative scheduling, and module 18 covers conditional routing with dynamic branches and decision trees.

The last five modules are about the input side. Module 19 handles image input for visual understanding and image analysis, module 20 covers file handling and document loading with multi-format support, module 21 covers mixed modality work combining text, images and data, module 22 integrates LangSmith for tracing, monitoring and performance analysis, and module 23 covers error handling with retries, degradation and fault tolerance.

The multimodal modules carry a dependency that is easy to miss. The .env.example file states that Groq does not support image processing, so running the image examples requires an OpenAI key instead, which the file lists as optional for everything else. In other words, one provider covers the text path and a second one covers the image path.

Phase 4 supplies three projects with different shapes

The capstone phase is three projects, and the phase table makes clear they are not three variations on the same exercise. The RAG System is a document question answering system built on vector storage, retrieval augmented generation and citation tracking. Multi-Agent Support is a customer service system with multi-agent collaboration, intent recognition and routing distribution. The Research Assistant runs a multi-stage workflow with report generation and reference management.

The roadmap in the README goes further and describes what comes next beyond the current folders: a complete RAG project with a frontend and backend built on Agentic RAG, ChromaDB, SQLite, FastAPI and Vue, and a complete multi-agent project with Python, LangGraph, LangChain, FastAPI, MCP, Vue and SQLite. So the repository is positioned as the first half of a larger plan, with full-stack applications listed as follow-up work.

What is in the repository today is the Python side. The Vue frontends and FastAPI services named in the roadmap are not part of the current tree, and the phase 4 folders contain Python entry points rather than deployable applications.

Setting up is a venv, a requirements file and one key

The quick start asks for Python 3.10 or higher, and states that Python 3.9 is not supported, with pip or uv as the package manager. The setup sequence is short:

bash
git clone <your-repo-url>
cd Langchain1.0-Langgraph1.0-learning

python -m venv venv

# Windows:
venv\Scripts\activate
# Unix/macOS:
source venv/bin/activate

pip install -r requirements.txt

cp .env.example .env

The last line matters as much as the pip install, because the examples call hosted models. The .env file is where the keys go, and the README table lists four: `GROQ_API_KEY` for the Groq API, marked free, `OPENAI_API_KEY` for OpenAI, marked optional, `PINECONE_API_KEY` for the Pinecone vector database, marked free, and `LANGSMITH_API_KEY` for LangSmith monitoring, marked optional.

To confirm the setup, the README gives a single command to run:

bash
python phase1_fundamentals/01_hello_langchain/main.py

And for any later module, the pattern is the same, entering the module folder and running its entry point:

bash
cd phase1_fundamentals/01_hello_langchain

python main.py

python test.py

The requirements file separates the classic package and the providers

requirements.txt is where the version strategy shows. The core packages are pinned to the 1.x line with an upper bound:

bash
langchain>=1.0.0,<2.0.0
langchain-core>=1.0.0,<2.0.0
langchain-classic>=1.0.0
langgraph>=1.0.0,<2.0.0
langsmith>=0.2.0
langchain-groq>=0.2.0
langchain-openai>=0.2.0
langchain-anthropic>=0.3.0
langchain-google-genai>=2.0.0
langchain-community>=0.3.0
langchain-text-splitters>=0.3.0

The separate `langchain-classic` entry is the interesting one. The comment above it states that it holds components moved out of the main package, naming EnsembleRetriever as an example, which is a hint that some tutorials written against older LangChain versions will still import from the classic package. The <2.0.0 ceiling on the core packages matches the README's claim that the 1.x series keeps the API stable.

The provider packages are all present, so a learner is not locked into one vendor: Groq, OpenAI, Anthropic and Google Gemini each have an integration, and langchain-community covers the long tail. For the embedding modules 13 and 14, the file adds langchain-huggingface, sentence-transformers, transformers and torch, which is a heavy install for a course that otherwise needs nothing but a model API key.

The env file and the README table name LangSmith differently

The .env.example file is where the practical details live, and it disagrees with the README in one place. The README table lists the monitoring key as `LANGSMITH_API_KEY`, while the .env.example file uses `LANGCHAIN_API_KEY`, along with `LANGCHAIN_TRACING_V2=true` and `LANGCHAIN_PROJECT=langchain-learning`. The file presents the tracing switch and the project name as commented-out optional settings, so tracing is off by default.

The rest of the file matches the table and adds the reason each key is there:

bash
GROQ_API_KEY=your_groq_api_key_here

# OPENAI_API_KEY=your_openai_api_key_here

# LANGCHAIN_TRACING_V2=true
# LANGCHAIN_API_KEY=your_langsmith_api_key_here
# LANGCHAIN_PROJECT=langchain-learning

# PINECONE_API_KEY=your_pinecone_api_key_here

The comment for the Groq key says free and recommended, the one for the OpenAI key says it is only needed for the image related modules 19 and 21 because Groq does not support image processing, and the Pinecone key is described as optional and aimed at the advanced RAG examples. A learner following the README table rather than the .env file would end up with a variable name the code does not read.

MIT licensed, no releases, and a plan still in progress

The repository is licensed under MIT, with the licence text in a LICENSE.txt file at the root, and it is not archived. The last push was on 2026-10-07, so the work is current, but there are no GitHub releases, which means there is no version history to point at and no upgrade notes to read. For a learning repository that is a reasonable trade, since nothing depends on it in production.

One detail in the root layout is worth noting, because it affects how you read the course. The roadmap paragraphs in the README make the intent explicit: a full RAG project with a FastAPI backend, a Vue frontend, ChromaDB and SQLite, and a multi-agent project that adds MCP to the stack. Both are listed as future work, so the code you can run today stops at the Python scripts in the phase folders, and the repository holds an img.png, a .gitignore, a tests directory and a docs directory and nothing that looks like an application.

Editorial conclusion

This repository fits a developer who knows Python and wants a structured path through the LangChain 1.0 and LangGraph 1.0 APIs, with runnable code at every step and a Groq-first setup that starts without a paid key. It is the wrong choice if you want a reference implementation to copy into a product, since the projects are teaching exercises, or if you cannot read the Chinese-language documentation and module comments. Verify first that the module numbering in the phase tables matches the folders in the repository, since the README states 22 modules while the lists run to 23, and that your LangSmith variable names match your plan, since the README table and the .env.example file disagree.

Frequently asked questions

What does the Langchain1.0-Langgraph1.0-Learning repository contain?

It is a four-phase learning path for LangChain 1.0 and LangGraph 1.0, laid out as numbered module folders from 01_hello_langchain to 23_error_handling, plus a docs directory and three capstone projects: an RAG system, a multi-agent customer service system and a research assistant.

What do I need to install to run the examples?

Python 3.10 or higher, with pip or uv, then a virtual environment and pip install -r requirements.txt. You also need a model API key in a .env file copied from .env.example, and the README points at Groq as the free recommended provider.

Can I run the image and multimodal modules with the free Groq key?

No. The .env.example file states that Groq does not support image processing, so the image related modules 19 and 21 need an OpenAI key set as OPENAI_API_KEY, which is optional for the rest of the course.

Why is there a separate langchain-classic package in the requirements?

The comment in requirements.txt explains that it contains components moved out of the main package, naming EnsembleRetriever as an example. Older tutorial code that imports from langchain-classic will still work.

Which LangSmith variable should I set for tracing?

The .env.example file uses LANGCHAIN_API_KEY with LANGCHAIN_TRACING_V2=true and LANGCHAIN_PROJECT, while the README table names LANGSMITH_API_KEY for the same purpose. The .env file is the one the project ships, so follow it.

Official sources

  1. BrandPeng/Langchain1.0-Langgraph1.0-Learning on GitHub
  2. Issues
  3. License: MIT
  4. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/brandpeng-langchain1-0-langgraph1-0-learning.svg)](https://hysenlabs.com/projects/brandpeng-langchain1-0-langgraph1-0-learning)

Was this useful?