Overview
OpenSRE reads your Neon project through the Neon API to answer the questions that come up first in a Postgres incident: is the compute running or scaled to zero, did a restart or branch operation fail, which branch is the app pointed at, and did the expected files land in Neon Object Storage. The integration is read-only. It never starts, suspends, resets, or deletes anything. Neon also plugs into two other parts of OpenSRE:- Postgres diagnostics (active queries, locks, slow queries, table stats) come from the PostgreSQL integration pointed at your Neon compute. See Postgres diagnostics on Neon.
- Remote sync can mirror sessions and memory to a Neon Object Storage bucket. See Remote sync to Neon Object Storage.
Prerequisites
- A Neon project
- A Neon API key that can read that project
- The project ID (for example
little-lab-10567887)
Setup
Option 1: Interactive CLI
Option 2: Environment variables
Add to your.env:
Option 3: Persistent store
Credentials
- In the Neon Console, open Organization settings → API keys.
- Create a key and, under the project option, limit it to the project OpenSRE should read.
- Copy the key. It is shown once.
- Copy the project ID from Project settings → General, or from the URL of the project page.
The key is injected into each tool call by OpenSRE and hidden from the model, and the project ID is fixed to the configured one. The model can pick a branch inside that project but cannot point the key at another project.
https://console.neon.tech/api/v2.
Tools
The tools are available in both chat and investigation turns.
Postgres diagnostics on Neon
Configure the PostgreSQL integration with your Neon connection details to get active queries, locks, replication, server status, slow queries, and table stats:- Use the direct compute host. The pooled host (the one with
-poolerin its name) rejects the connection, because OpenSRE sets a statement timeout at connect time and Neon’s connection pooler does not accept that startup parameter. - Set
POSTGRESQL_SSL_MODE=require. Neon only accepts TLS connections. - For slow queries, run
CREATE EXTENSION pg_stat_statements;once in the database. Neon already preloads the library. - A compute that has scaled to zero starts on the first connection, so the first diagnostic call after an idle period takes a moment longer.
Remote sync to Neon Object Storage
Remote sync can mirror your sessions and memory to a Neon Object Storage bucket:opensre remote-sync status warns when the bucket’s access level is public_read.
Verify
/integrations verify neon or /verify neon.
Troubleshooting
Security
- Prefer a project-scoped API key so OpenSRE can only read the project it investigates.
- Store the key in
.envor the OpenSRE credentials store, not in source code. - Rotate the key periodically and revoke it when you remove the integration.