Neon

Connect your Neon serverless PostgreSQL database to Memex.

What is Neon?

Neon provides PostgreSQL databases with a serverless architecture. Its design decouples storage from compute resources, which enables on-demand scaling (including scaling to zero when idle) and instant database branching for development workflows. It's a good fit for applications that need flexible, cost-efficient database access.

When you connect Neon to Memex, you can query your PostgreSQL database, analyze data, and generate insights—all through natural conversation.

What You'll Need

To connect Neon to Memex, you'll need your PostgreSQL connection string:

Credential
Description
Example

Connection URL

PostgreSQL connection string

postgresql://neondb_owner:[email protected]/neondb?sslmode=require

Finding Your Connection String

Step 1: Open the Neon Console

Go to console.neon.techarrow-up-right and sign in to your account.

Step 2: Select Your Project

Click on the project containing the database you want to connect.

Step 3: Get Your Connection String

  1. Click the Connect button on your project dashboard

  2. Select the Branch, Database, and Role you want to use

  3. Copy the connection string displayed

Neon Connect dialog showing connection string

The connection string follows this format:

circle-info

Default database name: When you create a new Neon project, it automatically creates a database called neondb and a role called neondb_owner. If you haven't customized these, use these defaults in your connection string.

circle-info

Pooled vs. Direct Connections

Neon offers two connection types:

  • Pooled (hostname includes -pooler): Supports up to 10,000 connections. Best for most applications.

  • Direct (no -pooler suffix): Required for migrations and operations that need persistent connections.

For general use with Memex, the default pooled connection works well.

Connecting to Memex

  1. Open the Memex Hub from the sidebar

  2. Click on the Connectors tab

  3. Click on the Neon card

  4. Enter a Connection Name (e.g., "Production Database")

  5. Paste your Connection URL

  6. Click Add Connection

Your Neon database is now connected! Memex can access it across all your conversations.

Verifying Your Connection

After connecting, try asking Memex:

If Memex returns your tables and columns, the connection is working correctly. The first query may take a moment if your Neon compute was suspended.

Using Your Connection

Once connected, you can ask Memex to work with your Neon database naturally:

Security Considerations

Connection String Security

Your connection string contains your database password. Memex stores this securely, but you should:

  • Never share your connection string publicly

  • Use role-based access to limit what the connected user can do

  • Consider creating a read-only role for Memex if you only need to query data

SSL/TLS Encryption

All Neon connections require SSL encryption (sslmode=require). This ensures your data is encrypted in transit between Memex and your database.

circle-exclamation

Troubleshooting

You can ask the Memex agent to help troubleshoot, but here are a few common problems:

"Connection refused" Error

  • Verify your connection string is correct and complete

  • Check that your Neon project is active

  • Ensure SSL mode is set to require in the connection string

Slow Initial Queries

  • This is normal if your Neon compute has scaled to zero

  • The first query triggers a "cold start" that takes a few hundred milliseconds

  • Subsequent queries will be faster

"Authentication failed" Error

  • Double-check the username and password in your connection string

  • Verify you're connecting to the correct database and branch

  • Try regenerating your password in the Neon console

Learn More

Last updated

Was this helpful?