Automating background analytics in fintech with a background LLM agent: real-world experience

Maxim Shalankin23 Dec 2025

Problem

Fintech analysts keep repeating one task: compare groups of new customers, such as those who became active and those who stayed passive, and find the behavior or profile features behind the gap. Each pass means hypotheses, SQL, data pulls, hand-made statistics and charts. It takes hours or days and covers few cuts. Giving this to an LLM is risky, because an invented or changed number is unacceptable in finance.

Example from the article: the task "Compare cohort_jan and cohort_feb (active vs passive), find the key differences" produces an HTML report with the patterns found.

Solution in brief

A scheduled background agent turns a text task into a run of ready skills. A skill is a YAML-described scenario that chains Python statistical tools. The LLM only words the interpretation: it sees validated structured results, answers in a strict JSON schema, and the pipeline checks every number and feature name against the tool output.

Questions this case answers
  • How to automate repetitive group-comparison analysis with an LLM agent whose numbers must come only from verified statistical computations
  • How to compose statistical tools into reusable scenarios that an LLM agent can pick and fill with parameters instead of inventing a pipeline each time
  • How to automate routine cohort comparison (active vs passive new customers) with an LLM agent
  • How to keep an LLM analytics agent from inventing or altering numbers in its report

Tools and methods

  • Agent skills — YAML scenarios that fix which tools run, in what order and with which parameters
  • Tool calling — Python classes with run() returning a Pydantic ToolOutput
  • Structured output — strict JSON schemas for every LLM answer block
  • Chi-square, Point-Biserial correlation, Random Forest importance, IQR / Z-score — the statistics behind the cohort comparison
  • Guardrails — grounding prompt plus a number and name check against tool output
  • LLM observability — validation, cost and fallback metrics
Continue reading — it's free

Google or a one-time email code. No password.