Skip to main content

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:

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

Provide the API key, the project ID, and optionally a branch ID when prompted. Setup verifies the key against the project before saving.

Option 2: Environment variables

Add to your .env:

Option 3: Persistent store

Credentials

  1. In the Neon Console, open Organization settings → API keys.
  2. Create a key and, under the project option, limit it to the project OpenSRE should read.
  3. Copy the key. It is shown once.
  4. Copy the project ID from Project settings → General, or from the URL of the project page.
A personal API key (Account settings → API keys) also works but can read every project you can.
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.
OpenSRE calls the Neon API at 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 -pooler in 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:
Keep the bucket private. opensre remote-sync status warns when the bucket’s access level is public_read.

Verify

Expected output:
Inside the REPL: /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 .env or the OpenSRE credentials store, not in source code.
  • Rotate the key periodically and revoke it when you remove the integration.