neon_postgres

Persist and query tenant-scoped EOS state in Neon serverless Postgres.

1|Updated Mar 11, 2026
One-click install
npx skills add https://github.com/antonyfmunoz/OS --skill neon-postgres-antonyfmunoz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: neon_postgres
Source: https://github.com/antonyfmunoz/OS/tree/main/skills/tools/neon_postgres
Command: npx skills add https://github.com/antonyfmunoz/OS --skill neon-postgres-antonyfmunoz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It solves the challenge of reliably reading and writing tenant-scoped persistent state for AI agents using a serverless PostgreSQL backend without leaking credentials or mixing org data.

Core Features & Use Cases

  • Tenant-isolated persistence via RLS: Enforces multi-tenant data access by setting app.current_org_id per transaction, so reads/writes remain scoped to the correct org.
  • Standard psycopg2 data access pattern: Provides a consistent get_conn() + RealDictCursor workflow that returns rows as dictionaries and manages transactions safely.
  • EOS persistence across the system: Supports core EOS capabilities such as interactions logging, skill/agent registration, memory writes, business state reads/writes, and query-driven intelligence components.

Quick Start

Use the neon_postgres skill when your agent needs to query or store EOS state in Neon Postgres, and ask it to “write the correct psycopg2 code using get_conn() with tenant RLS for an org_id-scoped SELECT from the skills table.”

Frequently Asked Questions about neon_postgres

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I persist tenant-scoped agent state in Neon serverless Postgres without leaking data across organizations?

You can persist tenant-scoped agent state by using a psycopg2 connection that sets `app.current_org_id` per transaction, enforcing row-level security so reads and writes remain strictly scoped to the correct organization.

How does row-level security work for multi-tenant AI agent memory in PostgreSQL 16?

Row-level security for multi-tenant memory works by setting the `app.current_org_id` configuration parameter locally within each transaction, ensuring all subsequent queries only access rows belonging to that specific organization.

What's the best way to run parameterized SQL queries with psycopg2 and RealDictCursor in a serverless Postgres environment?

The best way to run parameterized queries is using a standard `get_conn()` pattern with `RealDictCursor` to return rows as dictionaries, executing SQL with `%s` placeholders, and managing transactions safely across pooled or direct Neon endpoints.

Can I use Neon serverless Postgres for upsert operations and logging agent interactions?

Yes, you can use Neon serverless Postgres for upsert operations and agent interaction logging by executing parameterized SQL queries through the standard psycopg2 connection pattern within tenant-isolated transactions.

Why do I need to set LOCAL app.current_org_id when querying a multi-tenant database?

You need to set `LOCAL app.current_org_id` to activate row-level security policies for that specific transaction, preventing cross-tenant data leakage and ensuring all persistent memory writes are correctly scoped.

Are there limitations when using pooled versus direct Neon endpoints for agent database connections?

Pooled and direct Neon endpoints have transaction handling constraints that require consistent connection management; using the correct `get_conn()` pattern ensures safe transaction handling across both endpoint types for agent workflows.