Prerequisites
Before you begin, ensure you have the following:- An API key for LangSmith - free to sign up
1. Install the LangGraph CLI
- Python server
- Node server
2. Create a LangGraph app 🌱
Create a new app from thenew-langgraph-project-python
template or new-langgraph-project-js
template. This template demonstrates a single-node application you can extend with your own logic.
- Python server
- Node server
Additional templates
If you use
langgraph new
without specifying a template, you will be presented with an interactive menu that will allow you to choose from a list of available templates.3. Install dependencies
In the root of your new LangGraph app, install the dependencies inedit
mode so your local changes are used by the server:
- Python server
- Node server
4. Create a .env
file
You will find a .env.example
in the root of your new LangGraph app. Create a .env
file in the root of your new LangGraph app and copy the contents of the .env.example
file into it, filling in the necessary API keys:
5. Launch LangGraph Server 🚀
Start the LangGraph API server locally:- Python server
- Node server
langgraph dev
command starts LangGraph Server in an in-memory mode. This mode is suitable for development and testing purposes. For production use, deploy LangGraph Server with access to a persistent storage backend. For more information, see Deployment options.
6. Test your application in LangGraph Studio
LangGraph Studio is a specialized UI that you can connect to LangGraph API server to visualize, interact with, and debug your application locally. Test your graph in LangGraph Studio by visiting the URL provided in the output of thelanggraph dev
command:
Safari compatibility
Safari compatibility
Use the
--tunnel
flag with your command to create a secure tunnel, as Safari has limitations when connecting to localhost servers:7. Test the API
- Python SDK (async)
- Python SDK (sync)
- Javascript SDK
- Rest API
- Install the LangGraph Python SDK:
- Send a message to the assistant (threadless run):
Next steps
Now that you have a LangGraph app running locally, take your journey further by exploring deployment and advanced features:- Deployment quickstart: Deploy your LangGraph app using LangGraph Platform.
- LangGraph Platform overview: Learn about foundational LangGraph Platform concepts.
- LangGraph Server API Reference: Explore the LangGraph Server API documentation.
- Python SDK Reference: Explore the Python SDK API Reference.
- JS/TS SDK Reference: Explore the JS/TS SDK API Reference.