What We’ll Build
A research agent using LangGraph (Python) 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
- Python 3.11+
- LangGraph installed (
pip install langgraph langchain-openai) - Crewship CLI installed and authenticated
Step 1: Create the Project
Step 2: Define Your Graph
Createsrc/research_agent/graph.py:
graph.py
graph object 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
Createpyproject.toml:
pyproject.toml
Step 5: Add Crewship Configuration
Runcrewship 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
Step 9: Access the Output
The run result is the final graph state — a dictionary with all state keys: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