| [ Web Proxy ] |
| Viewing: https://reference.langchain.com/python/deepagents-code/server_graph | [Back] [Original] |
Server-side graph entry point for langgraph dev.
This module is referenced by the generated langgraph.json and exposes a graph
factory that the LangGraph server can load and serve.
The graph is created by make_graph(), which reads configuration from
ServerConfig.from_env() the same dataclass the CLI uses to write the
configuration via ServerConfig.to_env(). This shared schema ensures the two
sides stay in sync.
Report a server graph startup failure to the parent app process.
Emits two stderr outputs: the full traceback for logs/debugging, then a
single-line {STARTUP_ERROR_MARKER}{type}: {summary} line that
server._extract_startup_error_marker parses to upgrade an opaque
"Server process exited with code N" into an actionable summary.
Read the server project context from environment transport data.
Return resources shared by the graph and dcode operation routes.
Builds once and caches. A construction failure is converted into a
startup-error marker (scraped by the parent app process) before
sys.exit(1), which is right for the langgraph.json graph factory at
startup. Callers in request scope must contain that exit -- SystemExit is a
BaseException -- as offload_api._execute_offload does, mapping it to a 503
rather than killing the server mid-request.
Return the cached interactive graph for langgraph.json.
Full configuration payload passed from the app to the server subprocess.
Serialized to/from DEEPAGENTS_CODE_SERVER_* environment variables so
that the server graph (which runs in a separate Python interpreter)
can reconstruct the app's intent without sharing memory.
Explicit user/project path context for project-sensitive behavior.
The one-per-process result of building this server's agent.
A named tuple rather than a bare tuple so the three slots are addressed by
name: agent is structurally opaque to the type checker (the SDK exposes no
usable compiled-graph type here), so a positional transposition would hand
LangGraph the backend as its compiled graph with no complaint.
| Web Proxy Viewer | New URL | Original Page |