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 🙏

© 2025 – Pkg Stats / Ryan Hefner

langgraph-checkpoint-filesystem

v0.2.3

Published

Langgraph checkpoint implementation based on file system

Readme

langgraph-checkpoint-filesystem

CI npm Release

An implementation of the Checkpointer interface for LangGraph.js, uses file storage to persist state.

https://www.npmjs.com/package/langgraph-checkpoint-filesystem

Version required:

  "peerDependencies": {
    "@langchain/core": "^0.3.74",
    "@langchain/langgraph-checkpoint": "^0.1.1"
  },

File storage hierarchy

|- /{thread_id}
|- |- /{checkpoint_ns}
|- |- |- /{checkpoint_id}
|- |- |- |- /writes
|- |- |- |- |- {task_id}$$${channel}$$${idx}
|- |- |- |- /checkpoints
|- |- |- |- |- extra.json
|- |- |- |- |- metadata
|- |- |- |- |- checkpoint
  • checkpoint_ns: will use __DEFAULT_NS__ if the ns is empty string "";
  • {task_id}$$${channel}$$${idx}: each writes file is a binary file
  • extra.json: some extra params of this checkpoint like parentCheckpointId
  • metadata: binary file of this checkpoint's metadata
  • checkpoint: binary file of this checkpoint

How to use

Install dependency

pnpm add langgraph-checkpoint-filesystem

Use it in your graph

import path from 'path';
import { FileSystemSaver } from 'langgraph-checkpoint-filesystem';
import { AIMessage, HumanMessage } from '@langchain/core/messages';
import { Annotation, END, MessagesAnnotation, START, StateGraph } from '@langchain/langgraph';

const TEST_ROOT_FOLDER = path.resolve(__dirname, './test-checkpoint-file-store-checkpoint-1');

const FILE_SAVER = new FileSystemSaver({
  rootFolder: TEST_ROOT_FOLDER,
});

const GRAPH_STATE = Annotation.Root({
  ...MessagesAnnotation.spec,
  foo: Annotation<string>,
});

const llmNode = () => {
  return {
    messages: [new AIMessage('Hi, I am your assistant')],
    foo: 'foo1',
  };
};

const toolNode = () => {
  return {
    foo: 'foo2',
  };
};

const graph = new StateGraph(GRAPH_STATE)
  .addNode('llm', llmNode)
  .addNode('tool', toolNode)
  .addEdge(START, 'llm')
  .addEdge('llm', 'tool')
  .addEdge('tool', END)
  .compile({ checkpointer: FILE_SAVER });

await graph.invoke({}, { configurable: { thread_id: 'th_1234' } });

Input of the constructor

  • rootFolder: the root folder you want to save the data
  • splitter: to split the name of writes binary file
  • serde: extending from BaseCheckpointSaver
constructor(options?: { serde?: SerializerProtocol; rootFolder?: string; splitter?: string }) {
    const { rootFolder, splitter, serde } = options ?? {};
    super(serde);
    this.pathResolver = new StorePathResolver(rootFolder, splitter);
}

Development

test

The test scripts will be auto executed after commit action, you can also run it directly.

pnpm run test
→ No staged files match any configured task.

> [email protected] test
> rstest

  Rstest v0.3.2

 ✓ tests/putWrites-2.test.ts (1)
 ✓ tests/putWrites-3.test.ts (1)
 ✓ tests/getTuple-2.test.ts (5)
 ✓ tests/getTuple-1.test.ts (5)
 ✓ tests/put-1.test.ts (6)
 ✓ tests/putWrites-1.test.ts (2)
 ✓ tests/list-1.test.ts (14)
 ✓ tests/graph-4.test.ts (1)
 ✓ tests/graph-3.test.ts (1)
 ✓ tests/graph-2.test.ts (1)
 ✓ tests/graph-1.test.ts (6)

 Test Files 11 passed
      Tests 43 passed
   Duration 463ms (build 81ms, tests 382ms)