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

@langgraphjs/toolkit

v1.2.10

Published

Core toolkit for LangGraph.js — provides agent templates, middleware, and utilities not included in @langchain/langgraph

Readme

@langgraphjs/toolkit

Core toolkit for LangGraph.js — agent templates, middleware, and utilities not included in @langchain/langgraph.

Install

npm install @langchain/langgraph @langchain/core @langchain/openai @langgraphjs/toolkit

What It Provides

import {
  // Agent templates — domain-specific presets not in @langchain/langgraph
  createResearchAgent,
  createCodingAgent,
  createConversationalAgent,
  createDataAnalysisAgent,

  // Long-term memory — conversation summarization beyond MemorySaver
  AgentMemory,

  // Token management — cost tracking and circuit-breaking
  TokenBudget,

  // Production middleware — not in @langchain/langgraph
  RateLimiter,
  withRetry,
  StructuredLogger,
} from "@langgraphjs/toolkit";

These are not available in @langchain/langgraph or @langchain/langgraph/prebuilt.

Quick Start

import { ChatOpenAI } from "@langchain/openai";
import { createResearchAgent, TokenBudget } from "@langgraphjs/toolkit";

const budget = new TokenBudget({ maxTokensPerRequest: 50_000 });

const agent = createResearchAgent({
  llm: new ChatOpenAI({
    modelName: "gpt-4o",
    callbacks: [budget.createCallbackHandler()],
  }),
});

const result = await agent.invoke({
  messages: [{ role: "human", content: "Research LangGraph TypeScript" }],
});

console.log("Tokens used:", budget.getUsage().totalTokens);

Agent Templates

| Template | Use Case | |----------|----------| | createResearchAgent | Web search, fact verification, report synthesis | | createCodingAgent | Code analysis, generation, refactoring | | createConversationalAgent | Multi-turn dialogue with context retention | | createDataAnalysisAgent | Data processing, statistics, insights |

AgentMemory

Long-term conversational memory with summarization. Unlike MemorySaver (which stores raw message history), AgentMemory compresses conversations into summaries and extracts entities.

import { AgentMemory } from "@langgraphjs/toolkit";

const memory = new AgentMemory({ llm: model, maxMessages: 20 });
await memory.update(messages);
const context = memory.getContext(); // Compressed summary

TokenBudget

Track and limit LLM token usage with automatic circuit-breaking.

import { TokenBudget } from "@langgraphjs/toolkit";

const budget = new TokenBudget({
  maxTokensPerRequest: 50_000,
  maxTokensPerSession: 500_000,
  onBudgetExceeded: (usage) => console.warn("Budget exceeded:", usage),
});

Middleware

import { RateLimiter, withRetry, StructuredLogger } from "@langgraphjs/toolkit";

// Rate limiting for LLM API calls
const limiter = new RateLimiter({ maxRequests: 10, windowMs: 60_000 });

// Exponential backoff retry
const result = await withRetry(() => agent.invoke(input), { maxRetries: 3 });

// Structured logging for agent execution
const logger = new StructuredLogger((entry) => console.log(entry));

Documentation

Full guides and tutorials at langgraphjs.guide.

Telemetry

This package runs a lightweight environment compatibility check on install and reports anonymous diagnostics (platform, Node version, architecture). No source code, tokens, or credentials are transmitted. Respects DO_NOT_TRACK.

LANGGRAPHJS_TELEMETRY_DISABLED=1 npm install

License

MIT