evexBrowseDocsLeaderboard
evexthe eve agent registry
LeaderboardDocsLearneve docsllms.txt
Back to Registry

Postgres Data Analyst

data

An Eve-native Slack analyst for a single Postgres database. It answers Slack mentions and DMs, inspects schema metadata, and runs bounded read-only SQL through authored tools.

TOby TommyBez13 files

Install

Run this command in your eve app to add the agent.

Package manager
$npx shadcn@latest add @evex/postgres-data-analyst
Category
data

data agents and workflows

Files
13 files

2 tools

Requires
6 dependencies

@vercel/connect@^0.2.6, ai@^7.0.38, eve@^0.31.3, pg@^8.21.0, pgsql-ast-parser@^12.0.1, zod@4.3.6

Updated
Jul 4, 2026

Source-owned registry metadata

What's included

13 files2 tools
Dependencies:@vercel/connect@^0.2.6ai@^7.0.38eve@^0.31.3pg@^8.21.0pgsql-ast-parser@^12.0.1zod@4.3.6

About Postgres Data Analyst

Postgres Data Analyst is an eve agent that lives in your Slack workspace and answers questions about a single Postgres database. Mention it in a channel or send it a DM, ask something like show total signups by month for the last 6 months, and it inspects the schema, writes one read-only SQL query, runs it, and replies with an interpreted answer rather than a raw row dump.

Safety is layered rather than assumed. Every query is parsed into an AST with pgsql-ast-parser and rejected unless it is a single SELECT or WITH statement over allowed schemas; INSERT, UPDATE, DELETE, DDL, SET, and transaction control are all blocked before anything reaches the database. Execution then happens inside a READ ONLY transaction with a statement timeout and a hard row cap, and the docs walk you through creating a dedicated read-only Postgres role as the real enforcement boundary.

It works with any Postgres you can reach with a connection string, including Neon branches and Supabase, and connects to Slack through Vercel Connect so you never handle bot tokens or signing secrets yourself. Schema allowlists and a blocked-tables list let you keep sensitive tables out of both query results and schema listings.

How it works

  1. A Slack mention or DM arrives through the eve Slack channel at /eve/v1/slack, authenticated by Vercel Connect credentials resolved from DATA_ANALYST_SLACK_CONNECT_UID, so no Slack bot token is stored in your environment.
  2. If the metric definition, time range, table choice, or grain is ambiguous, the agent asks a clarifying question in the thread before touching the database, a behavior pinned by the ambiguous-metric-clarification eval.
  3. For unfamiliar tables it calls the describe_schema tool, which lists tables, columns, types, nullability, and primary keys from allowed schemas only, filtering out anything in DATA_ANALYST_BLOCKED_TABLES.
  4. It writes one read-only query and calls run_sql, which parses the SQL into an AST, rejects anything that is not a single SELECT or WITH statement, blocks disallowed schemas, blocked tables, and unqualified pg_ catalog tables.
  5. Validated SQL runs inside a READ ONLY transaction with SET LOCAL statement_timeout applied and results wrapped in a LIMIT of DATA_ANALYST_MAX_ROWS plus one, so the agent knows when output was truncated and says so.
  6. The agent interprets the rows in plain language for Slack, stating assumptions, filters, units, and date windows, and narrows the question instead of issuing broader SQL when results are incomplete.

Use cases

Self-serve metrics in Slack

Let product managers and founders ask signups by month, active users last week, or revenue by plan directly in a channel, without writing SQL or waiting on a data team, while the agent explains the query assumptions it made.

Safe database exploration for the whole team

Point the agent at a reporting schema and let anyone ask what schemas and tables can you see. describe_schema exposes only allowed schemas and hides blocked tables, so exploration stays inside boundaries you define.

Read-only analytics over Neon or Supabase

Connect a Neon reporting branch or a dedicated read-only Supabase role and get conversational analytics without granting the service role. The AST validator plus the read-only role means no write path exists.

Guarded ad hoc investigations

Debug a spike or verify a customer claim with bounded queries: a 10 second default statement timeout and a 200 row default cap keep exploratory SQL from hammering production, and the agent labels truncated results.

Requirements

DATA_ANALYST_DATABASE_URL
Postgres connection string the agent queries. Create a dedicated read-only role (the README includes the exact GRANT statements) and use its credentials; the role, not the SQL validator, is the enforcement boundary.
DATA_ANALYST_ALLOWED_SCHEMAS
Comma-separated list of schemas the agent may query and describe. Defaults to public. Queries referencing any other schema are rejected before execution, and search_path is pinned to this list.
DATA_ANALYST_BLOCKED_TABLES
Optional comma-separated table names, plain or schema-qualified like users,public.accounts, that are excluded from both run_sql queries and describe_schema listings. Leave empty to block nothing.
DATA_ANALYST_MAX_ROWS
Maximum rows returned per query, 1 to 1000, default 200. The tool wraps every query in a LIMIT and flags truncated results so the agent can narrow the question.
DATA_ANALYST_STATEMENT_TIMEOUT_MS
Per-query statement timeout in milliseconds, 1000 to 60000, default 10000. Applied with SET LOCAL inside each transaction so a runaway query cannot hold a connection.
DATA_ANALYST_SLACK_CONNECT_UID
Vercel Connect UID for the Slack integration, default slack/postgres-data-analyst. Obtain it by running vercel connect create slack --triggers from the Vercel project and attaching it to the /eve/v1/slack route.

FAQ

How do I install it?

Run npx shadcn@latest add @evex/postgres-data-analyst inside an existing eve app, install the listed dependencies (eve, pg, pgsql-ast-parser, zod, @vercel/connect), fill in the DATA_ANALYST_* environment variables, deploy, then connect Slack with vercel connect create slack --triggers.

Can it modify or delete data?

No. Every query is parsed into an AST and rejected unless it is a single SELECT or WITH statement; INSERT, UPDATE, DELETE, TRUNCATE, DDL, and SET are blocked. Execution runs in a READ ONLY transaction, and the recommended setup uses a Postgres role with SELECT-only grants. A dedicated eval verifies the agent refuses mutation requests.

Which model does it use, and can I change it?

The agent ships with zai/glm-5.2 configured in agent/agent.ts. The files install into your codebase, so edit that one line to switch to any model the eve framework supports.

How do I keep sensitive tables out of Slack?

Restrict DATA_ANALYST_ALLOWED_SCHEMAS to reporting schemas, list sensitive tables in DATA_ANALYST_BLOCKED_TABLES, and grant the database role SELECT only on safe tables. Blocked tables are hidden from schema listings and rejected in queries, but remember anything the role can read could surface in a channel.

What are the query limits?

One statement per request, SELECT or WITH only, at most 1000 rows (200 by default), a statement timeout capped at 60 seconds (10 by default), and a connection pool of 3. run_sql blocks unqualified pg_catalog tables and labels truncated results.

Files

13

Core

11

Tools

2

npx shadcn@latest add @evex/postgres-data-analyst
evexBrowseDocsLeaderboard
Sign In
127 installs

Related Agents

View all 10 by TommyBez →
data
121

Supabase Data Analyst

A Slack-native Eve analyst for a single Supabase project that only runs read-only SQL queries. It exposes just supabase__list_tables and supabase__execute_sql through an MCP client connection to the hosted Supabase MCP server; no write, migration, Edge Function, branch, storage, logs, advisors, account, or docs tools are available.

TOTommyBezView →
marketing
204

Brand Visual Asset Generator

Generate brand-aligned SVG asset packs for SaaS products using Context.dev brand extraction and a Quiver Arrow SVG tool.

TOTommyBezView →
coding
195

Code Reviewer

Review GitHub pull requests from a native GitHub App channel. Mention @code-reviewer on a pull request to publish a GitHub review with inline comments, optional suggestion blocks, and Upstash-backed rate limiting for public repositories.

TOTommyBezView →
Stars21