Using Tally with AI assistants
Tally is a rule engine that classifies transactions. The AI assistant is the operator that writes the rules. Together they create a feedback loop:
Any AI agent that can run command-line tools will work with Tally.
After setting up your budget folder, open it in your AI assistant and tell it what to do:
The agent will run tally workflow to understand the current state and follow the instructions.
The tally workflow command is context-aware. It detects your setup state and shows relevant next steps:
tally workflow
No data sources configured yet.
To add a data source:
1. Run: tally inspect data/yourfile.csv
2. Add the suggested config to settings.yaml
tally workflow
Found 47 unknown merchants.
Run: tally discover --format json
Then add rules to config/merchants.rules
tally workflow
All transactions categorized!
Run: tally up
tally discover --format json
Returns uncategorized transactions with suggested patterns. The AI uses this to write rules.
tally inspect data/chase.csv
Analyzes CSV structure with column type detection (dates, currency, numbers, categorical). Shows samples for both positive and negative amounts to help understand sign conventions.
tally explain Netflix -vv
Shows why a merchant is classified a certain way, including which rule matched. Supports combined filters:
tally explain --category Food --month Jan
tally explain --tags business --month 2025-01
tally diag --format json
Validates configuration and shows any errors.
tally up --format json -v
Returns complete analysis with classification reasoning.
When the AI finds unknown transactions, it adds rules to config/merchants.rules:
[Netflix]
match: contains("NETFLIX")
category: Subscriptions
subcategory: Streaming
tags: entertainment, recurring
[Whole Foods]
match: contains("WHOLEFDS") or contains("WHOLE FOODS")
category: Food
subcategory: Grocery
See the Reference for full syntax.
Transforms are top-level assignments in merchants.rules whose left side starts with field.. You can optionally include an @transforms line as a human-readable separator, but it isn't required by the parser.
Example: add a fee column to the transaction amount.
@transforms
# Strip $/commas from fee, then add to amount
field.amount = field.amount + regex_replace(regex_replace(field.fee, "\\$", ""), ",", "")
# Clean descriptions
field.description = regex_replace(field.description, "^APLPAY\\s+", "")
Tell the AI your preferences: "Coffee shops should be Food > Coffee, not Food > Restaurant" or "Tag all Uber rides as business, reimbursable".
Tally doesn't have predefined categories. You define them in your rules:
Tell the AI your preferred structure and it will use it consistently.
Once transactions are categorized:
tally up
This generates an HTML report with:
As you review the report, you might want changes:
The AI updates the rules, and you can regenerate the report.