Skip to content

Observability & control · LangGraph

Watch your agents run. Take the controls when it counts.

LangMonitor streams every node, LLM call, and state diff from your LangGraph agents in real time — then lets you pause, kill, roll back, or swap a prompt while the run is still live.

$ pip install langmonitor

One import · runs in your process · Python 3.10+ · MIT

Live
NodeTokens
  1. ingest
  2. retrieve
  3. planner148
  4. researcher512
  5. critic196
  6. summarize···

A live run, as LangMonitor sees it. Try the controls.

Integration

Wrap the graph. The dashboard is already running.

monitor() returns a drop-in stand-in for your graph — same invoke and ainvoke. A dashboard goes live on the port you choose, served from inside your own process. There's no separate server to run.

app.py
from langmonitor import monitor
# Wrap your compiled LangGraph graph — that's the whole integration.
monitored = monitor(compiled_graph, port=8000)
# Use it exactly like the graph you passed in.
result = monitored.invoke({"input": "hello"})

What it does

Three jobs, from the outside of your agent.

Observe

Every event, as it happens

Watch each node start and end, every LLM call, and full state diffs — streamed live over WebSocket the moment they occur.

Control

Operate a run in flight

Kill, pause, resume, inject state, or swap a node's prompt on a run that's already executing.

Recover

Roll back to any point

Snapshot a run on top of LangGraph's checkpointer and restore it — the run auto-pauses so you can inspect first.

More of the control surface

Everything is a plain REST call you can script.

Guardrails

Rules that act on their own

Every node end is checked. When a rule trips it kills, pauses, or alerts — no human in the loop.

json
{
"name": "cost cap",
"rule_type": "max_cost_usd",
"config": { "threshold": 2.0 },
"action": "kill"
}

max_tool_calls · max_node_repeats · max_latency_ms · max_cost_usd · custom_condition

A/B prompts

Swap a prompt mid-run

Register two prompts for a node, then switch the live variant. The wrapper picks it up before the next step — no redeploy.

shell
$ curl -X POST \
localhost:8000/api/v1/ab-tests/<id>/swap

Compare an aggressive planner against a careful one on the same graph, while it runs.

Streaming

Subscribe to the firehose

Connect to a single run or every run at once over WebSocket. Each message arrives in the same typed envelope.

WS/ws/runs/{run_id}
WS/ws/all
  • run_started
  • node_start
  • node_end
  • llm_call
  • state_updated
  • guardrail_alert
  • agent_paused
  • checkpoint_saved
  • run_ended

Fails open, always

If the dashboard can't start, your agent runs anyway — just unmonitored. Monitoring never breaks the thing it's monitoring.

Self-contained

The dashboard ships prebuilt inside the wheel and is served by your app on the same origin. No Node, no build step, no extra service.

FAQ

Questions, answered.

What is LangMonitor?
LangMonitor is an open-source Python library that adds real-time observability and operator controls to LangGraph agents. You wrap a compiled graph in one line and get a live dashboard that streams every node, LLM call, and state diff — and lets you pause, kill, resume, inject state, roll back to a checkpoint, or A/B-swap a node's prompt while the run is in flight.
How do I install LangMonitor?
Run pip install langmonitor. It requires Python 3.10 or newer and runs inside your existing process — there is no separate server to deploy.
Does LangMonitor work with LangGraph?
Yes. LangMonitor is built specifically for LangGraph. It wraps a compiled StateGraph and builds on LangGraph's native checkpointer, so your invoke and ainvoke calls work unchanged.
Can I control an agent while it is running?
Yes — that is the core feature. Over a REST and WebSocket API you can pause, resume, kill, inject state, roll back to a checkpoint, or swap a node's prompt mid-run. Kill and pause take effect before the next node executes.
Will LangMonitor slow down or break my agent?
No. Monitoring fails open: if the dashboard cannot start, your agent keeps running unmonitored. LangMonitor never breaks the thing it is monitoring.
Is LangMonitor free and open source?
Yes. LangMonitor is free and open source under the MIT license, and is published on PyPI.

Ready when you are

Put your agents on the record.

Install it, wrap one graph, and open the dashboard. It runs inside the process you already have.

$ pip install langmonitor