Skip to content
Migrating from LangGraph

Migrating from LangGraph to Lumen + Kova

SqliteSaver → LumenCheckpointer + LumenTracer, deploy your Agent to a Kova cluster—no changes to your business code.

What you get ​

Before (plain LangGraph)After
SqliteSaver single-node persistenceLumenCheckpointer + Kova microsecond-level WAL recovery
No tracingLumenTracer automatic capture
No cost trackingCostTracker aggregated per node
Manual replayReplay.from_run_id() in one line

Migration steps ​

  1. Replace the Checkpointer — LumenCheckpointer implements BaseCheckpointSaver 100%, with no changes to your business code.

    diff
    - from langgraph.checkpoint.sqlite import SqliteSaver
    + from lumen_ai import LumenCheckpointer
    
    - graph = wf.compile(
    -     checkpointer=SqliteSaver.from_conn_string("./state.db")
    - )
    + graph = wf.compile(
    +     checkpointer=LumenCheckpointer()
    + )
  2. Add the Tracer — once running locally, visit http://localhost:7070 to see the trace timeline.

    diff
    + from lumen_ai import LumenTracer
    
      graph = wf.compile(
          checkpointer=LumenCheckpointer(),
    +     callbacks=[LumenTracer()],
      )
  3. Deploy to Kova

    yaml
    # agent.yaml
    name: research-agent
    entry: python my_agent.py
    checkpointer: lumen
    replicas: 3
    bash
    lumen deploy --target kova://prod-cluster

Local verification ​

bash
python my_agent.py           # runs normally
kill -9 $(pgrep -f my_agent) # simulate a crash
python my_agent.py           # resumes from the interruption point, no LLM re-call

Performance comparison ​

MetricBeforeAfter
Recovery latency8msmicrosecond-level
Multi-processneeds lockingnative
Cross-datacentermanualasync replication
LLM re-callsometimesnever

Rollback

Keep the old SqliteSaver code commented out; revert the diff at any time to return to the original state. The data is not shared, but they can run in parallel.

Next steps ​

Next steps

Powered by Lurus Technologies