Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/astrxnomo/financial-analytics-agent/llms.txt

Use this file to discover all available pages before exploring further.

The Financial Analytics Agent ships as a single Vercel project — the Next.js web chat UI, the finance REST API, and the eve agent are all served from the same origin, so there are no cross-origin concerns and no per-service base URL variables to manage. The database is a Neon Postgres instance provisioned through the Vercel Marketplace, which automatically injects DATABASE_URL into the project’s environment. After linking the project and provisioning the database, you run migrations and the seed script once, then deploy.

Prerequisites

Before starting, make sure you have:
  • A Vercel account with the project repository imported
  • The Vercel CLI installed and authenticated (vercel login)
  • A Neon Postgres database provisioned via the Vercel Marketplace under your project’s Storage tab — this makes DATABASE_URL available automatically

Deployment steps

1

Link the project

From the repository root, link your local working copy to the Vercel project:
vercel link
Follow the prompts to select your team and project. This writes a .vercel/project.json file that subsequent CLI commands use to identify the project.
2

Pull environment variables

Fetch the production environment variables (including the Neon DATABASE_URL) into a local .env.local file:
vercel env pull .env.local
The pulled file is used by the migration and seed scripts in the next steps. Make sure MISTRAL_API_KEY is also present — either add it to the Vercel dashboard before pulling, or append it to .env.local manually.
3

Run database migration

Apply the schema defined in db/schema.sql to your Neon database:
pnpm db:migrate
This creates the departments, categories, transactions, and budgets tables. The script reads DATABASE_URL from .env.local and is safe to re-run — it applies only the pending changes.
4

Seed the database

Populate the database with approximately three years of deterministic synthetic financial data:
pnpm db:seed
The seed uses a fixed RNG seed (mulberry32 in agent/lib/rng.ts), so re-running it produces exactly the same dataset. The data is deliberately authored with specific patterns — revenue seasonality, subscription compounding, campaign spend spikes, and infrastructure incidents — so every chart type has something meaningful to display.
The seed script only needs to run once. Rerunning it truncates and regenerates the synthetic data, which is fine for a demo but would reset the dataset in production.
5

Deploy to production

Build and deploy the project:
vercel deploy --prod
This triggers both the Next.js build (pnpm build) and the eve manifest build (pnpm build:eve), then promotes the result to the production URL.

Build commands

The package.json defines two production build targets:
ScriptCommandPurpose
buildnext buildCompiles the Next.js application — web chat UI, API routes, and static assets
build:eveeve buildCompiles the eve agent manifest — agent definition, tools, instructions, and channel config
Both run as part of a standard Vercel deployment. The eve manifest is what makes the agent’s session.started dynamic instructions fire at runtime rather than being frozen at build time.

Vercel configuration

The vercel.json at the project root currently contains only the schema reference:
vercel.json
{
  "$schema": "https://openapi.vercel.sh/vercel.json"
}
Build commands, output directory, and install command are all inferred from the package.json and framework detection. The withEve() wrapper in next.config.ts handles mounting the eve agent at /eve/v1/* inside the Next.js app — no additional Vercel rewrites are needed. The .vercelignore file excludes directories that should not be uploaded to Vercel’s build environment:
node_modules
.env*
.eve
.workflow-data
.next
.output
.nitro
dist

Environment variables in production

VariableSourceAction required
DATABASE_URLNeon Marketplace integrationSet automatically when Neon is provisioned via the Vercel Storage tab
MISTRAL_API_KEYManualAdd in Project → Settings → Environment Variables in the Vercel dashboard

Node.js version

The package.json declares:
{
  "engines": {
    "node": "24.x"
  }
}
Vercel reads this field during build setup and selects the matching Node.js runtime. If you change the Node version, update this field to match — mismatches between the development environment and the Vercel runtime are a common source of subtle build failures.

Running migrations in production

For schema updates after the initial deploy, use vercel exec to run the migration script in the production environment without a local DATABASE_URL:
vercel exec -- pnpm db:migrate
This executes the command inside Vercel’s production environment with access to all production environment variables, including the Neon connection string. You do not need to pull .env.local first when using this approach.

Build docs developers (and LLMs) love