To deploy a LangGraph application to LangGraph Cloud, your application code must reside in a GitHub repository. Both public and private repositories are supported.
For this guide, we'll use the pre-built Python ReAct Agent template.
Get Required API Keys for the ReAct Agent template
This ReAct Agent application requires an API key from Anthropic and Tavily. You can get these API keys by signing up on their respective websites.
Alternative: If you'd prefer a scaffold application that doesn't require API keys, use the New LangGraph Project template instead of the ReAct Agent template.
1. Log in to LangSmith
Go to LangSmith and log in. If you don't have an account, you can sign up for free.
2. Click on LangGraph Platform (the left sidebar)
Select LangGraph Platform from the left sidebar.
3. Click on + New Deployment (top right corner)
Click on + New Deployment to create a new deployment. This button is located in the top right corner.
It'll open a new modal where you can fill out the required fields.
4. Click on Import from GitHub (first time users)
Click on Import from GitHub and follow the instructions to connect your GitHub account. This step is needed for first-time users or to add private repositories that haven't been connected before.5. Select the repository, configure ENV vars etc
Select the repository, add env variables and secrets, and set other configuration options.
Repository: Select the repository you forked earlier (or any other repository you want to deploy).
Set the secrets and environment variables required by your application. For the ReAct Agent template, you need to set the following secrets:
6. Click Submit to Deploy!
Please note that this step may ~15 minutes to complete. You can check the status of your deployment in the Deployments view.
Click the Submit button at the top right corner to deploy your application.
Once your application is deployed, you can test it in LangGraph Studio.
1. Click on an existing deployment
Click on the deployment you just created to view more details.
2. Click on LangGraph Studio
Click on the LangGraph Studio button to open LangGraph Studio.
The API calls below are for the ReAct Agent template. If you're deploying a different application, you may need to adjust the API calls accordingly.
Before using, you need to get the URL of your LangGraph deployment. You can find this in the Deployment view. Click the URL to copy it to the clipboard.
You also need to make sure you have set up your API key properly, so you can authenticate with LangGraph Cloud.
exportLANGSMITH_API_KEY=...
Install the LangGraph Python SDK
pipinstalllanggraph-sdk
Send a message to the assistant (threadless run)
fromlanggraph_sdkimportget_clientclient=get_client(url="your-deployment-url",api_key="your-langsmith-api-key")asyncforchunkinclient.runs.stream(None,# Threadless run"agent",# Name of assistant. Defined in langgraph.json.input={"messages":[{"role":"human","content":"What is LangGraph?",}],},stream_mode="updates",):print(f"Receiving new event of type: {chunk.event}...")print(chunk.data)print("\n\n")
Install the LangGraph Python SDK
pipinstalllanggraph-sdk
Send a message to the assistant (threadless run)
fromlanggraph_sdkimportget_sync_clientclient=get_sync_client(url="your-deployment-url",api_key="your-langsmith-api-key")forchunkinclient.runs.stream(None,# Threadless run"agent",# Name of assistant. Defined in langgraph.json.input={"messages":[{"role":"human","content":"What is LangGraph?",}],},stream_mode="updates",):print(f"Receiving new event of type: {chunk.event}...")print(chunk.data)print("\n\n")
Install the LangGraph JS SDK
npminstall@langchain/langgraph-sdk
Send a message to the assistant (threadless run)
const{Client}=awaitimport("@langchain/langgraph-sdk");constclient=newClient({apiUrl:"your-deployment-url",apiKey:"your-langsmith-api-key"});conststreamResponse=client.runs.stream(null,// Threadless run"agent",// Assistant ID{input:{"messages":[{"role":"user","content":"What is LangGraph?"}]},streamMode:"messages",});forawait(constchunkofstreamResponse){console.log(`Receiving new event of type: ${chunk.event}...`);console.log(JSON.stringify(chunk.data));console.log("\n\n");}
Congratulations! If you've worked your way through this tutorial you are well on your way to becoming a LangGraph Cloud expert. Here are some other resources to check out to help you out on the path to expertise:
Launch Local LangGraph Server: This quick start guide shows how to start a LangGraph Server locally for the ReAct Agent template. The steps are similar for other templates.