← Back to writing

LangGraph Checkpointer
for SAP HANA Cloud

Persistent memory, fault recovery, and time travel for your LangGraph agents — all in the HANA instance you already have.

The missing piece

LangGraph has checkpointers for PostgreSQL, SQLite, Redis, CosmosDB. The community added Snowflake and Couchbase. SAP HANA? Nothing.

So I built one.

If you're already using HANA Vector Store for RAG, your agent state can live in the same database. No separate Postgres or Redis just for checkpointing. One database, one connection, one place to manage.

langgraph-checkpoint-hana

langgraph-checkpoint-hana implements the full BaseCheckpointSaver interface for HANA Cloud. It gives your LangGraph agents three critical capabilities:

Persistent memory
Agent state survives restarts and deployments. Conversations pick up where they left off.
Fault recovery
If an agent crashes mid-execution, it recovers from the last checkpoint — no lost work.
Time travel
Replay agent execution from any previous state. Debug, audit, or branch from past decisions.
Installation pip install langgraph-checkpoint-hana

Implementation details

The implementation uses UPSERT WITH PRIMARY KEY for atomic writes — no race conditions on concurrent checkpoint saves. Setup is straightforward with from_conn_info() and from_env() for easy container deployment.

I also added delete_thread() for GDPR cleanup — when a user requests data deletion, you can wipe their agent conversation history cleanly.

Async delegates to sync because hdbcli is synchronous — no point pretending otherwise.

One honest design choice: the async interface delegates to sync operations because HANA's Python driver (hdbcli) is synchronous. Rather than adding fake async wrappers that just run sync code in a thread pool, I kept it transparent. The interface is async-compatible for LangGraph, but the I/O is honest about what it's doing.

Key points
  • Full BaseCheckpointSaver — complete LangGraph interface implementation
  • Atomic writes — UPSERT WITH PRIMARY KEY prevents race conditions
  • Container-ready — from_env() reads connection info from environment variables
  • GDPR cleanup — delete_thread() for data deletion compliance
  • No extra infra — checkpoint data lives alongside your RAG vectors in HANA
  • MIT licensed — submitted to LangGraph as community checkpointer