A learning project that builds an email-processing agent with LangGraph.
- A model node that reasons over
MessagesState. - Tool calling with
bind_tools()andToolNode. - Explicit ReAct-style routing: model -> tools -> model.
- Human approval with
interrupt()before side-effecting actions. - Durable SQLite checkpoints with
SqliteSaver. - A nested notice-extraction graph with its own domain state and approval step.
chains/ LangChain structured-output pipelines
graphs/ Main email graph and notice subgraph
utils/ Simulated email and legal-ticket integrations
Use Python 3.11 or newer and create a virtual environment:
python -m venv venv
.\venv\Scripts\python.exe -m pip install -r requirements.txtCreate a .env file with the model settings expected by ChatOpenAI:
LLM_MODEL=your-model
LLM_API_KEY=your-api-key
BASE_URL=https://your-openai-compatible-endpoint/v1
From the Langgraph directory:
.\venv\Scripts\python.exe -m graphs.run_email_agentThe runner processes the first sample email, pauses for approval when needed, resumes using the same thread_id, and prints the checkpointed state.
email_agent -> approval -> email_tools -> email_agent
|
+-> extract_notice_data -> notice extraction graph
The SQLite checkpoint files, .env, and virtual environment are local runtime artifacts and are excluded from Git.

