Skip to content

fix(financial_services): support banks beyond English and US conventions - #63

Merged
3mei merged 5 commits into
mainfrom
yev/fix/finance-locale-support
Oct 19, 2026
Merged

3mei merged 5 commits into
mainfrom
yev/fix/finance-locale-support

Conversation

@3mei

@3mei 3mei commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

What changed and why

Banks for other locales are next for financial_services, and parts of its code assumed English text and US conventions: accented words retrieved poorly, amounts failed asset validation, and every customer heard a dollar balance and a US-format date of birth.

  • Lexical retrieval matches whole words in any script. Words are runs of letters, combining marks and decimal digits, compared after case folding and NFC normalization, so épargne, Überweisung and Straße match as written. English banks rank exactly as before.
  • validate-assets reads numbers in the bank's own format. A decimal-comma region accepts 1 234,56 (any space) or 1.234,56, and doesn't read 1,234 as 1234. English formats are unchanged.
  • Prompts and tools use the region's conventions. The customer's balance is in the region's currency and number format ($1,234.50, ₹1,23,456.00, 1 234,50 €), and dates of birth follow the region (month/day/year in the US, day.month.year in Germany, day/month/year elsewhere). The kb_search example no longer names a US retirement product, and open_account no longer writes a key named after a US brand. PROMPT_VERSION moves to v1.2.
  • The CLI defaults to hybrid retrieval, matching the engine and the docs; dense and golden remain as ablations.
  • Queries are embedded only for banks with document vectors. Packaged banks ship none, so each search paid for an embedding call whose result went unused.

How it was verified

  • make check-all: lint clean, 333 files already formatted.
  • make test: 4100 passed, 2 failed. The two failures are in tests/test_replay_reasoning_config.py, which read a models.local.toml when the checkout has one; they pass without it.
  • make smoke, make check-license-headers, make check-doc-links, make check-notebooks-clean and make check-dist pass.
  • New tests cover Unicode tokens and ranking, French and German number formats (also through validate_bank), regional money and dates in prompts, the account key, the kb_search example, the CLI default and query embedding. Each fails without its change, and each commit passes on its own.
  • Lexical rankings for the English banks are unchanged: the same top 8 for every task opening (210 in en_US, 180 in en_IN).
  • make health-check against a custom provider config, financial_services in en_IN: simulate, eval and report all completed.
  • Scorer check, en_IN with --scorers financial_services: the judge scored, the scorer returned ok, and the customer quoted a rupee balance and a day/month/year date of birth.

Results impact

financial_services conversations change, and PROMPT_VERSION v1.2 changes their trajectory ids. en_US: dates of birth unchanged, balances gain thousands separators. en_IN and the India variants: balances in rupees with Indian digit grouping, dates of birth day/month/year. All locales: the second example in the kb_search description changed. Retrieval for the English banks is unchanged.

3mei added 5 commits October 17, 2026 12:38
…l retrieval

Words are runs of letters, combining marks and decimal digits, compared after case folding and NFC normalization, so accented French and German words and ß match whole. English banks tokenize exactly as before.

Signed-off-by: Yev Meyer <ymeyer@nvidia.com>
A region whose number format writes a decimal comma accepts its own renderings, 1 234,56 with any space or 1.234,56, and no longer reads 1,234 as 1234. English formats are unchanged.

Signed-off-by: Yev Meyer <ymeyer@nvidia.com>
…p US-specific names

The customer hears its balance in the region's currency and number format, and gives a date of birth in th region's date format. The kb_search example no longer names a US retirement product, open_account records a generic key, and PROMPT_VERSION moves to v1.2.

Signed-off-by: Yev Meyer <ymeyer@nvidia.com>
The CLI offered only golden and dense, defaulting to dense, while the engine and its docs default to hybrid.

Signed-off-by: Yev Meyer <ymeyer@nvidia.com>
… document vectors

Packaged banks ship no document vectors, so each search paid for an embedding call whose result went unused.

Signed-off-by: Yev Meyer <ymeyer@nvidia.com>
@3mei
3mei requested a review from a team as a code owner October 17, 2026 16:40
@3mei
3mei merged commit 53d57d3 into main Oct 19, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant