Below is some guidance based on LangGraph’s current behavior and configuration options:
Connecting to a PostgreSQL Server on GCP
Because LangGraph’s PostgresStore requires the use of psycopg (a standard Postgres driver) and expects a direct database connection, you will need to present connection parameters that allow psycopg to connect. In many GCP setups the Postgres instance is not directly accessible via a public endpoint without some help (for example, via a Cloud SQL Auth Proxy).
There isn’t currently a documented “hack” inside LangGraph to bypass the need for a direct psycopg connection. In practice, if you cannot expose the Postgres endpoint more openly, the Cloud SQL Auth Proxy remains the easiest secure option.
About LANGGRAPH_STORE and Default Configuration
When you see the log message:
No LANGGRAPH_STORE configuration found, using default configuration
this means that LangGraph Platform did not find an environment variable named LANGGRAPH_STORE
. In that case, it falls back to an internal default store configuration. This is typically a lightweight internal store (for example, an in-memory or file-based fallback) that is used in absence of an explicit store configuration.
Key points:
-
LANGGRAPH_STORE Environment Variable:
You can supply a structured configuration (often as JSON) to configure a PostgresStore. For example, you might set it like this:
export LANGGRAPH_STORE='{
"type": "postgres",
"connection_string": "postgresql://user:password@your_postgres_host:5432/your_database",
"sslmode": "require"
}'
Adjust the connection string and any SSL options as needed for your GCP setup.
-
Default Behavior:
The default configuration (when no LANGGRAPH_STORE is provided) is designed to allow LangGraph Platform to run but not to use your production-ready persistent store. It does not automatically provide a connection to a Postgres database. Since there isn’t a single centralized document on LANGGRAPH_STORE yet, the recommendation is to explicitly define it when deploying to production.
Recommendations
-
Explicitly Declare Your Store:
Even if your database is publicly reachable (or reachable with SSL and proper IP configurations), it’s best to set the LANGGRAPH_STORE
variable with the appropriate JSON configuration. This removes ambiguity and lets you know which store is being used.
-
Consider Security:
If you choose not to use the Cloud SQL Auth Proxy, carefully review the security settings for your GCP Postgres instance to ensure that only authorized traffic from your LangGraph Platform can connect.
-
Documentation & Issues:
Since official documentation on LANGGRAPH_STORE is still sparse, if you have further questions or run into issues, consider opening a GitHub issue in the LangGraph repository or checking the community channels. This helps improve the documentation over time.
In summary, there isn’t a built‑in workaround in LangGraph to bypass the need for a direct psycopg connection to your Postgres instance when it isn’t publicly accessible. If you want to avoid the Cloud SQL Auth Proxy, you must modify your GCP Postgres accessibility. Also, the LANGGRAPH_STORE variable controls which store LangGraph uses; if it isn’t set, it defaults to an internal configuration that isn’t designed for production persistence.