Skip to main content

What We’ll Build

A research agent using LangGraph (Python) 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

  • Python 3.11+
  • LangGraph installed (pip install langgraph langchain-openai)
  • Crewship CLI installed and authenticated
Want to skip the setup? Clone the langgraph-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/research_agent/graph.py:
graph.py
The compiled graph object 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 pyproject.toml:
pyproject.toml

Step 5: Add Crewship Configuration

Run crewship init to auto-generate the config — or create it manually:
crewship.toml
The entrypoint uses Python module path format: dots for directories, colon before the variable name.

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 — a dictionary 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.js Agent

Build the same agent in TypeScript

Configuration Reference

crewship.toml options