Monorepo for learning how to build stateful LLM workflows with LangGraph.
It contains two small, practical projects:
calculator: tool-calling arithmetic agentsupport_email: customer support workflow with routing and human review
A compact project to understand the LangGraph fundamentals:
- graph state
- nodes
- conditional routing
- tool execution loop
How it works:
llm_callreceives messages and decides whether to call a tool.tool_nodeexecutes one of the arithmetic tools (add,subtract,multiply,divide).should_continueloops back to the LLM or ends the graph.
Main files:
calculator/tools.py: model setup + toolscalculator/state.py: graph state schemacalculator/nodes.py: node logiccalculator/build_compile.py: build/compile graph, generate imagecalculator/invoke.py: runnable example
A larger workflow showing multi-step orchestration:
- read incoming email
- classify intent and urgency
- route to docs search or bug tracking
- draft response
- pause for human approval (
interrupt) - resume and send reply
Main files:
support_email/state.py: typed workflow statesupport_email/compile.py: graph assembly + memory checkpointersupport_email/nodes/*: business steps (classification, search, response)support_email/run_agent.py: end-to-end example with resume
- Python 3.11+ (3.12 recommended)
- virtual environment
- provider API key in
.env
python -m venv venv
.\venv\Scripts\Activate.ps1
pip install langgraph langchain langchain-deepseek langchain-openai python-dotenv ipython taskipyCreate .env at the project root:
DEEPSEEK_API_KEY=your_key_hereWith tasks (from pyproject.toml):
task calculator
task support_emailOr directly:
python -m calculator.invoke
python -m support_email.run_agentTo generate the calculator graph image:
python -m calculator.build_compileRecommended order:
- Start with
calculatorto learn LangGraph basics. - Move to
support_emailto learn branching, persistence, and human-in-the-loop review.