Slides · LangChain ecosystem

LangSmith Deployment: running agents in production

LangSmith Deployment: running agents in production

What an agent server adds to a graph, where it can run, how it treats a second message, how to lock it down and how to ship a change without stranding paused runs.

By the end you can define the server’s objects, choose a hosting model, pick a double-texting strategy, design access control and budgets, and plan a safe release.

Concept

Names change, so check the date

  • This deck reflects the official docs as read on 24 October 2026. Product names, plan tiers and limits move often; confirm them before quoting in an interview or a contract.
  • At that date the docs call the hosted-and-self-hostable product LangSmith Deployment, and its runtime the Agent Server. The Deployment page describes it as a workflow orchestration runtime built for agent workloads.
  • The Deployment page says every hosting option uses the same Agent Server runtime.
  • The page text read for this deck does not use the older name “LangGraph Platform”. Older articles and videos may.
  • Principles in this lesson outlast the names: durable state, queues, access control, budgets, safe releases.

Sources1 LangSmith Deployment (LangSmith documentation)2 Agent Server (LangSmith documentation)

Compare

What a plain endpoint leaves to you

Agent needWrapping graph.invoke in a handlerAgent Server
Wait hours for a person, then continueYou build storage and a resume pathCheckpoints and threads (docs)
Survive a process restartIn-flight work is lost unless you saved itState kept in PostgreSQL (docs)
Many runs at onceYou build a queue and workersA task queue with workers (docs)
Live partial outputYou build streamingServer-sent events (docs)
A run that outlasts a request timeoutCourse reasoning: the connection drops firstBackground runs return at once

The Agent Server page describes persistence and a task queue as built in. It does not make the agent safe, cheap or correct; that stays with you.

Source2 Agent Server (LangSmith documentation)

Diagram

Inside the Agent Server

Diagram: Requests pass the auth handlers, and the API hands runs to workers through a queue.

Client

Auth handlers

Agent Server API

Queue: Redis signals

Workers run the graph

PostgreSQL

Diagram summary: Requests pass the auth handlers, and the API hands runs to workers through a queue. Redis carries only ephemeral signals, while run data, checkpoints and the store live in PostgreSQL by default.

Source2 Agent Server (LangSmith documentation)

Compare

Five words to define on a whiteboard

ObjectWhat it isTypical mapping
AssistantA graph plus its configurationOne per tenant or persona
ThreadA container for one conversation’s stateOne per conversation
RunOne execution of a graphOne per user message
StoreLong-term memory across threads (PostgreSQL by default, replaceable)A user’s saved preferences
CheckpointA snapshot of graph state written during executionLets an interrupted run resume

The page also lists cron jobs (scheduled runs) and the task queue (pending runs that workers pick up and cancel on signal). The “typical mapping” column is this course’s suggestion. The persistence page describes checkpoints as a thread’s graph state.

Sources2 Agent Server (LangSmith documentation)3 Persistence (LangGraph documentation)

Diagram

How the objects relate

Diagram: One graph backs assistants, a conversation is a thread, and each execution is a run that writes checkpoints.

Graph: your code

Assistant: graph+config

Thread: one conversation

Run: one execution

Checkpoints written

Diagram summary: One graph backs assistants, a conversation is a thread, and each execution is a run that writes checkpoints. The store sits beside this chain and shares memory across threads.

Source2 Agent Server (LangSmith documentation)

Concept

What lives where

  • PostgreSQL is the default for assistants, threads, runs, cron jobs, checkpoints and the store. The page says checkpoints can go to MongoDB or a custom backend, and the store can be replaced.
  • Redis handles signalling, cancellation and streaming between API servers and workers. The page says it stores only ephemeral data, and that run data is always read from and written to PostgreSQL.
  • Durability modes on the page: async (the default) writes a checkpoint after each step; exit stores only the final state. The trade-off: less writing, but an interrupted run has less to resume from.
  • Concurrency: the queue allows at most one run per thread at a time, and each worker runs up to N_JOBS_PER_WORKER runs (default 10).

Source2 Agent Server (LangSmith documentation)

Code

A deployable project is small

JSON

{
  "dependencies": ["."],
  "graphs": { "support": "./src/graph.py:graph" },
  "auth": { "path": "./src/auth.py:auth" }
}

