CLI for interacting with LangGraph API
Overall
score
74%
Evaluation — 74%
↑ 1.17xAgent success when using this tile
Project scaffolding system for LangGraph applications. Provides multiple pre-built templates covering common LangGraph patterns and use cases, enabling rapid project initialization with best practices.
Create new LangGraph projects from predefined templates with proper structure and configuration.
def create_new(path: Optional[str], template: Optional[str]) -> NonePurpose: Create a new LangGraph project from a template Parameters:
path (Optional[str]): Directory path for the new project (current directory if None)template (Optional[str]): Template identifier (interactive selection if None)
Returns: None (creates files and directories)
Raises: TemplateError for invalid templates, FileExistsError for existing directoriesUsage Examples:
from langgraph_cli.templates import create_new
# Interactive template selection in current directory
create_new(None, None)
# Create project with specific template
create_new("my-agent-app", "react-agent-python")
# Create in custom directory with interactive selection
create_new("./projects/new-bot", None)Template ID: new-langgraph-project
Description: Minimal chatbot with memory
Use Case: Basic conversational AI applications with persistent memory
Features:
Generated Structure:
my-project/
├── langgraph.json # LangGraph configuration
├── pyproject.toml # Python project configuration
├── .env.example # Environment variables template
├── src/
│ ├── __init__.py
│ ├── graph.py # Main conversation graph
│ └── nodes/ # Graph node implementations
│ ├── __init__.py
│ └── chat.py
├── tests/
│ ├── __init__.py
│ └── test_graph.py
└── README.mdTemplate ID: react-agent-python
Description: Extensible agent with tools
Use Case: Reasoning and acting agents that can use external tools
Features:
Generated Structure:
react-agent/
├── langgraph.json
├── pyproject.toml
├── .env.example
├── src/
│ ├── __init__.py
│ ├── agent.py # Main ReAct agent
│ ├── tools/ # Tool implementations
│ │ ├── __init__.py
│ │ ├── base.py # Base tool interface
│ │ ├── web_search.py # Web search tool
│ │ └── calculator.py # Math operations
│ └── prompts/
│ ├── __init__.py
│ └── react.py # ReAct prompting logic
├── tests/
│ ├── __init__.py
│ ├── test_agent.py
│ └── test_tools.py
└── README.mdTemplate ID: memory-agent-python
Description: ReAct agent with cross-conversation memory
Use Case: Agents that remember information across multiple conversations
Features:
Generated Structure:
memory-agent/
├── langgraph.json
├── pyproject.toml
├── .env.example
├── src/
│ ├── __init__.py
│ ├── agent.py # Memory-enabled ReAct agent
│ ├── memory/ # Memory management
│ │ ├── __init__.py
│ │ ├── store.py # Memory storage interface
│ │ └── retrieval.py # Memory retrieval logic
│ ├── tools/ # Agent tools
│ │ ├── __init__.py
│ │ └── base.py
│ └── prompts/
│ ├── __init__.py
│ └── memory.py # Memory-aware prompts
├── tests/
│ ├── __init__.py
│ ├── test_agent.py
│ └── test_memory.py
└── README.mdTemplate ID: retrieval-agent-python
Description: Agent with RAG (Retrieval-Augmented Generation) capabilities
Use Case: Agents that can search and reference external knowledge bases
Features:
Generated Structure:
retrieval-agent/
├── langgraph.json
├── pyproject.toml
├── .env.example
├── src/
│ ├── __init__.py
│ ├── agent.py # RAG-enabled agent
│ ├── retrieval/ # RAG implementation
│ │ ├── __init__.py
│ │ ├── embeddings.py # Embedding generation
│ │ ├── vectorstore.py # Vector storage
│ │ └── retriever.py # Search and retrieval
│ ├── ingestion/ # Document processing
│ │ ├── __init__.py
│ │ ├── loader.py # Document loaders
│ │ └── processor.py # Text processing
│ └── prompts/
│ ├── __init__.py
│ └── rag.py # RAG-specific prompts
├── data/ # Sample documents
│ └── sample.txt
├── tests/
│ ├── __init__.py
│ ├── test_agent.py
│ ├── test_retrieval.py
│ └── test_ingestion.py
└── README.mdTemplate ID: data-enrichment-python
Description: Web search and data organization agent
Use Case: Agents that gather, process, and organize information from web sources
Features:
Generated Structure:
data-enrichment/
├── langgraph.json
├── pyproject.toml
├── .env.example
├── src/
│ ├── __init__.py
│ ├── agent.py # Data enrichment agent
│ ├── search/ # Web search capabilities
│ │ ├── __init__.py
│ │ ├── web_search.py # Search implementation
│ │ └── extractors.py # Data extraction
│ ├── processing/ # Data processing
│ │ ├── __init__.py
│ │ ├── cleaner.py # Data cleaning
│ │ └── organizer.py # Information organization
│ ├── output/ # Output formatting
│ │ ├── __init__.py
│ │ └── formatters.py # Structured output
│ └── prompts/
│ ├── __init__.py
│ └── enrichment.py # Data enrichment prompts
├── tests/
│ ├── __init__.py
│ ├── test_agent.py
│ ├── test_search.py
│ └── test_processing.py
└── README.mdWhen no template is specified, the CLI provides an interactive selection interface:
$ langgraph new my-project
? Select a template:
❯ New LangGraph Project - Minimal chatbot with memory
ReAct Agent - Extensible agent with tools
Memory Agent - ReAct agent with cross-conversation memory
Retrieval Agent - Agent with RAG capabilities
Data-enrichment Agent - Web search and data organizationTemplates can be specified directly:
# Create ReAct agent
langgraph new react-bot --template react-agent-python
# Create retrieval agent in specific directory
langgraph new ./agents/rag-bot --template retrieval-agent-pythonThe template system uses several constants for management:
# Template definitions with URLs for Python and JavaScript versions
TEMPLATES: dict[str, dict[str, str]] = {
"New LangGraph Project": {
"description": "A simple, minimal chatbot with memory.",
"python": "https://github.com/langchain-ai/new-langgraph-project/archive/refs/heads/main.zip",
"js": "https://github.com/langchain-ai/new-langgraphjs-project/archive/refs/heads/main.zip",
},
"ReAct Agent": {
"description": "A simple agent that can be flexibly extended to many tools.",
"python": "https://github.com/langchain-ai/react-agent/archive/refs/heads/main.zip",
"js": "https://github.com/langchain-ai/react-agent-js/archive/refs/heads/main.zip",
},
# Additional templates...
}
# Template identifier mapping for CLI usage
TEMPLATE_ID_TO_CONFIG: dict[str, tuple[str, str, str]]
TEMPLATE_IDS: list[str]
# Help string for CLI template selection
TEMPLATE_HELP_STRING: strThe CLI provides detailed template information:
# Template help string with descriptions
TEMPLATE_HELP_STRING = """
Available templates:
new-langgraph-project Minimal chatbot with memory
react-agent-python Extensible agent with tools
memory-agent-python ReAct agent with cross-conversation memory
retrieval-agent-python Agent with RAG capabilities
data-enrichment-python Web search and data organization
Use 'langgraph new --template TEMPLATE_NAME' to create a project.
"""Each template includes:
Templates serve as starting points and can be customized:
Modify langgraph.json for:
Templates provide extensible architectures:
Each template includes deployment options:
Templates follow LangGraph best practices:
Install with Tessl CLI
npx tessl i tessl/pypi-langgraph-clievals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10