Skip to main content

What We’ll Build

A research agent using LangGraph.js (TypeScript) that:
  1. Receives a topic as input
  2. Runs a researcher node to gather key facts
  3. Runs a reporter node to expand findings into a markdown report

Prerequisites

  • Node.js 20+
  • Crewship CLI installed and authenticated
Want to skip the setup? Clone the langgraph-js-quickstart repo and run crewship deploy to get a working agent deployed in minutes.

Step 1: Create the Project

Your project structure:

Step 2: Define Your Graph

Create src/graph.ts:
graph.ts
The exported graph is what Crewship invokes. Your input (e.g., {"topic": "quantum computing"}) becomes the initial state.

Step 3: Add langgraph.json

Create langgraph.json in the project root — this lets crewship init auto-detect the framework:
langgraph.json

Step 4: Add Dependencies

Create package.json:
package.json
Create tsconfig.json:
tsconfig.json

Step 5: Add Crewship Configuration

Run crewship init to auto-generate the config — or create it manually:
crewship.toml
LangGraph.js uses a file path entrypoint (with ./), unlike Python frameworks which use a module path. The python field is not applicable.

Step 6: Set Environment Variables

Step 7: Deploy

Step 8: Run Your Agent

Watch the execution:

Step 9: Access the Output

The run result is the final graph state — an object with all state keys:
To save the report as an artifact, write it to the artifacts/ directory inside your node:

Next Steps

Streaming

Real-time event streaming from runs

Threads

Stateful conversations with LangGraph

Your First LangGraph Agent

Build the same agent in Python

Configuration Reference

crewship.toml options