The CLI reference marks graphs as required and dependencies as required for Python unless source is set. env, auth, checkpointer, store, http and api_version are optional; the checkpointer key’s backend defaults to "default" (PostgreSQL).

Each key under graphs is a graph id that clients pass as the assistant id. The reference says a graph path may point to a compiled graph or a factory function. langgraph dev runs a local server with hot reload and needs no Docker.

Tested 24 October 2026 with langgraph-cli 0.4.38 and langgraph-api 0.16.6: this file started a local dev server with the auth handler loaded.

Sources4 LangGraph CLI (LangSmith documentation)5 Application structure (LangSmith documentation)

Code

A background run, step by step

Python

client = get_client(url=URL)
thread = await client.threads.create()
run = await client.runs.create(thread["thread_id"], "support", input=inp)
print((await client.runs.get(thread["thread_id"], run["run_id"]))["status"])
await client.runs.join(thread["thread_id"], run["run_id"])
print((await client.runs.get(thread["thread_id"], run["run_id"]))["status"])
state = await client.threads.get_state(thread["thread_id"])
StepObserved (local dev server, 3-second graph)
runs.create returnsstatus pending, before the work finishes
runs.get right afterpending
after runs.joinsuccess
threads.get_statethe graph’s final messages

This is the shape for work that outlasts an HTTP request. The local dev server is a single-process runtime with local file persistence (the CLI reference says state is persisted to a local directory), so it shows the API, not production durability.

Source6 How to kick off background runs (LangSmith documentation)

Check yourself

Check: which server object?

A retailer’s support graph has three requirements: (a) remember a customer’s preferred language the next time they chat; (b) if a worker dies mid-run, continue from where it stopped; (c) produce a summary report every night at 2 a.m. Name the server object for each. Then, with 6 workers at default settings, how many runs can the fleet execute at once?

Answer

(a) The store, because it holds memory across threads. (b) Checkpoints, written during a run so it can resume. (c) A cron job, which is the server’s scheduled run. Capacity: 6 workers times 10 runs each is 60 concurrent runs, if the default N_JOBS_PER_WORKER of 10 is unchanged and the one-run-per-thread rule is not the limit.

Compare

Four hosting types and a fifth path

OptionWho runs whatPlan the page states
CloudLangChain runs the control plane, data plane and databases, on AWS and GCPPlus or above
HybridLangChain runs the control plane; you run the servers and data plane. Traces go to LangSmith Cloud or self-hosted LangSmithNot stated on the page
Self-hosted with control planeYou run everything in your Kubernetes cluster next to self-hosted LangSmithEnterprise, with Deployment enabled
Standalone serverYou run the server with Docker, Compose or Kubernetes and supply PostgreSQL, Redis and a licence; no control planeNot stated on the page
Build your ownYou assemble a web framework, a job queue and a checkpointerNot a product

Plan names and prices change; the table is as of 24 October 2026. Only self-hosted LangSmith keeps traces inside your network; hybrid with LangSmith Cloud sends them out. The intro of the page also mentions BYOC without defining it, so this deck does not cover it. The fifth row is course framing, not a docs option.

Source1 LangSmith Deployment (LangSmith documentation)

Diagram

A first-pass filter, not a rule

Diagram: If data may leave your network, cloud is the fastest route; if not, the console you want (none, vendor-run or self-run) points to...

no

yes

no

vendor-run

self-run

Data stays in network?

Cloud

Want a console?

Standalone server

Hybrid

Self-hosted (full)

Diagram summary: If data may leave your network, cloud is the fastest route; if not, the console you want (none, vendor-run or self-run) points to standalone, hybrid or self-hosted. Real choices also weigh cost, team size and procurement.

Concept

What each choice costs

  • Cloud: least work to run, but the vendor operates the data plane and databases, and a paid plan is needed.
  • Hybrid: data stays with you, but you run and scale the servers.
  • Self-hosted with control plane: most control and most to operate, on Kubernetes.
  • Standalone: smallest footprint, but you bring PostgreSQL, Redis and a licence and give up the control plane.
  • Build your own: you re-implement streaming, resume, queues, scheduling and concurrency rules (course reasoning: each is a piece the server supplies).
  • Lock-in framing (course advice): the graph code is open source and portable; the server is the piece your team comes to rely on, so it is where switching costs sit. The Deployment page says the product is framework-agnostic, so agents from other frameworks can be hosted.

