Environment variables
This page lists the 23 environment variables that the stack or its docs name at the pin, with the file and line that reads each one.
Set each variable before the process starts. LANGGRAPH_DEFAULT_RECURSION_LIMIT, the delta setting, and LANGGRAPH_STRICT_MSGPACK are read when their module is imported. The LangSmith SDK caches each value after its first read. It reads each name with the prefix LANGSMITH_ first and then LANGCHAIN_. The tracing switch is the exception: a TRACING_V2 variable of either prefix wins over LANGSMITH_TRACING. A row that only the documentation backs says so.
LangGraph
| Variable | Default | What it does | Section |
|---|---|---|---|
LANGGRAPH_DEFAULT_RECURSION_LIMIT | 10007 | the recursion limit of a run with no recursion_limit in its config | 6.8 |
LANGGRAPH_DELTA_MAX_SUPERSTEPS_SINCE_SNAPSHOT | 5000 | the most steps that a DeltaChannel goes without a full snapshot | 5.5 |
LANGGRAPH_STRICT_MSGPACK | false | 1, true, or yes blocks every msgpack type that is not on the allow list | 5.6, 8.4 |
LANGGRAPH_AES_KEY | none | the key of EncryptedSerializer, 16, 24, or 32 bytes. Without it and without a key argument, the class raises ValueError | R.4 |
The recursion limit of a create_agent graph is 9999, which its own config sets, so the variable does not change it. Section 6.8 measured the variable: at 25, a plain loop stopped at 25. That it leaves an agent at 9999 comes from the code, not a run.
LangChain
| Variable | Default | What it does | Section |
|---|---|---|---|
LC_OUTPUT_VERSION | none | the default output_version of a chat model, v0 or v1 | 3.3 |
LANGSMITH_GATEWAY | none | true, or a URL, routes provider integrations such as ChatOpenAI and ChatAnthropic through the LangSmith model gateway. The langsmith provider of init_chat_model uses the gateway without it | 3.2 |
LANGSMITH_GATEWAY_API_KEY | none | the key for that gateway. Without it, the code reads LANGSMITH_API_KEY | 3.2 |
LangSmith tracing and tests
| Variable | Default | What it does | Read at | Section |
|---|---|---|---|---|
LANGSMITH_TRACING_V2, LANGCHAIN_TRACING_V2 | none | tracing on, when the value is exactly true | 7.6 | |
LANGSMITH_TRACING, LANGCHAIN_TRACING | none | the same switch, read when neither TRACING_V2 variable is set | 7.6 | |
LANGSMITH_API_KEY | none | the key of the LangSmith client | 7.6 | |
LANGSMITH_ENDPOINT | the LangSmith cloud API | where the client sends runs. A server on your own network keeps the runs with you | 7.6 | |
LANGSMITH_PROJECT | default | the project of traced runs. The server creates it on the first run. The pytest plugin uses it as the experiment prefix only when LANGSMITH_EXPERIMENT is unset | 7.6, 7.7 | |
LANGSMITH_TEST_SUITE | the repository name and the module of the test | the name of the dataset that the pytest plugin creates | 7.7 | |
LANGSMITH_EXPERIMENT | none | the prefix of each experiment name of the pytest plugin, followed by a colon and 8 random hex characters | 7.7 | |
LANGSMITH_TEST_TRACKING | none, which keeps the record on | false runs tests marked for LangSmith without a record. It does not turn off LANGSMITH_TRACING, which still sends the runs inside a test. With the record on, each log_* call raises unless LANGSMITH_TRACING is true | 7.7 | |
LANGSMITH_TEST_CACHE | none | a folder where the test plugin caches its API calls | 7.7 | |
LANGCHAIN_CALLBACKS_BACKGROUND | none | the docs say that false makes callbacks wait. We found no read of it in langchain-core 1.8.0 or langsmith 0.14.17. langgraph-cli lists it as a reserved name for its deploy command, and langgraph-api sets it to true for its JS worker | docs only, and (line 76 in the repo tree, line 71 in the 0.4.43 wheel) | 7.6 |
Tracing has three switches that win over these variables. A tracing_context, then an active run tree, then a global setting come first. Section 7.6 lists the order.
Agent Server and its CLI
| Variable | Default | What it does | Read at | Section |
|---|---|---|---|---|
N_JOBS_PER_WORKER | 10 in the docs, 1 under langgraph dev | the runs that one queue worker executes at the same time | the docs, and the default of langgraph dev | 8.1 |
LANGGRAPH_CLOUD_LICENSE_KEY | none | the license of a server from langgraph up for production | capture T15-agent-server-x86/08-up-start-excerpt.txt | 8.1 |
LANGSMITH_API_KEY | none | the other way to start langgraph up, for local development | capture T15-agent-server-x86/10-up-license-excerpt.txt | 8.1 |
DISABLE_TRUSTSTORE | none | true stops langgraph-api from putting truststore into the SSL layer, so the server checks certificates without the trust store of the operating system | 8.1 | |
LANGGRAPH_HOST_API_KEY | none | the key of langgraph deploy, read before LANGSMITH_API_KEY and LANGCHAIN_API_KEY | (lines 96 to 100 in the repo tree, 91 to 95 in the 0.4.43 wheel) | 8.1 |
The docs give the server a recursion limit of 10011, and langgraph-api 0.18.0 sets that value. Our run under langgraph dev still stopped at 10007, as section 8.1 shows. The register records the numbers as D105.
The capture kit
capture/run.py sets a fixed environment before any scenario runs.
| Variable | What the kit does |
|---|---|
every LANGSMITH_, LANGCHAIN_, LANGGRAPH_, OPENAI_, ANTHROPIC_, and LC_ variable, and OLLAMA_HOST | removes it |
LANGSMITH_TRACING | sets it to false |
TZ | sets it to UTC |
PYTHONHASHSEED | runs itself again with 0 |
LANGCHAIN101_PYTHON | reads it as the interpreter with the pinned packages |
The kit removes the LANGGRAPH_ variables because a recursion limit in the shell would change the captures.
LangChain (Python): langchain, langchain-core, langgraph, deepagents, langsmith 1.5.0 · c2f4036 · 2026-11-11 · Edition 2026.11