tags:
- langchain/langgraph
- ai/agents
- monorepo
- tutorial
title: How to create LangGraph agent from a template
permalink: langgraph-agent-from-template
date created: Thursday, May 1st 2025, 8:13:46 am
date modified: Friday, June 27th 2025, 6:08:18 ampip install "langgraph-cli[inmem]"
If working within a monorepo, navigate to the packages directory.
Create the Poetry package.
poetry new --src $"{APP_NAME}"
Create a react agent from the template in a temporary location, e.g., tmp.
langgraph new tmp --template react-agent-python
Copy all of the files into the APP_NAME directory, except pyproject.toml.
react_agentRename all references to react_agent, the default package name, to your desired package name.
For example:
src/react_agent directory to src/app_namereact_agent in langgraph.json to the app name. Add the package dependencies.
poetry add langgraph langchain-openai langchain-anthropic langchain langchain-fireworks python-dotenv langchain-community tavily-python
poetry add --group dev mypy ruff
Install the LangGraph CLI locally.
poetry add --group dev "langgraph-cli[inmem]"
Create the .env file.
cp .env.example .env
Add any keys to the .env file, e.g., OpenAI.
Run LangGraph Studio.
poetry run langgraph dev