Latest Socket ResearchMalicious Chrome Extension Performs Hidden Affiliate Hijacking.Details
Socket
Book a DemoInstallSign in
Socket

create-langgraph

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-langgraph

Create a new LangGraph project

latest
Source
npmnpm
Version
1.1.5
Version published
Weekly downloads
32K
-8.28%
Maintainers
1
Weekly downloads
 
Created
Source

create-langgraph

npm version License: MIT

The official scaffolding tool for LangGraph.js projects. Quickly bootstrap new LangGraph applications from curated templates or generate configuration files for existing projects.

Quick Start

Create a new LangGraph project with a single command:

# Using npm
npm init langgraph@latest

# Using yarn
yarn create langgraph

# Using pnpm
pnpm create langgraph

# Using pnpm
pnpm create langgraph

# Using bun
bunx create-langgraph

Follow the interactive prompts to select a template and configure your project.

Templates

Choose from a variety of production-ready templates:

TemplateDescription
New LangGraph ProjectA simple, minimal chatbot with memory
ReAct AgentA flexible agent that can be extended with many tools
Memory AgentA ReAct-style agent with persistent memory across conversations
Retrieval AgentAn agent with retrieval-based question-answering
Data-enrichment AgentAn agent that performs web searches and organizes findings

Using a Specific Template

Skip the interactive prompt by specifying a template directly:

npx create-langgraph@latest my-project --template react-agent-js

Available template IDs:

  • new-langgraph-project-js
  • react-agent-js
  • memory-agent-js
  • retrieval-agent-js
  • data-enrichment-js

Commands

create-langgraph [path]

Creates a new LangGraph project at the specified path.

npx create-langgraph@latest my-awesome-agent

Options:

  • -t, --template <template> — Use a specific template (skips interactive selection)

What it does:

  • Downloads the selected template from GitHub
  • Extracts it to your target directory
  • Optionally initializes a Git repository
  • Provides next steps for getting started

create-langgraph config [path]

Scans your project for LangGraph agents and generates a langgraph.json configuration file.

# In your project directory
npx create-langgraph@latest config

# Or specify a path
npx create-langgraph@latest config ./my-project

This command is useful when:

  • You have an existing project and want to add LangGraph Platform support
  • You've added new agents and need to update your configuration
  • You want to automatically detect all agents in your codebase

Agent Detection

The config command automatically detects LangGraph agents defined using these patterns:

ESM (ES Modules)

// Using createAgent
export const agent = createAgent({ model, tools });

// Using StateGraph
export const graph = new StateGraph(annotation).compile();

// Using workflow builder pattern
export const app = workflow.compile();

CommonJS

// Using module.exports
module.exports.agent = createAgent({ model, tools });
module.exports.graph = workflow.compile();

// Using exports shorthand
exports.myAgent = createAgent({ model, tools });

What Gets Detected

The scanner looks for:

  • createAgent() function calls
  • new StateGraph(...).compile() patterns
  • workflow.compile() or builder.compile() patterns

Important: Only exported agents are included in the generated configuration. Unexported agents will be listed as warnings so you can add the export keyword if needed.

Generated Configuration

The config command generates a langgraph.json file like this:

{
  "node_version": "20",
  "graphs": {
    "agent": "./src/agent.ts:agent",
    "searchAgent": "./src/search.ts:searchAgent"
  },
  "env": ".env"
}

The configuration includes:

  • node_version — Detected from your current Node.js version
  • graphs — Map of agent names to their file paths and export names
  • env — Path to .env file (if one exists)

Project Structure

After scaffolding, your project will have this structure:

my-project/
├── src/
│   └── agent.ts       # Your LangGraph agent
├── langgraph.json     # LangGraph configuration
├── package.json
├── tsconfig.json
└── .env.example       # Environment variables template

Next Steps After Creating a Project

# Navigate to your project
cd my-project

# Install dependencies
npm install  # or yarn, pnpm, bun

# Start the LangGraph development server
npx @langchain/langgraph-cli@latest dev

The development server provides:

  • A local API server for your agents
  • Hot reloading during development
  • Built-in debugging tools

Analytics

This CLI collects anonymous usage analytics to help improve the tool. The following information is collected:

  • Operating system and version
  • Node.js version
  • CLI version
  • Command executed

No personal information, project details, or code is ever collected.

To opt out of analytics, set the environment variable:

export LANGGRAPH_CLI_NO_ANALYTICS=1

Requirements

  • Node.js 18 or later
  • npm, yarn, pnpm, or bun

License

MIT © LangChain

FAQs

Package last updated on 09 Jan 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts