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 is a full-stack demo application that pairs a Mistral-powered AI agent with a Next.js web chat UI. Ask questions like “How did marketing spend trend last quarter?” or “Which department went over budget this month?” — the agent calls the right analytics tool, fetches live data from Postgres, and renders an interactive chart directly in the chat alongside a concise interpretation.

Quickstart

Clone, configure environment variables, seed the database, and run the app in minutes.

Architecture

Understand how the web chat, REST API, and eve agent share a single analytics library.

Analytics Tools

Explore the eight analytics tools — summary, trend, cashflow, anomalies, and more.

API Reference

Browse all Finance REST API endpoints with parameters and response shapes.

What it does

The agent acts as a senior financial analyst for a fictional company. It never invents numbers — every figure in its answers comes directly from a tool call against the database. Responses pair a chart with a short interpretation, giving busy executives the answer first and the supporting data second.

Agent Chat

Web chat UI powered by the eve framework with inline chart rendering.

Chart Rendering

Per-tool Recharts visualizations with a shared palette and light/dark support.

Data Layer

Postgres schema and ~3 years of deterministic synthetic financial data.

Configuration

Environment variables, agent model settings, and Vercel deployment.

Evals

Regression test suite guarding known model failure modes.

Extending

Step-by-step guide to adding a new analytic end-to-end.

Key capabilities

  • Natural-language Q&A — ask any finance question in plain English; the agent selects the right tool automatically
  • Eight analytics tools — summary, trend, category breakdown, cashflow, budget status, anomaly detection, profitability, and data overview
  • Shared analytics library — REST API routes and agent tools call the same finance.ts functions, keeping logic in one place
  • Statistical anomaly detection — flags expense transactions exceeding mean + threshold × stddev within each category
  • Session-aware instructions — today’s date and the live data range are injected fresh each session; no hardcoded dates
  • Eval suite — deterministic regression tests covering category filter correctness, period-comparison direction, and more
1

Clone the repository

git clone https://github.com/astrxnomo/financial-analytics-agent.git
cd financial-analytics-agent
pnpm install
2

Set up environment variables

Create a .env.local file at the project root and add your DATABASE_URL and MISTRAL_API_KEY. This file is gitignored — never commit it.
3

Migrate and seed the database

pnpm db:migrate
pnpm db:seed
4

Start the development server

pnpm dev
Open http://localhost:3000 and start asking financial questions.

Build docs developers (and LLMs) love