Skip to content

Repository files navigation

LangGraph Email Agent

A learning project that builds an email-processing agent with LangGraph.

What it demonstrates

  • A model node that reasons over MessagesState.
  • Tool calling with bind_tools() and ToolNode.
  • 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.

Project layout

chains/     LangChain structured-output pipelines
graphs/     Main email graph and notice subgraph
utils/      Simulated email and legal-ticket integrations

Setup

Use Python 3.11 or newer and create a virtual environment:

python -m venv venv
.\venv\Scripts\python.exe -m pip install -r requirements.txt

Create 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

Run

From the Langgraph directory:

.\venv\Scripts\python.exe -m graphs.run_email_agent

The runner processes the first sample email, pauses for approval when needed, resumes using the same thread_id, and prints the checkpointed state.

Architecture

email_agent -> approval -> email_tools -> email_agent
                            |
                            +-> extract_notice_data -> notice extraction graph

Graph Visualizations

Email Agent Graph

Email agent graph

Notice Extraction Graph

Notice extraction graph

The SQLite checkpoint files, .env, and virtual environment are local runtime artifacts and are excluded from Git.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages