Skip to content
New Project

eve Data Analyst

Slack-based data analyst built on eve that answers questions about your business from a Postgres database.

DeployView Demo

Answer data questions from Slack with eve.

Slack-based data analyst built on eve that answers questions about your business from a Postgres database. Ask "What was our MRR last month?" in Slack and it replies with the number, plus a chart or table when one helps.

Getting started

Vercel's project setup flow will create a repository in your Git account and a Vercel project. You'll create and install a Slack app via Vercel Connect, and the flow adds a private Vercel Blob store for the agent's memory. You'll then be prompted to add the following environment variables:

Environment variableWhat to enter
DATABASE_URLThe connection string for your Postgres database, version 14 or later. Use a database user that can create schemas and roles, such as the database owner.
ANALYST_SEED_DEMO_DATAtrue loads demo data for a fictional SaaS company, with 18 months of subscriptions, billing, and website traffic. Enter false to use your own data.

Each deploy prepares your database before building the agent. It loads the demo data when ANALYST_SEED_DEMO_DATA is true, and it creates the read-only database user the agent queries with.

When the deploy finishes, add the agent to a Slack channel, @mention it, and ask "What was our MRR last month?"

Use your own data

Add an environment variable named ANALYST_SCHEMAS that lists the database schemas holding your tables, separated by commas, such as public,billing. Then redeploy. Use your own database in the customization guide covers the other available options.

Tech stack

LayerTechnology
Agent frameworkeve
Slack integrationVercel Connect
DataPostgres
Memory storageVercel Blob
SandboxVercel Sandbox

How it answers

The agent looks up which tables it can read and what their columns mean, then loads your metric definitions from agent/skills/metric-definitions.md, so terms like "MRR" and "churn" follow your team's rules. It runs a summarizing query and replies with the number, the exact period, and the time zone. Trends, rankings, and breakdowns appear as Slack charts and tables.

Below each answer, a collapsed "SQL query" section shows the queries the agent ran, the tables each one read, and when it ran. The agent remembers preferences such as number formatting or a channel's default region, while metric definitions stay in the skill file.

How it stays safe

The agent can only read your database. These safeguards keep it that way and protect your data:

  • The agent connects as a dedicated database user, which reads data through the asking person's role.
  • Every query runs in a read-only transaction with a time limit, and the transaction is rolled back afterwards.
  • Each query is wrapped so the database runs it as a single SELECT statement.
  • Before running a query, the agent asks Postgres to estimate its cost. Expensive queries wait for approval from the person who asked.
  • Query results stay in the conversation, because web search, web fetching, and outbound network access are turned off.
  • Query results, column descriptions, Slack messages, and memory are treated as information to read rather than instructions to follow.

Access control

Each person queries as a Postgres role, so your database permissions decide what they can see. Everyone uses the role named in the ANALYST_DEFAULT_ROLE environment variable, which is analyst_readonly by default. To give a specific person or everyone in a Slack channel their own role, set the ANALYST_ROLE_MAP environment variable to a JSON object of Slack IDs and role names:

ANALYST_ROLE_MAP={"U0456EFGH":"analyst_exec","C0789IJKL":"analyst_finance","U0999ZZZZ":""}

In this example, the person U0456EFGH queries as analyst_exec wherever they ask, everyone in the channel C0789IJKL queries as analyst_finance there, and an empty role turns off access for U0999ZZZZ. Bots, including Slack Workflows, get access once you add them to the map. See Control who can query what for how roles combine and how to set up team roles.

Local development

Use Node.js 24 and pnpm, and install the Vercel CLI. Then clone your repository.

  1. Link the project and pull its development environment variables into .env.local:

    pnpm install
    vercel link
    vercel env pull .env.local

    Choose your deployed project when prompted. This also saves a Vercel OIDC token that lets the agent use AI Gateway locally. It expires after about 12 hours, so rerun vercel env pull .env.local to get a new one.

  2. Add your database connection string and demo data setting to .env.local, since vercel env pull copies non-sensitive values only:

    DATABASE_URL=postgres://user:password@host:5432/database
    ANALYST_SEED_DEMO_DATA=true

    Use the same DATABASE_URL as your Vercel project, or a local Postgres database such as one started with docker run -e POSTGRES_PASSWORD=postgres -p 5432:5432 postgres:17.

  3. Prepare the database the same way a deploy does, and start the agent:

    pnpm db:setup
    pnpm dev

pnpm dev opens eve's interactive chat in your terminal. Ask "What was our MRR last month?" to try the full path from schema lookup to answer. Local sessions answer in plain text, because Slack charts and tables appear in Slack threads. Run pnpm db:doctor to check that the database is set up the way the agent expects.

Before deploying, check your changes and confirm the agent builds:

pnpm validate
pnpm exec eve info
pnpm build

pnpm eval runs automated checks that ask the agent real questions about the demo data, such as last month's MRR. pnpm fix applies formatting and lint fixes. Deploy with vercel deploy --prod, which keeps your .env.local file as it is.

Customization

CustomizeWhere
Metric definitionsagent/skills/metric-definitions.md
SQL conventionsagent/skills/sql-style.md
Answer format, persona, and response styleagent/instructions.md
Schemas, time zone, roles, and limitsEnvironment variables listed in .env.example
What memory savesdescription in agent/memory/
Model and session limitsagent/agent.ts

For more, including team roles, approval thresholds, and connecting Stripe or PostHog, see CUSTOMIZATION.md.

GitHub
Ownervercel-labs
Repositoryeve-data-analyst-template
Use Cases
Starter
AI
Backend
Stack
eve
Database
Postgres

Related Templates

eve Software Factory

Software factory built on eve: AI agents work each stage of the development loop, and people make the judgment calls.
eve Software Factory thumbnail

eve Contentful Agent

Slack-based Contentful assistant built on eve, with Vercel Drives providing a searchable copy of your content.
eve Contentful Agent thumbnail

eve Memory Agent

eve agent with long-term memory powered by Vercel Blob.
eve Memory Agent thumbnail

Related Integrations

Neon

Postgres serverless platform designed to build reliable and scalable apps

Supabase

Open-source Postgres development platform that scales to millions.

Prisma

Instant Serverless Postgres

Nile

PostgreSQL re-engineered for B2B apps

Deploy
LicenseView License