Source1 LangSmith Deployment (LangSmith documentation)

Check yourself

Check: match two teams to an option

Team A must run the whole stack, including the management layer, inside its own Kubernetes cluster, beside a self-hosted LangSmith. Team B has two engineers, a single Docker host and no wish for a console, and will bring its own PostgreSQL and Redis. Which option for each, what does the page say Team A needs, and what does Team B take on?

Answer

Team A: self-hosted with control plane; the Deployment page says it requires the Enterprise plan with LangSmith Deployment enabled. Team B: a standalone server; it supplies PostgreSQL, Redis and a licence, has no control plane, and must operate, back up and upgrade everything itself. The cost to weigh is staff time against the vendor’s price.

Concept

A second message arrives mid-run

  • Users send a correction before the first answer finishes. The queue allows one run per thread at a time, so the server needs a rule for the second one.
  • The docs call this double texting and name four strategies. Enqueue is the default.
  • The page states double texting is a feature of LangSmith Deployment, not of the open-source library. Course reasoning: a bare graph behind your own web server has no such rule, so you would have to write one.
  • Choosing is a product decision. The default is a decision somebody else made.

Sources7 Double texting (LangSmith documentation)2 Agent Server (LangSmith documentation)

Compare

The four strategies and their costs

StrategyWhat the docs say happensWhat it costs
Enqueue (default)The current run finishes before the new input is processedThe user waits, and a stale first answer still appears
RejectAdditional runs are refused while one is in progressThe new message is turned away
InterruptThe current run halts with progress preserved; the new input is added and execution continues from that stateThe graph must handle half-finished work such as a partial tool call
RollbackThe run halts and all progress, including its input, is reverted; the new input starts a fresh runThe earlier work is discarded

Sources7 Double texting (LangSmith documentation)8 Reject Concurrent (LangSmith documentation)9 Interrupt concurrent (LangSmith documentation)10 Rollback Concurrent (LangSmith documentation)

Worked example

Observed: one thread, two messages

A 3-second graph echoes its last message. The first message “first” is sent, then “second” one second later with each multitask_strategy. Local dev server, 24 October 2026. Each result was observed and matches the how-to guides: reject returns HTTP 409 Conflict and the first run continues; interrupt keeps the first run with status interrupted and its partial data in the thread; rollback deletes the first run, which cannot be restarted.

StrategySecond requestFirst runMessages in the thread
enqueueacceptedsuccessfirst, echo: first, second, echo: second
rejectrefused with HTTP 409successfirst, echo: first
interruptacceptedinterruptedfirst, second, echo: second
rollbackacceptedrecord gone (lookup returned not found)second, echo: second

Read the last two rows carefully. Interrupt keeps the first input but no answer to it; rollback removes the first input as well. Neither undoes anything outside the graph, such as an email already sent (course reasoning).

Sources8 Reject Concurrent (LangSmith documentation)9 Interrupt concurrent (LangSmith documentation)10 Rollback Concurrent (LangSmith documentation)

Diagram

Choosing by what a half-done run costs

Diagram: A stale first run that has changed nothing outside the graph suits interrupt or rollback; one that already has suits enqueue or reject.

no, old run is stale

yes, effect exists

Second message mid-run

Acted outside graph?

Interrupt or rollback

Enqueue or reject

Diagram summary: A stale first run that has changed nothing outside the graph suits interrupt or rollback; one that already has suits enqueue or reject. It is a rule of thumb, and the graph must still be safe to resume.

Check yourself

Check: three products, three strategies

(a) A live-caption tool where only the newest sentence matters. (b) A triage queue where every incoming message is a separate customer complaint that must all be handled. (c) A bulk spreadsheet import that users sometimes trigger twice by double-clicking. Pick a strategy for each and state its cost.

Answer

(a) Interrupt or rollback: older input is worthless; the cost is discarded or half-finished work. (b) Enqueue: nothing may be dropped; the cost is waiting. (c) Reject: the second trigger would duplicate or collide with a job already running; the cost is that a deliberate second request is turned away. Other answers can be defended if the cost is stated.

