GL Categorization Engine

A proof-of-work built for Minerva — the YC-backed startup automating accounting for small businesses. The core problem: accountants spend hours manually mapping raw bank transactions to General Ledger codes. This app does that with AI — and puts the accountant in control of every decision the model makes.

Built by

RI

About Minerva

Minerva was founded by Peter Zhu and Om Agarwal, backed by Y Combinator. They're building AI for the painful parts of finance — automating the workflows that traditional accounting firms run manually today.

The mission: bring AI-powered automation into accounting firms they partner with and acquire, reducing the time accountants spend on low-judgment work so they can focus on what actually requires expertise.

View on YC

How It Works

1

Upload

Accountant uploads any bank export — CSV, XLSX, or XLS.

2

Schema Detection

Heuristics map column headers first; falls back to Gemini 2.5 Flash for non-standard formats. Zero API cost on most uploads.

3

Normalize

Dates, amounts, and missing fields are repaired before categorization.

4

RAG Retrieval

Each transaction is embedded and matched against the GL knowledge base via pgvector cosine similarity (top-3 chunks per transaction).

5

Categorize

Batches of 20 transactions + retrieved context are sent to GPT-4o in a single prompt. Returns category, confidence, and reasoning for each.

6

Review

Accountant approves, overrides, or skips. Every action is audit-logged immutably.

Tech Stack

FrontendNext.js 15 · TypeScript · Tailwind CSS
BackendNext.js API Routes · Node.js · Prisma ORM
DatabasePostgreSQL + pgvector extension
AI / LLMOpenRouter → GPT-4o (categorization) · Gemini 2.5 Flash (schema detection)
EmbeddingsOpenAI text-embedding-3-small · 1536-dim vectors
Vector Searchpgvector cosine similarity (raw SQL, <=> operator)
File ParsingSheetJS — CSV, XLSX, XLS

Data Model

Transaction

Core record with date, vendor, amount, AI category, confidence, reasoning, and status (PENDING / APPROVED / OVERRIDDEN).

Upload

Tracks each imported file — filename, transaction count, and processing status. Transactions FK to their upload.

AuditLog

Immutable log of every approve and override action, with old and new category values.

KnowledgeChunk

GL accounting knowledge stored as 1536-dim embeddings (pgvector). Queried via cosine similarity at categorization time.

Client

Represents an accounting client. Transactions are scoped per client for multi-firm support.

Built with Next.js · Prisma · PostgreSQL · OpenRouter · pgvector