beancount/smart_importer

Augment Beancount importers with machine learning functionality.

What it solves

It reduces the manual effort required to categorize bank transactions when importing them into Beancount. Instead of manually assigning accounts or payees to every new transaction, the tool predicts these attributes based on historical data.

How it works

The project uses a classification model implemented with scikit-learn (specifically a Support Vector Machine or SVC). It treats existing transactions in the user's Beancount ledger as training data, which is processed on-the-fly during the import process. When new transactions are imported, the model analyzes the input and predicts the missing second posting (the account) or the payee name. Users can further improve accuracy by correcting predictions and saving them to their ledger, which then serves as updated training data for future imports.

Who it’s for

Users of Beancount and Beangulp who want to automate the categorization of their financial imports using their own historical transaction data.

Highlights

  • Local Processing: All AI processing happens locally on the machine; no data is sent to the cloud.
  • Integration: Works as a hook or wrapper for existing Beangulp importers and integrates with Fava.
  • Customizable Tokenization: Supports custom tokenizers (e.g., jieba for Chinese) to handle different languages.
  • Feedback Loop: Accuracy improves over time as users correct and save transactions to their ledger.

Related

  • Project
  • Project
  • Dispatch
  • Project
  • Dispatch