Concept

Authentication, then authorization

  • Authentication runs on every request through the @auth.authenticate handler. It validates credentials and returns the caller’s identity, with extra fields such as role or organisation optional.
  • Defaults differ. Per the auth page, the hosted product uses LangSmith API keys in the x-api-key header unless you replace them. A self-hosted server has no default authentication: you implement the whole model.
  • Authorization runs through @auth.on handlers at three levels: global, resource and action. The most specific match wins.
  • A handler can add metadata to a resource at creation, return a filter to restrict reads and searches, or raise an error to deny.

Source11 Authentication and access control (LangSmith documentation)

Diagram

Thread ownership by metadata

Diagram: Each request is authenticated, then a handler filters threads by the owner value written into their metadata at creation.

yes

no

Request with credentials

Authenticate: who?

Authorize: may they?

owner equals caller?

Read or resume thread

Not visible or denied

Diagram summary: Each request is authenticated, then a handler filters threads by the owner value written into their metadata at creation. Runs inherit the thread’s access control; the store is scoped by rewriting its namespace.

Source11 Authentication and access control (LangSmith documentation)

Code

A tested handler pair

Python

USERS = {"tok-alice": "alice", "tok-bob": "bob"}   # stand-in for a real identity check

@auth.authenticate
async def authenticate(headers: dict):
    tok = headers.get(b"x-token", b"").decode()
    if tok not in USERS:
        raise Auth.exceptions.HTTPException(status_code=401, detail="Invalid token")
    return {"identity": USERS[tok], "is_authenticated": True}

@auth.on
async def owner_only(ctx: Auth.types.AuthContext, value: dict):
    value.setdefault("metadata", {})["owner"] = ctx.user.identity
    return {"owner": ctx.user.identity}
Case (local dev server, 24 October 2026)Observed
No token, or an unknown tokenHTTP 401
Alice creates a thread and runs itworks; metadata shows owner: alice
Bob reads, gets state of, or starts a run on Alice’s threadHTTP 404
Bob searches threads0 results, while Alice sees her own
Same server with the @auth.on handler removedBob read Alice’s messages, and Alice’s threads appeared in his search

The last row is the insecure direct object reference: authentication alone does not stop it. The 404 is what this version returned; the auth page names only 401 and 403.

Source11 Authentication and access control (LangSmith documentation)

Compare

Four controls and what happens without each

ControlWhat goes wrong without it
User id read from the authenticated run configuration (config["configuration"]["langgraph_auth_user"], per the auth page)A model-supplied id can name any customer
A cap on calls, tokens, time and money per run, plus an explicit recursion limit (course advice)One looping run spends like a normal day
A degraded mode that turns write tools off, plus a runbook for stopping runs (course advice)Nothing limits damage while you investigate
Tools that tolerate being called twice (the interrupts docs advise idempotent side effects before an interrupt)A resume or retry repeats a payment or a message

The Agent Server page says workers cancel a run when signalled, so cancellation is a platform capability. The degraded mode, per-run spend caps and repeat-safe tools are yours to build.

Sources11 Authentication and access control (LangSmith documentation)12 Interrupts (LangGraph documentation)

Math

Worst-case cost of one run

max cost per run=calls×(in_tokens×price_in+out_tokens×price_out)\text{max cost per run} = \text{calls} \times (\text{in\_tokens} \times \text{price\_in} + \text{out\_tokens} \times \text{price\_out})fleet worst case=max cost per run×runs per day\text{fleet worst case} = \text{max cost per run} \times \text{runs per day}
SymbolMeaning
calls\text{calls}The model-call limit you enforce per run
in_tokens\text{in\_tokens}, out_tokens\text{out\_tokens}Average tokens in and out per call
price_in\text{price\_in}, price_out\text{price\_out}Price per token (illustrative below)

Illustrative: 15 calls, 3,000 tokens in and 500 out per call, at 2 dollars per million input tokens and 8 dollars per million output tokens. Input: 15×3,000×$2/1,000,000=$0.0915 \times 3{,}000 \times \$2 / 1{,}000{,}000 = \$0.09. Output: 15×500×$8/1,000,000=$0.0615 \times 500 \times \$8 / 1{,}000{,}000 = \$0.06. Total 0.15 dollars per run. At 50,000 runs a day the ceiling is 7,500 dollars, which is a number to set an alert against.

Check yourself

Check: size a cap and find the leak

A team caps runs at 12 model calls, averaging 2,000 tokens in and 400 out per call, at an illustrative 3 dollars per million input and 12 dollars per million output. What is the per-run ceiling, and what is it across 20,000 runs a day? Separately, their agent keeps long-term preferences in the store under one shared namespace. How do they stop one customer reading another’s, and how does that differ from isolating threads?

Answer

Input: 12×2,000×$3/1,000,000=$0.07212 \times 2{,}000 \times \$3 / 1{,}000{,}000 = \$0.072. Output: 12×400×$12/1,000,000=$0.057612 \times 400 \times \$12 / 1{,}000{,}000 = \$0.0576. Total 0.1296 dollars per run; times 20,000 is 2,592 dollars a day. On the store: the auth page says store handlers do not return metadata filters; they rewrite the namespace field so each user’s data sits under their own prefix. Threads, by contrast, are protected by writing an owner into metadata and filtering on it.

Process

A deploy while runs wait for approval

If 2,000 runs wait for a person and you ship a new graph, what must be true?

  1. State is in a durable store, not the process. The persistence docs say in-memory checkpoints are lost on restart.
  2. Old saved state must still fit the new code. Do not rename or remove keys that live runs hold, and tolerate missing ones.
  3. Interrupt order and node names are stable. The interrupts docs say a node re-runs from its start on resume and that resume values pair by position.
  4. Side effects are idempotent, because a node can run again.
  5. In-flight runs drain, or the rollout behaviour is understood and tested (course advice; check the platform’s rollout documentation).

Sources12 Interrupts (LangGraph documentation)3 Persistence (LangGraph documentation)

Worked example

Observed: a release swaps two questions

A node asks “Approve refund?” then “Reason?”. A run pauses at the first question. A new release swaps the two calls in the same node, and a person answers yes.

Python

# v1: approved = interrupt("Approve refund?"); reason = interrupt("Reason?")
# v2: reason = interrupt("Reason?"); approved = interrupt("Approve refund?")
Step (in-memory saver, langgraph 1.2.17)Result
Paused under v1waiting at “Approve refund?”
Resumed under v2 with yesthe first interrupt now means “Reason?”, so yes lands there
Second answer, “duplicate order”lands in approved
Final stateapproved: duplicate order, reason: yes

Nothing failed loudly. A wrong value in an approval field is truthy, which is how a swap becomes a wrong action. Keep order stable, or version the node and drain old runs.

Source12 Interrupts (LangGraph documentation)

Check yourself

Check: a renamed state key

A release renames the state key ticket_id to id, and the node now reads state["id"]. 800 runs are paused. What happens when they resume, and how do you ship safely?

Answer

In a test with an in-memory saver, a run paused under the old graph and resumed under the new one raised KeyError: 'id', because the saved state still holds ticket_id. A tolerant read (id first, then ticket_id) worked only while the new state schema still declared ticket_id: with a schema declaring only id, the old value never reached the node (the read returned nothing). So the required condition is to keep both keys in the schema. Safe path: declare both for a release or two, read tolerantly, migrate saved state, then remove the old key once no paused run holds it.

Compare

Two gates for one change

AspectOffline gateOnline watch
WhenBefore release, on a datasetAfter release, on sampled production traces
Reference outputsAvailable, so correctness can be scoredNone exist, so only reference-free checks work
CatchesRegressions on known casesQuality degradation and cases the dataset lacks

The table follows the evaluation-concepts page. Course advice around it: expose a new version to a small share of traffic first, pin langchain, langgraph, langsmith and provider versions in a lock file, upgrade on a branch with an evaluation and a trace comparison, and keep the previous graph and prompt deployable so one rollback restores both.

Source13 Evaluation concepts (LangSmith documentation)

Compare

Runbooks for failures that will happen

