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.

Financial Analytics Agent is a portfolio-grade, full-stack demo application built for developers who want a concrete example of how to wire an eve agent together with a React chart library. It ships a working AI analyst, a real Postgres-backed data layer, and a polished Next.js chat interface — all in a single deployable project. Whether you want to study the eve + Recharts integration pattern, fork it as a starting point for your own analytics product, or simply run a demo that impresses stakeholders, this is the fastest path from zero to a charting AI agent.

What it does

The agent presents itself as a Northwind Labs senior financial analyst — a fictional persona with a direct, data-first communication style. When a user asks a natural-language question, the agent selects the right tool, queries a seeded Postgres database, and returns both a short written interpretation and a fully rendered chart, all inside the chat window. The project ships eight analytics functions (six exposed as agent tools, one powering the suggested-question chips, one providing a metadata overview):
FunctionWhat it returns
getSummaryTotal income, expense, and net for a date range
getTrendTime-series rows grouped by month and optionally department
getCategoryBreakdownSpend or revenue broken down by category
getCashflowPeriod-over-period cashflow with running net
getBudgetStatusPer-department budget vs. actual with variance
getAnomaliesOutlier transactions that deviate beyond a configurable σ threshold
getHighlightsLive date ranges used to ground suggested questions
getDataOverviewSchema metadata to orient the agent at session start
Charts render inline in the chat using Recharts. Each tool result is passed to a dedicated renderer (trend-chart.tsx, budget-chart.tsx, category-breakdown-chart.tsx, cashflow-chart.tsx, anomaly-list.tsx, summary-tiles.tsx) that degrades gracefully — for example, a single-period trend renders as a bar chart rather than a one-dot line.

Tech stack

LayerTechnology
Web frameworkNext.js 16 (App Router)
Agent frameworkeve ^0.19.0
AI modelMistral mistral-medium-2508 via @ai-sdk/mistral
ChartsRecharts ^3.9.1
DatabasePostgres — Neon via Vercel Marketplace
ValidationZod 4.4.3
DeploymentVercel (single project)
RuntimeNode.js 24.x, pnpm
The eve framework mounts the agent into Next.js through a single withEve() call in next.config.ts, so the agent and the web UI share the same origin with no CORS configuration or base-URL environment variables to manage.

Key design decisions

Shared analytics library. All SQL logic lives once in agent/lib/finance.ts. Both the agent’s authored tools (agent/tools/*) and the Finance REST API route handlers (app/api/finance/*) import from this shared module directly. Adding a new analytic means writing the query once and it surfaces automatically in both the chat agent and the REST API. No HTTP boundary between agent and data. The agent tools call agent/lib/finance.ts directly with process.env access to the Postgres connection string — they never make HTTP requests to the Finance REST API to fetch data. This design means the entire agent works under pnpm exec eve dev --no-ui with no Next.js process running, which simplifies testing and CI verification. Dynamic date injection. The static agent/instructions.md file contains the analyst persona and tool-selection rules but deliberately has no literal dates. A defineDynamic resolver in agent/instructions/dates.ts fires on every session.started event, computes today’s date from new Date(), queries the real data range from getHighlights(), and appends a short date-context block to the instructions. This prevents the common failure mode where a hardcoded “today is …” string goes stale the day after every deploy. Read-only data surface. The demo never mutates finance data from chat, keeping the surface predictable and safe for a public demo. The vercelOidc() + localDev() + none() auth chain on the eve channel keeps the demo open — swap none() for a real auth provider before pointing the agent at non-synthetic data.

Explore the docs

Quickstart

Clone the repo, seed the database, and have the chat UI running in under 10 minutes.

Architecture

Understand the three-in-one design: web chat, REST API, and agent at the same origin.

Analytics Tools

Explore all eight analytics functions, their inputs, and the charts they produce.

API Reference

Read-only Finance REST API endpoints for direct integration.

Build docs developers (and LLMs) love