Skip to main content

Crash-resumable LangGraph agents with tamper-evident, cryptographically signed checkpoints. Drop-in KanonCheckpointer for LangGraph.

Project description

Kanon

Your LangGraph agent crashed at step 38. Kanon resumes it at step 38.

# Before
from langgraph.checkpoint.memory import MemorySaver
graph = builder.compile(checkpointer=MemorySaver())

# After — agents resume from last signed checkpoint on restart
from kanon.langgraph import KanonCheckpointer
graph = builder.compile(checkpointer=KanonCheckpointer(api_key="kn_..."))
pip install kanon[langgraph]

Every checkpoint is cryptographically signed. If the stored state is altered between save and resume, Kanon raises KanonTamperedError before returning state to LangGraph.

Run the demo →


Crash-resume demo

$ python demo/crash_resume_demo.py --demo

[kanon-demo] Starting 5-step research agent  thread=demo-thread-1
  Step 1/5  node=gather_sources        ✓  snap=snap_a1b2c3  (signed)
  Step 2/5  node=summarise_sources     ✓  snap=snap_d4e5f6  (signed)
  Step 3/5  node=draft_findings        ✓  snap=snap_g7h8i9  (signed)
💥 Simulated crash after step 3. Process state wiped.

[kanon-demo] Resuming  thread=demo-thread-1  from=snap_g7h8i9
  Step 4/5  node=verify_findings       ✓  snap=snap_j0k1l2  (signed)
  Step 5/5  node=write_report          ✓  snap=snap_m3n4o5  (signed)

[kanon-demo] Complete. Signed receipt chain:
  snap_a1b2c3  →  snap_d4e5f6  →  snap_g7h8i9  (crash)  →  snap_j0k1l2  →  snap_m3n4o5
  proof_bundle hash: e3b0c442...  agent=kanon-demo  tenant=demo

Or as two separate processes:

bash demo/run_demo.sh

How it works

KanonCheckpointer is a drop-in replacement for LangGraph's MemorySaver. After each node, LangGraph calls put() — Kanon signs the checkpoint and stores it server-side. On resume, get_tuple() calls restore_snapshot, the server verifies the HMAC proof bundle, and LangGraph continues from the last good state.

The signed receipt chain links every checkpoint to its predecessor. After a crash, the resume linkage (work_artifacts[resume_linkage]) keeps the server-side audit graph connected across the recovery boundary.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kanon_langgraph-0.1.0.tar.gz (112.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kanon_langgraph-0.1.0-py3-none-any.whl (68.7 kB view details)

Uploaded Python 3

File details

Details for the file kanon_langgraph-0.1.0.tar.gz.

File metadata

  • Download URL: kanon_langgraph-0.1.0.tar.gz
  • Upload date:
  • Size: 112.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for kanon_langgraph-0.1.0.tar.gz
Algorithm Hash digest
SHA256 99ad21868b99c1eb5f3d499d8ad828ed0b25f7ce819d7a8d4437c60eccb1762a
MD5 2b0ddf5ed5d0615c63a7fe9ddd1fee01
BLAKE2b-256 ed59b431250c2411f9cfc2323d55cdb15d3eec371e2c1d2e385687a9847ed9ea

See more details on using hashes here.

File details

Details for the file kanon_langgraph-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for kanon_langgraph-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f878d31769f267077317ea749826a831a080e21fe66adbd58df5e5396b536f4b
MD5 da0522548d50e56da596c4f503fdc32e
BLAKE2b-256 9ea961873786143ce2f5363ba7869e6e2cee85cd18f6b2a8e02537b18b3ae2f0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page