FailureFirst response (course advice)
Model provider downFall back to a second model; degrade to answer-only if needed
Runaway loopCancel through the kill switch; check the budget and the recursion limit
Corrupted threadUpdate the state, or fork from the last good checkpoint
Queue backlogLimit or shed load by tenant; add workers
Bad releaseRoll back graph and prompt together
Database growthPrune old checkpoints; keep large documents out of state, since checkpoints accumulate over long conversations

Write each as steps a tired person can follow at 3 a.m., with a named owner.

Source3 Persistence (LangGraph documentation)

Summary

Recap

  • Agent runs are long, bursty, stateful and interruptible; the Agent Server adds queues, persistence, streaming and scheduling around your graph.
  • Assistant, thread, run, store, checkpoint: define each and say where it lives. PostgreSQL holds data; Redis only signals.
  • Hosting: cloud, hybrid, self-hosted with control plane, standalone, or build your own. Each trades operating effort against control.
  • Double texting: enqueue (default), reject, interrupt, rollback. Choose by what a half-done run costs.
  • Authenticate every request, filter threads by owner, inject identity from context, cap spend, and keep a kill switch.
  • Paused runs survive a release only if state is durable and compatible and interrupt order is stable. Gate changes with evaluation.

References

References & Sources (1 of 3)

  1. LangSmith Deployment (LangSmith documentation) (opens in a new tab)

    LangChain2026Documentation

    Used for The deployment options (cloud, hybrid, self-hosted with control plane, standalone), who runs what, the plan requirements the page states, and the shared Agent Server runtime. Read 24 October 2026.

  2. Agent Server (LangSmith documentation) (opens in a new tab)

    LangChain2026Documentation

    Used for Assistants, threads, runs, cron jobs, the store, checkpoints and the task queue; PostgreSQL for core data, Redis for ephemeral signalling; the async and exit durability modes; one run per thread at a time. Read 24 October 2026.

  3. Persistence (LangGraph documentation) (opens in a new tab)

    LangChain2026Documentation

    Used for Checkpointers persist a thread's graph state as checkpoints; in-memory ones lose them on restart and a persistent checkpointer is advised for production.

  4. LangGraph CLI (LangSmith documentation) (opens in a new tab)

    LangChain2026Documentation

    Used for The langgraph.json keys (graphs, dependencies, env, auth, checkpointer, api_version) and the dev, build, up and deploy commands.

  5. Application structure (LangSmith documentation) (opens in a new tab)

    LangChain2026Documentation

    Used for The parts of a deployable project and the shape of the graphs and env entries in the configuration file.

References

References & Sources (2 of 3)

  1. How to kick off background runs (LangSmith documentation) (opens in a new tab)

    LangChain2026Documentation

    Used for The steps of a background run: create a thread, create a run, poll its status (pending, then success), join, and read the final state.

  2. Double texting (LangSmith documentation) (opens in a new tab)

    LangChain2026Documentation

    Used for The four strategies (enqueue as the default, reject, interrupt, rollback) and the statement that double texting is a deployment feature, not part of the open-source library.

  3. Reject Concurrent (LangSmith documentation) (opens in a new tab)

    LangChain2026Documentation

    Used for Reject throws an error for the new run (HTTP 409 Conflict) while the first run continues.

  4. Interrupt concurrent (LangSmith documentation) (opens in a new tab)

    LangChain2026Documentation

    Used for Interrupt keeps the first run in the database with status interrupted, and the thread holds partial data from it.

  5. Rollback Concurrent (LangSmith documentation) (opens in a new tab)

    LangChain2026Documentation

    Used for Rollback deletes the first run, which cannot be restarted; the thread then holds only the second run's messages.

References

References & Sources (3 of 3)

  1. Authentication and access control (LangSmith documentation) (opens in a new tab)

    LangChain2026Documentation

    Used for Authentication on every request, hosted versus self-hosted defaults, authorization handlers at three levels, thread ownership through metadata, store namespaces, and how identity reaches the run configuration.

  2. Interrupts (LangGraph documentation) (opens in a new tab)

    LangChain2026Documentation

    Used for A node re-runs from its start on resume, resume values pair by position, and side effects before an interrupt should be idempotent.

  3. Evaluation concepts (LangSmith documentation) (opens in a new tab)

    LangChain2026Documentation

    Used for Offline evaluation runs on datasets before deployment; online evaluation runs on production traffic without reference outputs.