Application Structure
Status: ACTIVE (pulled from docs.langchain.com) Source: https://docs.langchain.com/oss/python/langgraph/application-structure Timestamp: 2026-05-11
A LangGraph app consists of: one or more graphs, a langgraph.json config file, a dependencies file, and an optional .env.
File Structure
my-app/
├── my_agent/
│ ├── utils/
│ │ ├── tools.py # Tool definitions
│ │ ├── nodes.py # Node functions
│ │ └── state.py # State definition
│ ├── __init__.py
│ └── agent.py # Graph construction
├── .env # Environment variables
├── requirements.txt # Package dependencies
└── langgraph.json # Configuration file
langgraph.json
{
"dependencies": ["langchain_openai", "./your_package"],
"graphs": {
"my_agent": "./your_package/your_file.py:agent"
},
"env": "./.env"
}
| Key | Purpose |
|---|---|
dependencies |
Python packages + local packages (. or ./path) |
graphs |
Named graphs with path/to/file.py:variable format |
env |
Path to environment file |
dockerfile_lines |
Additional system binaries or libraries |
Dependencies
- A dependency file (
requirements.txt,pyproject.toml, orpackage.json) - A
dependencieskey inlanggraph.json - Any system-level needs via
dockerfile_lines
Graphs
Each graph is identified by a unique name pointing to either:
- A compiled graph variable: "./agent.py:agent"
- A function that returns a graph: "./agent.py:make_graph"
Environment Variables
For local dev, use the env key in langgraph.json. For production, configure in the deployment environment.