Replies: 1 comment
-
I am facing this issue, did you find a solution ? I am trying to use pgbouncer with transactions. I find that if you use postgres connections directly or session in pgboucer it works. It doesnt scale well as you have a connection bottleneck. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I’m building a three-stage LangGraph bot—intake_agent → planner_agent → research_agent—and using Supabase Postgres to persist memory via PostgresSaver. My single-agent prototype worked perfectly, but during the second hand-off (planner → research) I now see:
psycopg.errors.DuplicatePreparedStatement: prepared statement "_pg3_0" already exists
I’ve tried connection pools, disabling auto-prepare, and even unique_name=True, but nothing prevents the clash. Occasionally this is followed by a BadRequestError from OpenAI about missing ToolMessage responses, despite wiring the ToolNode and edges as in the tutorials.
Here is my current environment:
• langgraph-checkpoint-postgres 2.0.21
• psycopg 3.2.7
• langchain-openai 0.3.5
• Python 3.13 on macOS Sequoia
And here is my get_memory helper—note that I added these extra options for debugging; my initial version was much simpler:
Despite these tweaks, the second hand-off still crashes. Has anyone overcome this in a multi-agent LangGraph setup? Would you recommend a different persistence store—Redis, S3, Qdrant—or a different graph architecture to avoid the pipeline/prepared-statement clash? Any suggestions or pointers would be hugely appreciated.
Thanks in advance!
Nick
Beta Was this translation helpful? Give feedback.
All reactions