Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

To run a LangGraph application reliably in production, compile a graph with an explicit state schema, persist thread checkpoints in a durable database, use a separate store for long-term application memory, and deploy it with an API layer, task queue, and workers. LangGraph supplies the orchestration; your deployment supplies persistence, execution capacity, security, and operations.

What LangGraph does in a production application

LangGraph is a low-level orchestration framework for long-running, stateful agent workflows. A StateGraph defines nodes that read shared state, perform work, and return updates. Edges determine which node runs next, including conditional branches and loops. The graph must be compiled before you invoke it or stream its output.

The important production distinction is that LangGraph is the workflow runtime, not a complete hosting platform by itself. A production system also needs durable state, a way to queue and execute runs, an API for clients, observability, authentication, and a strategy for upgrades and failures. Agent Server combines those pieces around one or more compiled graphs.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The official reference describes LangGraph as providing infrastructure for “durable execution, streaming, human-in-the-loop, persistence, memory, and more.” Those capabilities become dependable only when the application supplies an appropriate state model and durable backing services.

Understand the execution model before deploying

State is the contract between nodes

Define a typed state schema before writing nodes. Each key should have a clear meaning, type, and ownership rule. A node should read the state it needs and return only the updates it is responsible for. Keeping updates narrow makes retries, replay, and debugging understandable.

from typing import Annotated, TypedDict
from langgraph.graph import StateGraph, START, END
from langgraph.graph.message import add_messages

class State(TypedDict):
    messages: Annotated[list, add_messages]
    approved: bool
    result: str

def classify(state: State):
    # deterministic validation belongs in an identifiable node
    return {"approved": bool(state["messages"])}

def finish(state: State):
    return {"result": "ready" if state["approved"] else "needs review"}

graph = StateGraph(State)
graph.add_node("classify", classify)
graph.add_node("finish", finish)
graph.add_edge(START, "classify")
graph.add_edge("classify", "finish")
graph.add_edge("finish", END)
compiled = graph.compile()

The example shows the shape rather than a complete agent. In a real application, model calls, tool calls, validation, approval pauses, and side effects should be separate nodes whenever their retry or audit behavior differs.

Reducers resolve concurrent updates

When multiple nodes can update the same key, define a reducer that explains how updates combine. Message histories commonly append rather than overwrite. Counters, sets, and structured records need their own merge policy. Without an explicit reducer, concurrent writes can overwrite one another or produce nondeterministic results.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Compile once unless configuration must vary per run

For a fixed graph, compile it once and export the compiled graph used by the deployment. The Agent Server documentation recommends this approach because compiling on every request adds avoidable overhead. Use a graph factory when a run genuinely needs a different model, tool set, or other graph-level configuration. Keep per-user data in state or runtime configuration instead of rebuilding an identical graph.

Checkpointers and stores solve different memory problems

A checkpointer records graph state at execution boundaries for a specific thread. It enables short-term conversational context, pause-and-resume behavior, recovery after interruption, and replay from a known point. A store is an application-wide memory service for data that must outlive one thread and be available to multiple threads, users, or runs.

Question Checkpointer Store
Primary purpose Thread-scoped checkpoints and recovery Long-term, cross-thread application memory
Typical data Current messages, pending node, intermediate state, run metadata User preferences, durable facts, shared knowledge, reusable records
Lifetime Usually tied to a conversation or execution thread Independent of any one thread
Failure it addresses Interrupted or retried graph execution Need to recall information in a later conversation
Production backing Persistent database, commonly PostgreSQL in Agent Server Persistent database, commonly PostgreSQL in Agent Server

Do not substitute a store for a checkpointer. A store can remember a customer’s preferred language, but it does not define the exact graph state needed to resume a paused tool call. Conversely, a checkpoint is not a good place for an unbounded customer profile shared across many threads.

Use durable persistence, not process memory

In-memory state disappears when a process restarts, a container is replaced, or traffic moves to another replica. Production deployments should use a persistent checkpointer. Agent Server uses PostgreSQL as the default durable backend for resources, checkpoints, and stores. Redis is used for ephemeral signaling, cancellation, and streaming pub/sub; run data is not persisted in Redis.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose checkpoint durability deliberately

Durability affects both recovery guarantees and write volume. The Agent Server documentation describes async durability as writing after each step and exit durability as storing only the final state. Use step-level writes when recovery from an interrupted long-running workflow matters. Final-state-only behavior may reduce writes for short, restartable work, but it cannot resume from intermediate nodes after a failure. Match the setting to the cost of repeating model calls and side effects.

