DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to build an agent that resumes after a crash with Langgraph

Use LangGraph's durable execution so a long agent run picks up exactly where it stopped.

Short answer: Install the library with pip install -U langgraph; then 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. All steps.

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

  1. Install the library with pip install -U langgraph
  2. Work through the LangGraph Quickstart in the docs to define your agent as a graph of steps
  3. Add persistence following the Durable execution guide so each step's state is saved
  4. Kill the process mid-run, restart it and confirm it continues from the last saved step
  5. 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

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer