Skip to content

A practical real-world example of categorizing transactions with AI using Ruby

sahmed007/ruby-categorize-transactions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Categorizing Transactions with RubyLLM

A practical real-world example of automatically categorizing and enriching financial transactions using AI with RubyLLM.

This repository contains a real world example of how to use RubyLLM to process transactions, categorize them by viewing their descriptions, look up the GL code for each category using a tool, and export the results to a CSV file.

Installation

Clone the repo and run bundle install to install dependencies.

bundle install

Usage

These examples use OpenRouter API for LLM calls. You will need to set up an OpenRouter API key by creating a .env file using the .env.example as a template.

If you would like to use a different LLM provider, you can modify the configuration in the main.rb file to use a different LLM provider along with the model of your choice as well. In this example, the openai/gpt-4.1-mini model is used.

The LLM calls are made using the RubyLLM gem. To see the complete list of models, you can go here.

Simply run with ruby main.rb to see the results.

Contributing

Pull requests are always welcome.

License

MIT

About

A practical real-world example of categorizing transactions with AI using Ruby

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages