Custom Store / Memory semantics

Hi everyone,

We’re building a custom Aerospike-backed Store for Langgraph memory/checkpointing, and we’re trying to clarify the expected behavior of put.

Right now, put is used both when:

  • Creating a new record
  • Updating an existing record

But in our use case, updates may need different behaviors:

  1. Replace the entire value
  2. Append/merge into the existing value

Since the BaseStore interface doesn’t specify how updates should be interpreted, I have two questions:

  1. Is put intended to always be a full replace?
  2. If we want to support both “append“ and “replace“, is the recommended approach to implement helper methods (read–modify–write) on top of the store, rather than extending the put semantics?

Aerospike supports efficient partial updates, so we’re trying to understand what the cleanest abstraction is while staying consistent with LangGraph’s store design.

Any guidance or examples from existing custom stores would be really helpful.

Thanks!

Jagrut

1 Like

Based on other implementations, put on BaseStore is basically a full replace.

For checkpointing, there’s put for the whole checkpoint, and put_writes for the partial updates so you can implement those methods.

But for the Memory there’s no put_writes equivalent.

So for your AerospikeStore, you’d need to add your own patch or append methods to use those efficient partial updates and call those methods yourself from inside your graph nodes/tools.

1 Like

Thank you for clarifying @hsm207 .

1 Like