Who it is forA developer whose research or data agent runs for an hour and loses everything when one API call times out.
The problemA long agent loop that dies halfway through has to start again from zero, wasting time and tokens.
The outcomeAn agent built as a LangGraph graph that persists its progress and resumes from the last step after a failure.
What you need first
- Python and pip
- An LLM provider for your agent's model calls
- Optional: a LangSmith account for tracing and the LangSmith Deployment platform
- For JavaScript or TypeScript, the separate LangGraph.js library
Steps
- Install the library with
pip install -U langgraph - Work through the LangGraph Quickstart in the docs to define your agent as a graph of steps
- Add persistence following the Durable execution guide so each step's state is saved
- Kill the process mid-run, restart it and confirm it continues from the last saved step
- Use the Guides for streaming, memory and persistence, and design patterns such as branching and subgraphs
Prompt for your agent
Using langchain-ai/langgraph, build a <describe agent> as a graph with durable execution, following the official Quickstart and Durable execution docs. Then show me that if I stop the process halfway, rerunning it resumes from the last completed step instead of starting over.
Caveat. The README links out to the docs for all code, so plan to read the Quickstart and Durable execution pages; LangGraph is low level and you write the graph yourself.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for langchain-ai/langgraph and "Build an agent that resumes after a crash"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer