A hands-on, project-based repository for building stateful, production-grade AI agents with LangGraph
This repository is a deep dive into LangGraph — the framework for building stateful, multi-actor AI applications. Each project branch contains a fully working agent system, with commits ordered chronologically so you can follow the development step by step.
From simple ReAct loops to self-correcting Reflexion agents and advanced Agentic RAG pipelines — this repo covers the full spectrum of modern agent architectures.
| Branch | Project | Description |
|---|---|---|
project/agentic-rag |
📚 Agentic RAG | Advanced RAG pipeline with self-correction, grading nodes & adaptive routing |
project/ReAct-agent |
⚛️ ReAct Agent | Classic Reasoning + Acting loop implemented natively in LangGraph |
project/ReAct-Agent-Function-Calling |
🔧 ReAct + Function Calling | ReAct agent with structured function/tool calling |
project/reflection-agent |
🪞 Reflection Agent | Agent that critiques and improves its own outputs |
project/reflexion-agent |
🔄 Reflexion Agent | Advanced self-correcting agent using the Reflexion technique |
project/search-agent |
🔎 Search Agent | Web-search integrated agent with Tavily |
| # | Commit | Lesson | Key Concept |
|---|---|---|---|
| 1 | 5b2b18e |
Project Kick-Off | Repo & env setup |
| 2 | 2693185 |
Folder Structure | Clean project scaffolding |
| 3 | 513e3cf |
Ingestion Pipeline | Load & embed documents |
| 4 | 03f79ae |
Graph State | Passing memory between nodes |
| 5 | c2d71c7 |
Retrieve Node | Context fetching with LangGraph |
| 6 | 9107e7a |
Grade Docs Node | Structured relevance filtering |
| 7 | 6d4fdc4 |
Web Search Node | Tavily API integration |
| 8 | bc57b63 |
Generation Node | Prompting & LLM calls |
| 9 | a450f9b |
Wiring the Graph | Fan-in, fan-out, conditionals |
| 10 | 5400fb7 |
Self-RAG | LLM self-critique loop |
| 11 | 034e53f |
Adaptive Router | Dynamic tool selection |
- Stateful agent design with LangGraph nodes and edges
- ReAct (Reason + Act) patterns from scratch
- Self-improving agents — Reflection and Reflexion architectures
- Advanced RAG: grading, web-search fallback, adaptive routing
- Conditional edges, parallelism, and fan-in/fan-out flows
- Multi-step agent graphs with memory and planning
- Python 3.10+
poetryoruv- Access to an LLM (OpenAI / Anthropic / Gemini)
- Tavily API key (for search-enabled agents)
# 1. Clone the repository
git clone https://github.com/rjayswal-pythonista/langgraph-course
cd langgraph-course
# 2. Checkout a project branch
git checkout project/agentic-rag # or any other project
# 3. Install dependencies
poetry install
# or
uv sync
# 4. Configure environment
cp .env.example .env
# Fill in your API keys
# 5. Run
poetry run python main.pyOPENAI_API_KEY=your_openai_key
TAVILY_API_KEY=your_tavily_key # for web-search nodes
LANGCHAIN_API_KEY=your_langsmith_key # optional, for LangSmith tracing
LANGCHAIN_TRACING_V2=true # optional
PYTHONPATH=$(pwd)git log --oneline --reverse # see all commits chronologically
git checkout <commit_hash> # jump to any lesson| Layer | Tools |
|---|---|
| Agent Framework | LangGraph, LangChain v1.0+ |
| LLMs | OpenAI GPT-4, Anthropic Claude, Google Gemini |
| Search | Tavily Search API |
| Vector DBs | Pinecone, FAISS |
| Tracing | LangSmith |
| Language | Python 3.10+ |
langgraph-course/
├── main.py # Entry point for each project branch
├── pyproject.toml # Dependencies (Poetry)
├── .env.example # Environment variable template
└── banner.png # Banner image
Each project/* branch is a standalone implementation.
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Commit changes with clear, descriptive messages
- Open a Pull Request against
main
Licensed under the Apache License 2.0.
Built with ❤️ by Roshan Jayswal