AttributeError: 'AsyncPostgresStore' object has no attribute 'get_next_version' #1095

Closed
opened 2026-02-20 17:43:03 -05:00 by yindo · 1 comment
Owner

Originally created by @xyty-citibank on GitHub (Dec 14, 2025).

Checked other resources

  • This is a bug, not a usage question. For questions, please use the LangChain Forum (https://forum.langchain.com/).
  • I added a clear and detailed title that summarizes the issue.
  • I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example).
  • I included a self-contained, minimal example that demonstrates the issue INCLUDING all the relevant imports. The code run AS IS to reproduce the issue.

Example Code

async with (
        AsyncPostgresStore.from_conn_string(DB_URI) as store,
        AsyncPostgresStore.from_conn_string(DB_URI) as checkpointer
    ):
        await checkpointer.setup() # auto create tables in PostgresSql
        await store.setup()
        supervisor_agent = create_agent(
            model=supervisor_model,
            system_prompt=prompt,
            tools=[query_rewrite],
            store=store,
            state_schema= CustomState,
            checkpointer=checkpointer,
            middleware=[trim_messages],
            context_schema=SuperVisorContext)
        async for step in supervisor_agent.astream(input=get_human_message(query),config=config,context=context, stream_mode='values', subgraphs=True):
            print(step)

Error Message and Stack Trace (if applicable)

Traceback (most recent call last):
  File "E:\work\code\idea\supersonic\agent\src\agent\supervisor.py", line 45, in <module>
    asyncio.run(supervisor(query))
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "D:\soft\Python\Lib\asyncio\runners.py", line 195, in run
    return runner.run(main)
           ~~~~~~~~~~^^^^^^
  File "D:\soft\Python\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "D:\soft\Python\Lib\asyncio\base_events.py", line 725, in run_until_complete
    return future.result()
           ~~~~~~~~~~~~~^^
  File "E:\work\code\idea\supersonic\agent\src\agent\supervisor.py", line 36, in supervisor
    async for step in supervisor_agent.astream(input=get_human_message(query),config=config,context=context, stream_mode='values', subgraphs=True):
        print(step)
  File "E:\work\code\idea\supersonic\agent\.venv\Lib\site-packages\langgraph\pregel\main.py", line 2888, in astream
    async with AsyncPregelLoop(
               ~~~~~~~~~~~~~~~^
        input,
        ^^^^^^
    ...<17 lines>...
        cache_policy=self.cache_policy,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ) as loop:
    ^
  File "E:\work\code\idea\supersonic\agent\.venv\Lib\site-packages\langgraph\pregel\_loop.py", line 1188, in __init__
    self.checkpointer_get_next_version = checkpointer.get_next_version
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'AsyncPostgresStore' object has no attribute 'get_next_version'

Description

I`m trying use AsyncPostgresStore type as checkpointer,but throw error

System Info

langchain 1.1.3
langchain-classic 1.0.0
langchain-community 0.4.1
langchain-core 1.2.0
langchain-deepseek 1.0.1
langchain-mcp-adapters 0.2.1
langchain-openai 1.1.3
langchain-text-splitters 1.1.0
langgraph 1.0.5
langgraph-checkpoint 3.0.1
langgraph-checkpoint-postgres 3.0.2
langgraph-prebuilt 1.0.5
langgraph-sdk 0.3.0
langsmith 0.4.59

Originally created by @xyty-citibank on GitHub (Dec 14, 2025). ### Checked other resources - [x] This is a bug, not a usage question. For questions, please use the LangChain Forum (https://forum.langchain.com/). - [x] I added a clear and detailed title that summarizes the issue. - [x] I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example). - [x] I included a self-contained, minimal example that demonstrates the issue INCLUDING all the relevant imports. The code run AS IS to reproduce the issue. ### Example Code ```python async with ( AsyncPostgresStore.from_conn_string(DB_URI) as store, AsyncPostgresStore.from_conn_string(DB_URI) as checkpointer ): await checkpointer.setup() # auto create tables in PostgresSql await store.setup() supervisor_agent = create_agent( model=supervisor_model, system_prompt=prompt, tools=[query_rewrite], store=store, state_schema= CustomState, checkpointer=checkpointer, middleware=[trim_messages], context_schema=SuperVisorContext) async for step in supervisor_agent.astream(input=get_human_message(query),config=config,context=context, stream_mode='values', subgraphs=True): print(step) ``` ### Error Message and Stack Trace (if applicable) ```shell Traceback (most recent call last): File "E:\work\code\idea\supersonic\agent\src\agent\supervisor.py", line 45, in <module> asyncio.run(supervisor(query)) ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^ File "D:\soft\Python\Lib\asyncio\runners.py", line 195, in run return runner.run(main) ~~~~~~~~~~^^^^^^ File "D:\soft\Python\Lib\asyncio\runners.py", line 118, in run return self._loop.run_until_complete(task) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^ File "D:\soft\Python\Lib\asyncio\base_events.py", line 725, in run_until_complete return future.result() ~~~~~~~~~~~~~^^ File "E:\work\code\idea\supersonic\agent\src\agent\supervisor.py", line 36, in supervisor async for step in supervisor_agent.astream(input=get_human_message(query),config=config,context=context, stream_mode='values', subgraphs=True): print(step) File "E:\work\code\idea\supersonic\agent\.venv\Lib\site-packages\langgraph\pregel\main.py", line 2888, in astream async with AsyncPregelLoop( ~~~~~~~~~~~~~~~^ input, ^^^^^^ ...<17 lines>... cache_policy=self.cache_policy, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) as loop: ^ File "E:\work\code\idea\supersonic\agent\.venv\Lib\site-packages\langgraph\pregel\_loop.py", line 1188, in __init__ self.checkpointer_get_next_version = checkpointer.get_next_version ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'AsyncPostgresStore' object has no attribute 'get_next_version' ``` ### Description I`m trying use AsyncPostgresStore type as checkpointer,but throw error ### System Info langchain 1.1.3 langchain-classic 1.0.0 langchain-community 0.4.1 langchain-core 1.2.0 langchain-deepseek 1.0.1 langchain-mcp-adapters 0.2.1 langchain-openai 1.1.3 langchain-text-splitters 1.1.0 langgraph 1.0.5 langgraph-checkpoint 3.0.1 langgraph-checkpoint-postgres 3.0.2 langgraph-prebuilt 1.0.5 langgraph-sdk 0.3.0 langsmith 0.4.59
yindo added the bugpending labels 2026-02-20 17:43:03 -05:00
yindo closed this issue 2026-02-20 17:43:03 -05:00
Author
Owner

@Imvikram99 commented on GitHub (Dec 14, 2025):

Use the checkpoint saver class. AsyncPostgresStore doesn’t implement BaseCheckpointSaver, so passing it as checkpointer must fail. Swap it with AsyncPostgresSaver.

@Imvikram99 commented on GitHub (Dec 14, 2025): Use the checkpoint saver class. AsyncPostgresStore doesn’t implement BaseCheckpointSaver, so passing it as checkpointer must fail. Swap it with AsyncPostgresSaver.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#1095