Skip to main content
This quickstart shows you how to set up a LangGraph application locally for testing and development.

Prerequisites

Before you begin, ensure you have:
  • An API key for LangSmith (free to sign up).
  • uv for Python or npx for TypeScript.

1. Create a LangGraph app

Create a new app from the new-langgraph-project-python template or new-langgraph-project-js template. This template demonstrates a single-node application you can extend with your own logic.
uvx --from langgraph-cli@latest langgraph new path/to/your/app --template new-langgraph-project-python
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.

2. Install dependencies

cd path/to/your/app
uv sync --dev -U

3. Launch Agent Server

Start the Agent Server locally:
uv run langgraph dev
Sample output:
>    Ready!
>
>    - API: [http://localhost:2024](http://localhost:2024/)
>
>    - Docs: http://localhost:2024/docs
>
>    - Studio Web UI: https://smith.langchain.com/studio/?baseUrl=http://127.0.0.1:2024
The langgraph dev command starts Agent Server in an in-memory mode. This mode is suitable for development and testing purposes.
For production use, deploy Agent Server with a persistent storage backend. For more information, refer to the LangSmith platform options.To understand when to use langgraph dev vs langgraph up, see the Local development & testing guide.

4. Test the API

  1. Install the LangGraph Python SDK:
pip install langgraph-sdk
  1. Send a message to the assistant (threadless run):
from langgraph_sdk import get_client
import asyncio

client = get_client(url="http://localhost:2024")

async def main():
    async for chunk in client.runs.stream(
        None,  # Threadless run
        "agent", # Name of assistant. Defined in langgraph.json.
        input={
        "messages": [{
            "role": "human",
            "content": "What is LangGraph?",
            }],
        },
    ):
        print(f"Receiving new event of type: {chunk.event}...")
        print(chunk.data)
        print("\n\n")

asyncio.run(main())

Next steps

Now that you have a LangGraph app running locally, you’re ready to deploy it: Choose a hosting option for LangSmith:
  • Cloud: Fastest setup, fully managed (recommended).
  • Hybrid: in your cloud, managed by LangChain.
  • Self-hosted: Full control in your infrastructure.
For more details, refer to the Platform setup comparison. Then deploy your app: Explore features: