Lumen × LangGraph × Kova
Goal: swap a LangGraph Agent's Checkpointer from SqliteSaver to LumenCheckpointer, deploy to Kova, and observe the crash-recovery comparison.
Before / After
Single machine, no remote backup · Cross-process requires locking · Millisecond crash recovery · No cost tracking.
Microsecond crash recovery (Kova WAL engine) · Native multi-process safety · Automatic Trace + Cost · Remote persistence.
Before
from langgraph.checkpoint.sqlite import SqliteSaver
graph = wf.compile(checkpointer=SqliteSaver.from_conn_string("./state.db"))After
from lumen_ai import LumenCheckpointer, LumenTracer
from kova import KovaClient
kova = KovaClient("kova://prod-cluster")
graph = wf.compile(
checkpointer=LumenCheckpointer(kova_client=kova),
callbacks=[LumenTracer()],
)Local Verification
Start a local Kova
bashdocker run -d --name kova -p 9999:9999 ghcr.io/hanmahong5-arch/kova:latestRun your Agent
bashpython my_agent.pySimulate a crash
bashkill -9 $(pgrep -f my_agent)Restart — resume from the breakpoint
bashpython my_agent.py
Deploy to Kova
# agent.yaml
name: my-research-agent
entry: python my_agent.py
replicas: 3
checkpointer: lumen
wal:
retention: 7dlumen deploy --target kova://prod-clusterCrash-Recovery Comparison Experiment
| Metric | SqliteSaver | Lumen + Kova |
|---|---|---|
| Recovery latency | 8ms (single machine) | Microsecond |
| Multiple replicas | Requires extra locking | Native |
| Cross-datacenter | Manual replication | Async replication built in |
| LLM re-invocation | Re-invokes if SQLite write fails | Never re-invokes |
| Trace | None | Auto-correlated |
Where the microsecond recovery comes from
The Kova engine's scheduling latency is as low as 3μs (full FIFO pipeline Criterion benchmark of 3.17μs, 315K ops/s). LumenCheckpointer hands LangGraph's checkpoint writes to the Kova WAL — recovery uses engine-level WAL replay instead of SQLite file-level recovery, so it is microsecond-scale, far faster than single-machine SQLite's millisecond scale.