Build a graph that is safe to retry

  1. Specify the state schema. List every key, its type, default behavior, and whether updates replace or merge existing data.
  2. Separate deterministic checks from side effects. Put validation, authorization, and normalization in explicit nodes. Put payments, emails, ticket creation, and other external effects in identifiable nodes with an idempotency strategy.
  3. Define control flow. Add normal edges, conditional branches, loop exit conditions, and human-approval pauses. Ensure every path has a bounded or observable termination condition.
  4. Add reducers for shared keys. Test concurrent updates and confirm that replay produces the expected merged value.
  5. Compile and invoke with a thread identity. A stable thread identifier lets the checkpointer associate successive requests with the same conversation or job.
  6. Exercise interruption and resume. Stop a run between nodes, restart the worker, and verify that the graph resumes from the latest durable checkpoint rather than starting over.

Retries are safest when nodes are deterministic or their side effects are idempotent. If a node charges a card or sends an email, persist an operation key and make repeated execution detect that the effect already happened. A checkpoint can restore control flow; it cannot undo an external action that was already performed.

How Agent Server deploys a graph

When you deploy Agent Server, you deploy one or more graphs, a persistence database, and a task queue. The system separates request handling from graph execution:

  • API servers authenticate requests, create runs, return status, and stream events to clients.
  • Queue workers take queued runs, execute graph nodes, and write checkpoints and run state.
  • PostgreSQL stores durable resources, checkpoints, and stores.
  • Redis carries ephemeral signals such as cancellation and streaming pub/sub.

At least one queue worker must continuously listen for work. If API servers accept runs but no worker is listening, runs remain orphaned in the queue. Scale API servers for concurrent connections and streaming clients; scale workers for graph execution time and throughput. These pools can be scaled independently.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Export the deployment graph

Expose the compiled graph in the format expected by your Agent Server configuration. Keep imports, model initialization, and tool registration reproducible in the deployment image. If model or tool selection changes per request, use a factory and validate the permitted choices instead of accepting arbitrary code or credentials from clients.

Configure the persistence services

Provision PostgreSQL with backups, access controls, encryption, and capacity sized for checkpoint frequency and state size. Keep Redis treated as disposable infrastructure: its loss should interrupt live streams or signals, not erase durable run history. Test database failover and worker restart before production traffic arrives.

Streaming results without losing progress

Use the runtime’s supported stream endpoint or SDK rather than inventing a second event protocol. A stream can contain node updates, model tokens, tool activity, status changes, and completion information. Design clients for partial progress: a connection may close after several events even though the run continues.

  1. Start a run and record its run and thread identifiers.
  2. Open the supported stream using those identifiers.
  3. Render incremental events without assuming the final event has arrived.
  4. Reconnect after a network failure and request the current run status or stream position supported by your runtime.
  5. Use the durable run result and checkpoint as the source of truth, not the client’s last rendered token.

Redis pub/sub helps deliver live events between API servers and clients, but it is not the durable event log. A reconnecting client must be able to discover whether the run is still queued, executing, interrupted, failed, or complete.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Deploy with the LangGraph CLI

The langgraph deploy CLI was announced on March 16, 2026. It builds a Docker image for a local LangGraph project and provisions the PostgreSQL and Redis support required by the deployment. The CLI also provides commands to list deployments, inspect logs, and delete deployments.

  1. Prepare the project. Pin dependencies, define the graph entry point, and make sure configuration comes from environment variables or the deployment’s secret mechanism.
  2. Build and provision. Run langgraph deploy from the project directory. The command packages the project into a Docker image and creates the supporting infrastructure.
  3. Check the deployment list. Use the CLI’s list command to confirm the deployment identifier and status.
  4. Inspect startup and worker logs. Use the log command to catch import errors, missing environment variables, failed migrations, or workers that are not listening.
  5. Run a thread-resume test. Start a graph, interrupt it, and verify that a later request with the same thread resumes from PostgreSQL.
  6. Remove unused environments. Use the delete command for temporary deployments so their infrastructure does not continue running.

Exact flags and authentication requirements can change with CLI releases, so treat the installed command’s help output as authoritative for your version. The durable design principles remain the same whether the image is built locally or in a CI pipeline.

Managed LangSmith Deployment or self-hosting?

