Skip to content

feat: HTTP-proxy LangGraph checkpointer#258

Open
danielmillerp wants to merge 1 commit intomainfrom
dm/checkpointer
Open

feat: HTTP-proxy LangGraph checkpointer#258
danielmillerp wants to merge 1 commit intomainfrom
dm/checkpointer

Conversation

@danielmillerp
Copy link
Contributor

@danielmillerp danielmillerp commented Feb 8, 2026

What this does

This PR replaces LangGraph's direct-Postgres checkpointer with an HTTP-proxy checkpointer that routes all checkpoint operations through the agentex backend API.

Why

LangGraph agents need to persist state (checkpoints) between messages. The built-in approach (AsyncPostgresSaver) has each agent pod open its own Postgres connection pool. This doesn't scale — more agent pods means more connections, and we'd hit limits as we grow LangGraph usage. This is the same problem we already solved for Temporal: agents shouldn't talk to the DB directly. Instead, they go through the backend API, which manages a shared connection pool.

How it works

We implemented LangGraph's BaseCheckpointSaver abstract class — the same interface that AsyncPostgresSaver implements — but instead of running SQL queries, each method makes an HTTP POST to the backend:

BaseCheckpointSaver method Backend endpoint called
aget_tuple() POST /checkpoints/get-tuple
aput() POST /checkpoints/put
aput_writes() POST /checkpoints/put-writes
alist() POST /checkpoints/list
adelete_thread() POST /checkpoints/delete-thread

The HttpCheckpointSaver uses the existing AsyncAgentex httpx client (with EnvAuth for the agent API key), so authentication works the same way as every other SDK→backend call.

Serialization stays in the SDK — complex Python objects are serialized via LangGraph's serde, then base64-encoded for JSON transport. The backend just stores and retrieves the raw data.

What changed

  • New: HttpCheckpointSaver class — the HTTP-proxy checkpointer implementation
  • New: create_checkpointer() factory — returns an HttpCheckpointSaver wired up with the SDK client
  • Removed: langgraph-checkpoint-postgres and psycopg[binary] dependencies (no longer needed)
  • Added: langgraph-checkpoint (base types only — BaseCheckpointSaver, CheckpointTuple, etc.)

Impact on agents

Zero code changes. The create_checkpointer() API is unchanged — agents just call it and get back a checkpointer. The only difference is they no longer need DATABASE_URL in their environment.

Companion PR

Test plan

  • Pyright strict mode passes (0 errors)
  • Ruff lint + format passes
  • Manually tested end-to-end with langgraph agent: sent messages, confirmed checkpoints stored and conversation history restored across messages

🤖 Generated with Claude Code

Replace direct Postgres checkpointing with HTTP-proxied checkpoint
operations through the agentex backend API. Agents no longer need
DATABASE_URL or direct DB connections for LangGraph state persistence.

- Add HttpCheckpointSaver that proxies through AsyncAgentex client
- Add create_checkpointer() factory using the HTTP checkpointer
- Replace langgraph-checkpoint-postgres dep with langgraph-checkpoint
- Export checkpointer module from adk package

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant