R.5

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

VariableDefaultWhat it doesSection
LANGGRAPH_DEFAULT_RECURSION_LIMIT10007the recursion limit of a run with no recursion_limit in its config6.8
LANGGRAPH_DELTA_MAX_SUPERSTEPS_SINCE_SNAPSHOT5000the most steps that a DeltaChannel goes without a full snapshot5.5
LANGGRAPH_STRICT_MSGPACKfalse1, true, or yes blocks every msgpack type that is not on the allow list5.6, 8.4
LANGGRAPH_AES_KEYnonethe key of EncryptedSerializer, 16, 24, or 32 bytes. Without it and without a key argument, the class raises ValueErrorR.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

VariableDefaultWhat it doesSection
LC_OUTPUT_VERSIONnonethe default output_version of a chat model, v0 or v13.3
LANGSMITH_GATEWAYnonetrue, 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 it3.2
LANGSMITH_GATEWAY_API_KEYnonethe key for that gateway. Without it, the code reads LANGSMITH_API_KEY3.2

LangSmith tracing and tests

VariableDefaultWhat it doesRead atSection
LANGSMITH_TRACING_V2, LANGCHAIN_TRACING_V2nonetracing on, when the value is exactly true7.6
LANGSMITH_TRACING, LANGCHAIN_TRACINGnonethe same switch, read when neither TRACING_V2 variable is set7.6
LANGSMITH_API_KEYnonethe key of the LangSmith client7.6
LANGSMITH_ENDPOINTthe LangSmith cloud APIwhere the client sends runs. A server on your own network keeps the runs with you7.6
LANGSMITH_PROJECTdefaultthe 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 unset7.6, 7.7
LANGSMITH_TEST_SUITEthe repository name and the module of the testthe name of the dataset that the pytest plugin creates7.7
LANGSMITH_EXPERIMENTnonethe prefix of each experiment name of the pytest plugin, followed by a colon and 8 random hex characters7.7
LANGSMITH_TEST_TRACKINGnone, which keeps the record onfalse 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 true7.7
LANGSMITH_TEST_CACHEnonea folder where the test plugin caches its API calls7.7
LANGCHAIN_CALLBACKS_BACKGROUNDnonethe 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 workerdocs 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

VariableDefaultWhat it doesRead atSection
N_JOBS_PER_WORKER10 in the docs, 1 under langgraph devthe runs that one queue worker executes at the same timethe docs, and the default of langgraph dev8.1
LANGGRAPH_CLOUD_LICENSE_KEYnonethe license of a server from langgraph up for productioncapture T15-agent-server-x86/08-up-start-excerpt.txt8.1
LANGSMITH_API_KEYnonethe other way to start langgraph up, for local developmentcapture T15-agent-server-x86/10-up-license-excerpt.txt8.1
DISABLE_TRUSTSTOREnonetrue stops langgraph-api from putting truststore into the SSL layer, so the server checks certificates without the trust store of the operating system8.1
LANGGRAPH_HOST_API_KEYnonethe 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.

VariableWhat the kit does
every LANGSMITH_, LANGCHAIN_, LANGGRAPH_, OPENAI_, ANTHROPIC_, and LC_ variable, and OLLAMA_HOSTremoves it
LANGSMITH_TRACINGsets it to false
TZsets it to UTC
PYTHONHASHSEEDruns itself again with 0
LANGCHAIN101_PYTHONreads 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