LangSmith Deployment is the current name for LangGraph Platform as of October 2025. It is the managed service for running stateful, orchestrated agents at scale, while LangGraph remains the open-source framework used to build the workflows. Managed deployment supplies APIs for memory and conversation threads, human approval, typed streaming, versioning, rollbacks, and horizontal scaling.

Decision area Managed LangSmith Deployment Self-hosted Agent Server
Operational ownership Service provider operates the runtime and supporting services Your team operates API servers, workers, PostgreSQL, Redis, upgrades, and backups
Persistence Managed configuration for checkpoints and stores You choose, secure, size, and maintain the durable database
Scaling Built-in horizontal scaling controls Scale API and worker pools independently in your infrastructure
Streaming and approvals Managed APIs for typed streaming and human approval Expose and operate the runtime endpoints yourself
Versioning and rollback Managed version and rollback features Implement image, schema, migration, and rollback procedures
Observability and evaluation Integrated with the LangSmith ecosystem Assemble logs, traces, metrics, and evaluation tooling
Data residency and security Choose from the regions and controls the service offers Control network placement and policies, subject to your infrastructure
Cost predictability Service pricing and usage limits determine the bill Database, cache, compute, storage, operations, and engineering costs are yours

Choose managed deployment when reducing platform operations and obtaining built-in versioning, scaling, and observability outweighs service constraints. Choose self-hosting when regional placement, network isolation, custom infrastructure, or direct control of databases is more important than minimizing operational work. In either case, define backup retention, access controls, incident ownership, and a rollback test before launch.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Security, upgrades, and data governance

  • Give API servers permission to submit and read runs, but restrict database credentials and worker administration.
  • Keep model keys and tool credentials out of graph state and logs. Pass secrets through deployment configuration.
  • Validate thread and user identifiers at the API boundary so one user cannot read another user’s checkpoints or store entries.
  • Set limits on state size, message history, tool duration, recursion, and concurrent runs.
  • Version graph code and state schemas together. A new node expecting a field that old checkpoints lack needs a migration or compatibility path.
  • Test rollback against real persisted checkpoints; rolling code back without considering schema changes can make recovery impossible.
  • Define retention and deletion rules for checkpoints, stores, prompts, tool inputs, and streamed output.

Troubleshooting production failures

Runs stay queued

Confirm that at least one queue worker is listening, that it can reach Redis and PostgreSQL, and that the worker image contains the graph entry point. API health alone does not prove that execution capacity exists.

A restart loses the conversation

Check that the run uses a persistent checkpointer and a stable thread identifier. Process-local memory or a new thread ID creates the appearance of lost state.

Streams stop while the run continues

Treat the stream as a live view, not the durable record. Reconnect, query run status, and render the persisted result when execution completes. Inspect Redis connectivity for pub/sub failures without assuming that PostgreSQL data was lost.

Retries duplicate an external action

Move the effect into a named node, add an idempotency key, and record completion before allowing a retry to repeat the operation. Checkpoint recovery does not automatically make side effects safe.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Deployments fail after a graph change

Inspect logs for import errors, missing dependencies, invalid state updates, and incompatible checkpoint schemas. Deploy a migration or compatibility layer before routing old threads to the new graph.

Production readiness checklist

  • Typed state schema with reducers for every shared key
  • Compiled graph exported once, unless a factory is required for per-run configuration
  • Persistent checkpointer and a separate store for cross-thread memory
  • PostgreSQL backups, access controls, capacity planning, and restore tests
  • Redis treated as ephemeral signaling infrastructure
  • API servers and queue workers monitored and scaled independently
  • At least one continuously listening queue worker
  • Reconnect-aware streaming client and durable run-status handling
  • Idempotent or deduplicated external side effects
  • Human-approval and interruption paths tested end to end
  • Versioned graph code, state migrations, rollback tests, and log retention rules
  • Documented data residency, authentication, deletion, and incident procedures

The practical boundary between LangGraph and deployment

LangGraph defines how an agent workflow progresses through stateful nodes. Production deployment determines whether that workflow survives restarts, scales beyond one process, streams safely to clients, and can be operated during failures. Use checkpoints for recoverable thread execution, stores for durable application memory, PostgreSQL for durable data, Redis for ephemeral coordination, and a queue-worker architecture for reliable execution. Then choose managed LangSmith Deployment or self-hosted Agent Server according to the control, residency, and operational burden your application can support.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.