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-js/pro

v2.2.0

Published

The Pro SDK for LangGraph - seamlessly integrate your AI agents with frontend interfaces and build complex AI workflows

Readme

@langgraph-js/pro

npm version license

This is an extension library for LangGraph that provides additional convenient features and tools, helping developers build complex AI workflows more easily. It's particularly suitable for building multi-agent collaboration, deep research, task planning, and other complex scenarios.

LangGraph 1.0 Support!

Getting Started

1. State Management

import { AgentState } from "@langgraph-js/pro";
import { z } from "zod";
// 创建自定义状态
const PlannerState = AgentState.merge(
    z.object({
        current_plan: z.any().nullable(),
        title: z.string(),
    })
);

// 扩展已有状态
const ExportState = PlannerState.merge(
    z.object({
        description: z.string(),
    })
);

2. Swarm Agent

import { createAgent } from "langchain";
import { createSwarm, createHandoffTool } from "@langgraph-js/pro";

// Create coordinator agent
const coordinator_agent = createAgent({
    name: "coordinator",
    model,
    tools: [
        createHandoffTool({
            agentName: "planner",
            description: "Create plan",
            // it will keep all state sync with Swarm
            updateState: keepAllStateInHandOff,
        }),
    ],
    systemPrompt: "",
});

// Create swarm collaboration
const swarm = createSwarm({
    agents: [coordinator, planner, researcher, reporter],
    defaultActiveAgent: "coordinator",
});

3. Frontend Actions (Tools) Support

import { createFeTools, FEToolsState } from "@langgraph-js/pro";

// Define tools
const tools = [
    {
        name: "search",
        description: "Search information",
        parameters: [
            {
                name: "query",
                type: "string",
                description: "Search keywords",
                required: true,
            },
        ],
    },
];

// Create state with tools
const State = createState(FEToolsState).build({});

// Use tools in node
const node = (state) => {
    const feTools = createFeTools(state.fe_tools);
    llm.bindTools(feTools);
};

4. Messages Utils

import { getLastHumanMessage, getTextMessageContent } from "@langgraph-js/pro";

// Get last human message
const lastMessage = getLastHumanMessage(state.messages);

// Get message text content
const content = getTextMessageContent(message);

5. Model Helper

import { createModelHelper } from "@langgraph-js/pro";

// 创建模型状态和工具
const { ModelState, createLLM } = createModelHelper({
    main_model: ["gemini-2.5-flash"],
    assistant_model: ["gpt-4-turbo-preview"],
});

// 扩展状态
const GraphState = createState(ModelState).build({});

// 使用模型
const llm = await createLLM(state, "main_model", {
    temperature: 0.7,
    streaming: true,
});

6. Web Tools

import { crawler_tool, web_search_tool } from "@langgraph-js/pro";

//  env file SEARCH_SERVER_URL=https://website-to-md.deno.dev
const tools = [crawler_tool, web_search_tool];

License

This project is licensed under the Apache-2.0 License.