Neon serverless Postgres specialist for AI workloads: database branching, auto-scaling compute, pgvector for embedding storage and similarity search, and connection pooling for serverless environments.
Ships in frootai-deploy-infra-skills. Installing the plugin adds it to Claude Code.
Neon serverless Postgres specialist for AI workloads. Designs database branching workflows, auto-scaling compute, pgvector for embedding storage and similarity search, and connection pooling for serverless environments.
@neondatabase/serverless driver| Mistake | Why Wrong | Correct Approach |
|---|---|---|
| Creates separate Neon project per environment | Unnecessary cost, no branch benefit | One project, branches for environments: main (prod), dev/*, pr/* |
| Uses regular Postgres driver in serverless | Connection pool exhaustion on cold starts | @neondatabase/serverless driver with HTTP transport for edge/serverless |
| Creates IVFFlat index for small datasets | IVFFlat needs 1M+ rows to be effective, poor recall on small sets | HNSW for < 1M rows (better recall), IVFFlat only for 1M+ rows |
| Leaves branches running after PR merge | Persistent compute cost on abandoned branches | Auto-delete branches on PR merge via GitHub webhook or Neon API |
| No connection pooling | Connection limit exceeded under load | Enable built-in pgbouncer: ?pgbouncer=true in connection string |
-- Enable pgvector
CREATE EXTENSION IF NOT EXISTS vector;
-- Documents table with embeddings
CREATE TABLE documents (
id SERIAL PRIMARY KEY,
doc_id TEXT NOT NULL,
chunk_index INT NOT NULL,
title TEXT NOT NULL,
content TEXT NOT NULL,
embedding vector(1536) NOT NULL, -- text-embedding-3-small
category TEXT,
tenant_id TEXT NOT NULL,
created_at TIMESTAMPTZ DEFAULT NOW()
);
-- HNSW index for fast similarity search
CREATE INDEX ON documents USING hnsw (embedding vector_cosine_ops)
WITH (m = 16, ef_construction = 200);
-- Composite index for filtered search
CREATE INDEX ON documents (tenant_id, category);
-- Similarity search with filter
SELECT id, title, content, 1 - (embedding <=> $1::vector) AS similarity
FROM documents
WHERE tenant_id = $2 AND category = $3
ORDER BY embedding <=> $1::vector
LIMIT 10;
# GitHub Actions: create branch on PR open, delete on merge
name: Neon Branch Management
on:
pull_request:
types: [opened, closed]
jobs:
create-branch:
if: github.event.action == 'opened'
runs-on: ubuntu-latest
steps:
- run: |
curl -X POST "https://console.neon.tech/api/v2/projects/$NEON_PROJECT_ID/branches" \
-H "Authorization: Bearer $NEON_API_KEY" \
-d '{"branch": {"name": "pr-${{ github.event.number }}", "parent_id": "main"}}'
delete-branch:
if: github.event.action == 'closed'
runs-on: ubuntu-latest
steps:
- run: |
BRANCH_ID=$(curl -s "https://console.neon.tech/api/v2/projects/$NEON_PROJECT_ID/branches" \
-H "Authorization: Bearer $NEON_API_KEY" | jq -r '.branches[] | select(.name=="pr-${{ github.event.number }}") | .id')
curl -X DELETE "https://console.neon.tech/api/v2/projects/$NEON_PROJECT_ID/branches/$BRANCH_ID" \
-H "Authorization: Bearer $NEON_API_KEY"
import { neon } from "@neondatabase/serverless";
const sql = neon(process.env.DATABASE_URL!);
export async function searchDocuments(queryEmbedding: number[], tenantId: string, topK = 10) {
const results = await sql`
SELECT id, title, content, 1 - (embedding <=> ${JSON.stringify(queryEmbedding)}::vector) AS similarity
FROM documents
WHERE tenant_id = ${tenantId}
ORDER BY embedding <=> ${JSON.stringify(queryEmbedding)}::vector
LIMIT ${topK}
`;
return results;
}
@neondatabase/serverless?pgbouncer=true in connection string| Scenario | Use This Agent | Don't Use |
|---|---|---|
| Serverless Postgres for AI | ✅ | |
| pgvector embedding storage | ✅ | |
| Branch-per-PR workflow | ✅ | |
| Azure SQL Database | ❌ Use fai-azure-sql-expert | |
| Cosmos DB | ❌ Use fai-azure-cosmos-db-expert |
| Play | How This Agent Helps |
|---|---|
| 01 — Enterprise RAG | pgvector storage, similarity search, branch-per-PR |
What the agent file sets; muted values are Claude Code's defaults
7-day visitors to each agent page
@agent-frootai-deploy-infra-skills:FAI Neon Expertfrom frootai-deploy-infra-skills
npx claudepluginhub frootai/frootai --plugin frootai-deploy-infra-skills327 agents in this plugin
AGENTSAGENTS.md — FrootAI Standalone Agents (Auto-Generated Catalog)> **GENERATED FILE — DO NOT EDIT BY HAND.** Re-run `node scripts/generate-agents-md.js` to refresh.FAI A2A ExpertAgent-to-Agent (A2A) protocol specialist — Google's agent interop standard, AgentCard discovery, task lifecycle, streaming artifacts, push notifications, and multi-agent communication patterns.FAI Accessibility ExpertAccessibility specialist — WCAG 2.2 AA/AAA compliance, ARIA 1.2 patterns, screen reader optimization, keyboard navigation, focus management, and inclusive design for AI chatbots and dashboards.FAI ADR WriterADR writer — documents architecture decisions with MADR 3.0 template, context, alternatives, trade-off matrices, consequences, and WAF pillar impact analysis.FAI Agentic RetrieverAgentic retrieval specialist — autonomous source selection, iterative refinement with relevance scoring, multi-hop reasoning, query decomposition, and grounded answer synthesis with inline citations.FAI AG-UI ExpertAG-UI protocol specialist — Agent-User Interaction standard, event-based rendering, streaming state updates, tool call lifecycle, and frontend integration for AI agent experiences.Other plugins' agents for the same job