DEV Community

Cover image for Rulewright: A Smarter Way to Categorize Transactions with AI
Laxmikanth Janaradhan
Laxmikanth Janaradhan

Posted on

Rulewright: A Smarter Way to Categorize Transactions with AI

Introducing Rulewright: A Smarter Way to Categorize Transactions

The Problem

Managing personal finances often means going through long lists of transactions from banks, UPI apps, and digital payment platforms. Categorizing every transaction manually can be repetitive and time-consuming.

I wanted to explore a simpler approach: what if transaction categorization could combine reusable rules with AI-powered suggestions while keeping the user in control?

That idea led me to build Rulewright.

What Is Rulewright?

Rulewright is a Python and Streamlit-based bookkeeping prototype that helps users categorize transaction records from CSV files.

The goal is to make transaction organization easier while allowing users to review suggestions before exporting their final ledger.

Key Features

1. CSV Transaction Import

Upload a CSV containing transaction descriptions and supported fields to get started. A fictional sample ledger is also available for testing.

2. Offline Categorization Rules

Create reusable merchant-based rules to categorize transactions without sending them to an AI service.

3. Gemini AI Suggestions

Rulewright can request category suggestions from the Google Gemini API. The suggested categories are drafts, not automatically approved financial records.

4. Human Review and Approval

Users can review and edit suggested categories, approve selected transactions, and inspect the final approved ledger before exporting it.

5. CSV and Rules Export

Download categorized transactions, approved records, and reusable rules for further work.

How It Works

The current workflow is straightforward:

  1. Upload a transaction CSV or load the fictional sample ledger.
  2. Define the categories you want to use.
  3. Generate offline rules or request AI suggestions.
  4. Review and edit the proposed categories.
  5. Approve the transactions you want to include.
  6. Download the resulting CSV.

Technology Stack

  • Python — application logic and transaction processing
  • Streamlit — interactive web interface
  • Pandas — CSV loading and tabular data processing
  • Google Gemini API — optional AI-powered category suggestions
  • Pytest — automated tests for core functionality

Privacy and Responsible AI

Financial transaction data can be sensitive. Rulewright includes a warning that transaction descriptions are sent to an external service when Gemini suggestions are requested.

For testing, I recommend using fictional data rather than real bank statements. Offline categorization is available without sending transaction descriptions to Gemini.

AI suggestions should always be reviewed before being treated as final financial records.

What I Learned

Building Rulewright helped me explore CSV processing, reusable categorization rules, API integration, data validation, approval workflows, and automated testing.

It also reinforced an important principle: AI can help make repetitive tasks easier, but users should remain in control of decisions involving their financial data.

Try Rulewright

What's Next?

I plan to improve the dashboard design, make transaction review more intuitive, strengthen CSV handling, and continue testing the application with fictional transaction data.

Rulewright is a prototype, and there is still plenty of room to improve it.

I'd love to hear your feedback: What feature would make a transaction categorization tool more useful to you?

Thanks for reading!

Top comments (1)

Collapse
 
techx_1047cef0fc70e5c78a8 profile image
Techx •

🔥