Building graph-based LLM systems, one node at a time
๐ What This Covers โข ๐ง Key Concepts โข ๐ Repository Structure โข ๐ Getting Started
This repository contains structured learning and practical implementations of LangGraph, focusing on how to build graph-based LLM systems, manage state, route tools, and design non-trivial agent workflows.
Learn by building, not just reading documentation.
This is not a tutorial copy or boilerplate repo. Every example here is built from the ground up to understand LangGraph at a system-design level โ how to think in graphs, control LLM execution, and build extensible agent systems.
|
|
|
|
|
|
Designing LLM systems as directed graphs instead of linear flows. This enables:
- Dynamic branching based on LLM decisions
- Parallel execution of independent tasks
- Conditional logic and loops
- Better control over complex workflows
Explicit state schema controlling how data flows through nodes:
class AgentState(TypedDict):
messages: Annotated[list, add_messages]
context: str
user_info: dictLetting the model decide when tools are required:
- LLM evaluates if a tool is needed
- Graph routes to tool execution
- Results feed back to LLM for synthesis
Persisting conversation state across executions:
- Thread-based conversations
- Resume interrupted workflows
- Multi-session memory
Most examples follow this powerful pattern:
START
โ
LLM Node
โ
(Conditional)
โ โ
Tool Node Direct Response
โ โ
โ
END / Loop
| Feature | Benefit |
|---|---|
| Dynamic Branching | LLM decides the execution path |
| Tool Execution | Automatic tool invocation when needed |
| Iterative Reasoning | Loop back for multi-step problems |
| Conditional Logic | Different paths for different scenarios |
langgraph-complete-guide/
โ
โโโ 1.Sequential_workflow/ # Learn sequential graph execution
โโโ 2.Parallel_workflow/ # Parallel node execution patterns
โโโ 3.Conditional_workflow/ # Conditional routing and branching
โโโ 4.Iterative_workflow/ # Loops and iterative reasoning
โโโ 6.Persistence/ # In-memory checkpointing
โโโ 7.ChatBot/ # Full chatbot implementation
โโโ 8.SQLite_Database/ # SQLite-backed persistence
โโโ 9.LangSmith/ # LangSmith tracing integration
โโโ 10.Chatbot_tools/ # Chatbots with tool integration
โโโ 11.Chatbot_with_tools_SQLite/ # Complete chatbot + tools + DB
โโโ 12.MCP/ # Model Context Protocol examples
โ
โโโ requirements.txt
โโโ .env.example
โโโ README.md
Each folder contains runnable examples focusing on one concept at a time.
Learn the basics of LangGraph by building simple sequential flows.
- Define nodes and edges
- Create linear execution paths
- Understand state management
Execute multiple nodes in parallel for efficiency.
- Parallel node execution
- Fan-out and fan-in patterns
- Combining parallel results
Build intelligent routing based on conditions.
- Conditional edges
- Dynamic path selection
- If-else logic in graphs
Implement loops and recursive patterns.
- Loop until condition met
- Iterative problem solving
- Self-correction loops
Add memory to your graphs with checkpointing.
- In-memory checkpointers
- Save and resume conversations
- Thread-based state management
Build a complete conversational agent.
- Multi-turn conversations
- Context maintenance
- Natural dialogue flow
Persist conversation state in SQLite.
- Database schema design
- Save/load checkpoints
- Long-term memory storage
Integrate LangSmith for observability.
- Trace graph execution
- Debug agent behavior
- Performance monitoring
Add tool-calling capabilities to chatbots.
- Web search integration
- API calling
- Tool result synthesis
Complete production-ready chatbot.
- Tool integration
- Persistent memory
- Full conversation management
Work with Model Context Protocol.
- MCP integration
- Context sharing
- Advanced communication patterns
- Python 3.8+
- Cohere API Key (Get one here)
- Basic understanding of LangChain concepts
git clone https://github.com/Nabin68/Langgraph-complete-guide.git
cd Langgraph-complete-guidepip install -r requirements.txtKey dependencies:
langchain
langchain-cohere
langgraph
python-dotenv
sqlite3
Create a .env file in the project root:
COHERE_API_KEY=your_cohere_api_key_here
LANGSMITH_API_KEY=your_langsmith_key_here # OptionalNavigate to any folder and run the example:
cd 1.Sequential_workflow
python main.py- Start with
1.Sequential_workflow - Move to
2.Parallel_workflow - Understand
3.Conditional_workflow - Practice
4.Iterative_workflow
- Explore
6.Persistence - Build
7.ChatBot - Integrate
10.Chatbot_tools
- Study
8.SQLite_Database - Implement
11.Chatbot_with_tools_SQLite - Master
12.MCP - Experiment with
9.LangSmith
| Technology | Purpose |
|---|---|
| Python | Core language |
| LangGraph | Graph-based orchestration |
| LangChain | LLM framework |
| Cohere | Language model provider |
| SQLite | Persistent storage |
| LangSmith | Observability & tracing |
| Streamlit | UI demonstrations |
This repository exists to:
โ
Learn LangGraph at a system-design level
โ
Understand agent workflows beyond simple chatbots
โ
Practice production-relevant patterns
โ
Serve as a reference for future projects
โ A tutorial copy
โ A boilerplate repo
โ Just documentation reading
โ
Practical, runnable code
โ
Progressive learning path
โ
Real-world patterns
โ
Production-ready examples
- RAG workflows using LangGraph
- Multi-agent graph patterns
- Advanced MCP integrations
- Vector database integration
- Deployment examples (Docker, Cloud)
- Performance optimization techniques
- Error handling best practices
- Testing strategies for graphs
After working through this repository, you will understand:
- Design workflows as nodes and edges
- Visualize execution flow
- Plan conditional paths
- Manage state explicitly
- Route based on conditions
- Handle tool calls gracefully
- Modular node design
- Reusable graph patterns
- Scalable architecture
- LangGraph Docs: https://langchain-ai.github.io/langgraph/
- LangChain Docs: https://python.langchain.com/docs/
- Cohere Platform: https://cohere.com/
- LangSmith: https://smith.langchain.com/
Nabin
Focused on LangGraph, agent systems, and scalable AI workflows.
- GitHub: @Nabin68
- Repository: Langgraph-complete-guide
This project is open source and available under the MIT License.
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page if you want to contribute.
If you are learning LangGraph seriously, this repository demonstrates:
- โ How to think in graphs โ Not just chains
- โ How to control LLM execution โ Explicit state management
- โ How to build extensible agent systems โ Production patterns