Skip to main content
An application must be configured with a configuration file in order to be deployed to LangSmith (or to be self-hosted). This how-to guide discusses the basic steps to set up a JavaScript application for deployment using package.json to specify project dependencies. This walkthrough is based on this repository, which you can play around with to learn more about how to set up your application for deployment. The final repository structure will look something like this:
LangSmith Deployment supports deploying a LangGraph graph. However, the implementation of a node of a graph can contain arbitrary code. This means any framework can be implemented within a node and deployed on LangSmith Deployment. This lets you implement your core application logic without using additional LangGraph OSS APIs while still using LangSmith for deployment, scaling, and observability. For more details, refer to Use any framework with LangSmith Deployment.
After each step, an example file directory is provided to demonstrate how code can be organized.

Specify dependencies

Dependencies can be specified in a package.json. If none of these files is created, then dependencies can be specified later in the configuration file. Example package.json file:
When deploying your app, the dependencies will be installed using the package manager of your choice, provided they adhere to the compatible version ranges listed below:
Example file directory:

Specify environment variables

Environment variables can optionally be specified in a file (e.g. .env). See the Environment Variables reference to configure additional variables for a deployment. Example .env file:
Example file directory:

Define graphs

Implement your graphs. Graphs can be defined in a single file or multiple files. Make note of the variable names of each compiled graph to be included in the application. The variable names will be used later when creating the configuration file. Here is an example agent.ts:
Example file directory:

Create the API config

Create a configuration file called langgraph.json. See the configuration file reference for detailed explanations of each key in the JSON object of the configuration file. Example langgraph.json file:
Note that the variable name of the CompiledGraph appears at the end of the value of each subkey in the top-level graphs key (i.e. :<variable_name>).
Configuration Location The configuration file must be placed in a directory that is at the same level or higher than the TypeScript files that contain compiled graphs and associated dependencies.

Next

After you setup your project and place it in a GitHub repository, it’s time to deploy your app.