npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

checkpoint-redis

v0.3.0

Published

langchain redis checkpoint saver

Readme

checkpoint-redis

The only Redis-based checkpoint saver for LangGraph in TypeScript/JavaScript

A Redis checkpoint saver for LangGraph that persists your app state across restarts and scales with your application.

Why checkpoint-redis?

Fills a Gap

  • Only Redis checkpoint saver for LangGraph in TypeScript/JavaScript
  • Official LangGraph checkpoint savers are Python-only (SQLite, PostgreSQL)
  • Essential for Node.js/TypeScript LangGraph applications

Fast & Reliable

  • Redis-powered: Fast read/write operations
  • Scales easily: Share state across multiple app instances
  • Memory efficient: Redis handles the heavy lifting
  • TTL support: Automatic cleanup of old checkpoints
  • High availability: Redis clustering and replication support

Keeps Your App Running

  • Survive restarts: Resume where you left off
  • Persistent state: Conversations and workflows persist
  • Easy debugging: Check execution history and state
  • Fault tolerance: Graceful recovery with checkpoints

Perfect For

  • Long conversations with AI agents
  • Multi-step workflows that need state persistence
  • Distributed systems with shared state
  • Applications requiring reliability

Install

npm install checkpoint-redis

Quick Start

import { RedisSaver } from "checkpoint-redis";
import { Redis } from "ioredis";
import { StateGraph } from "@langchain/langgraph";

// Create Redis connection
const redis = new Redis(process.env.REDIS_URL);

// Create checkpoint saver
const checkpointSaver = new RedisSaver({ connection: redis });

// Use with LangGraph
const workflow = new StateGraph({
  // ... your graph definition
}).compile({
  checkpointer: checkpointSaver
});

// Your workflow now persists state to Redis!
const result = await workflow.invoke(
  { input: "Hello" },
  { configurable: { thread_id: "conversation-123" } }
);

Advanced Usage

Custom Configuration

import { RedisSaver } from "checkpoint-redis";
import { Redis } from "ioredis";

// Redis with custom configuration
const redis = new Redis({
  host: "localhost",
  port: 6379,
  password: "your-password",
  db: 0,
  retryDelayOnFailover: 100,
  maxRetriesPerRequest: 3,
});

// Basic checkpoint saver
const checkpointSaver = new RedisSaver({ connection: redis });

// With TTL (checkpoints expire after 1 hour)
const checkpointSaverWithTTL = new RedisSaver({ 
  connection: redis, 
  ttl: 3600 // 1 hour in seconds
});

Multiple Threads

// Each conversation gets its own thread
const config1 = { configurable: { thread_id: "user-123" } };
const config2 = { configurable: { thread_id: "user-456" } };

// These run independently with separate state
await workflow.invoke({ input: "Hi" }, config1);
await workflow.invoke({ input: "Hello" }, config2);

Checkpoint Management

// List all checkpoints for a thread
for await (const checkpoint of checkpointSaver.list({
  configurable: { thread_id: "user-123" }
})) {
  console.log(`Checkpoint: ${checkpoint.checkpoint.id}`);
  console.log(`Timestamp: ${checkpoint.checkpoint.ts}`);
}

// Get specific checkpoint
const specific = await checkpointSaver.getTuple({
  configurable: { 
    thread_id: "user-123",
    checkpoint_id: "specific-checkpoint-id"
  }
});

Comparison with Alternatives

| Solution | Language | Storage | Production Ready | Performance | Setup | |----------|----------|---------|------------------|-------------|-------| | checkpoint-redis | TypeScript | Redis | | ⚡ High | Easy | | InMemorySaver | TypeScript | Memory | ❌ | ⚡ Fast | Trivial | | SqliteSaver | Python | SQLite | ⚠️ | 🐌 Slow | Easy | | PostgresSaver | Python | PostgreSQL | ✅ | 🚀 Fast | Complex |

Requirements

  • Node.js >= 18
  • Redis server
  • @langchain/core >= 0.2.31
  • @langchain/langgraph-checkpoint ^0.0.6
  • ioredis >= 5.0.0

API Reference

RedisSaver

Constructor

new RedisSaver({ connection: Redis, ttl?: number }, serde?: SerializerProtocol)

Parameters:

  • connection - Redis connection instance
  • ttl - Optional TTL in seconds for checkpoint keys (default: no expiration)

Methods

  • put(config, checkpoint, metadata) - Save a checkpoint
  • getTuple(config) - Retrieve a checkpoint
  • putWrites(config, writes, taskId) - Save pending writes
  • list(config, options?) - List checkpoints with optional filtering

Migration Guide

Upgrading from v0.1.x? See our migration guide for details on new features and improvements.

Contributing

Contributions welcome! Please see our contributing guidelines.

Roadmap

Planned improvements for checkpoint-redis:

  • Error Handling - Better validation and error messages
  • Performance - Batch operations and memory optimization
  • Code Quality - Fix bugs and improve consistency
  • API Improvements - More configuration options and better types

See the detailed roadmap for the complete list.

License

MIT © Levi Voelz