What We’ll Build
A research agent using LangGraph.js (TypeScript) that:- Receives a topic as input
- Runs a researcher node to gather key facts
- Runs a reporter node to expand findings into a markdown report
Prerequisites
- Node.js 20+
- Crewship CLI installed and authenticated
Step 1: Create the Project
Step 2: Define Your Graph
Createsrc/graph.ts:
graph.ts
graph is what Crewship invokes. Your input (e.g., {"topic": "quantum computing"}) becomes the initial state.
Step 3: Add langgraph.json
Createlanggraph.json in the project root — this lets crewship init auto-detect the framework:
langgraph.json
Step 4: Add Dependencies
Createpackage.json:
package.json
tsconfig.json:
tsconfig.json
Step 5: Add Crewship Configuration
Runcrewship 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
Step 9: Access the Output
The run result is the final graph state — an object with all state keys: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