Prerequisites
Before you begin, ensure you have 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
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 a persistent storage backend. For more information, refer to the LangSmith hosting options.
6. 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 features and deployment:- Studio is a specialized UI that you can connect to LangGraph API server to visualize, interact with, and debug your application locally. Try the Studio quickstart.
- Deploy on cloud with the quickstart guide.
- 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.