Skip to main content
Commercient logo with a blue circular icon and blue wordmark.

How We Built an AI System That Cut Our Monthly Accounting Work by 80%

This article will cover:

-The tool cut monthly transaction processing from 8–12 hours to about 2 hours by combining pattern matching, GPT-4o classification, and human overrides.
-A three-tier categorization engine (facts database, LLM, manual correction) means 85%+ of transactions now categorize instantly without any AI calls.
-Every categorization is tagged by source ([FACTS], [AI], [MANUAL]), and a "save facts" learning loop turns approved AI decisions into permanent patterns for future months.
-Built on LangChain's ReAct agent pattern, the system lets users extract, categorize, review, and export data entirely through natural conversation.
-Beyond time savings, the bigger win is consistency: institutional knowledge is now explicit in a facts.json file instead of living only in employees' heads.

 

An internal tool that learns vendor patterns, categorizes transactions, and generates ready-to-import Excel summaries—all through natural conversation.


The Problem

Every month, our accounting team faced the same grind: dozens of credit card statements from Amex, Stripe, and various PDF sources, each containing hundreds of transactions that needed manual GL code assignment and allocation across three internal companies.

The process took 8–12 hours monthly. It required deep institutional knowledge, produced inconsistent results between different team members, and delayed month-end close.

We tried using off-the-shelf LLM platforms to speed things up, but the results were spotty—inconsistent categorizations, no memory of past decisions, and enough manual correction that it barely saved time over doing it by hand.

We built a system to fix this.


What It Does

The tool converts unstructured credit card statements into categorized, allocated, export-ready data. Upload a file, have a conversation, download a professional Excel summary.

The core workflow:

  1. Extract — Parse Excel or PDF into standardized transaction records
  2. Categorize — Match vendors to GL codes using saved patterns or AI
  3. Aggregate — Collect totals by category, apply credits to offset their respective categories, and format distribution across a set number of entities
  4. Export — Generate formatted Excel with company columns and totals


The Categorization Engine

This is where the real value lives. The system uses a three-tier approach that gets smarter over time.

Tier 1: Pattern Matching (Instant)

A JSON-based “facts” database stores known vendor→GL mappings. When a transaction comes in, the system checks if the vendor matches any saved pattern. Case-insensitive substring matching, zero API cost, instant results.

After several months of use, 85%+ of transactions categorize without any AI calls.

Tier 2: LLM Classification (GPT-4o)

Unknown vendors go to GPT-4o, which analyzes vendor name and description, selects from 32 supported GL codes, and handles ambiguous merchants (Square payments, Google*, PayPal). Accuracy sits around 90% on first attempt.

Tier 3: Human Override

Users can correct any categorization through natural language:

“Change NETFLIX to Entertainment”

Every categorization is tagged with its source—[FACTS], [AI], or [MANUAL]—so reviewers always know how a decision was made.


The Learning Loop

The system improves with use. Here’s how institutional knowledge gets captured:

  1. AI categorizes a new vendor
  2. Staff reviews and approves (or corrects)
  3. User says “save facts”
  4. Pattern saved to database
  5. Next month → instant categorization

This creates a flywheel: the more you use it, the less AI you need.


Architecture

Built on LangChain’s ReAct agent pattern, the system dynamically decides which tools to use based on conversation context.

The agent has access to these tools:

Tool Purpose
extract_transactions Parse Excel/PDF into transaction objects
categorize_transactions Apply facts + AI to assign GL codes
show_vendor_categories Display categorized vendors with sources
save_facts Persist approved patterns
generate_summary Create formatted Excel export

Users interact through natural language. The agent figures out which tools to call and in what order.


The Output

The final Excel summary includes:

  • Entity split columns — Configurable company distribution with calculated amounts
  • All GL codes listed — Even unused ones show “–” for consistency
  • Color formatting — Yellow totals, blue amounts, gray headers
  • Optional detail sheet — Full transaction list with dates, vendors, amounts


Results

Metric Before After
Monthly processing time 8–12 hours ~2 hours
Categorization consistency Variable Standardized
Knowledge retention In people’s heads Explicit in facts.json
Month-end delay Common Eliminated

The 80% time reduction is real. But the bigger win is consistency—every transaction follows the same logic, and that logic is visible and correctable.


Example Session

Here’s what a typical workflow looks like:

Total time: 5 minutes.


Takeaway

This project demonstrates something important about practical AI tooling: the goal isn’t to replace human judgment, it’s to accelerate the work that our employees can do while cutting out the monotony.

When the tedious parts disappear, people can focus on the work that actually requires their expertise. That’s not just automation—that’s leverage.


Built with Python, Flask, LangChain/LangGraph, and GPT-4o. Internal tool—not publicly available.

Share Article
Recent Articles
Commercient logo with a blue circular icon and blue wordmark.
Commercient is an AI-first software company based in Atlanta, that connects ERP, CRM, eCommerce, and related systems through its cloud-hosted integration platform, with reusable templates and AI-assisted tools.
Solutions
By Team
By Industry
HubSpot Services
Resources
Company
User Reviews
© 2026 Commercient. All rights reserved.
Commercient AI