Kasikornbank Amorn Apichattanakul

Kasikornbank's Responsive Natural-Language Transaction Search in Flutter with Local RAG

Original post Responsive Natural-Language Transaction Search in Flutter with Local RAG

Article Summary

Amorn Apichattanakul from KBTG built a natural-language transaction search engine that runs entirely on-device in Flutter. His surprising finding: the 2.59 GB on-device LLM was slower and less accurate than simple Dart rules.

Most RAG tutorials focus on cloud-based LLMs, but Amorn wanted to know what RAG could actually do inside a mobile app. He built a Flutter demo with 5,500 synthetic transactions, testing both traditional search algorithms (BM25, vector embeddings, HNSW) and an optional on-device Gemma 4 E2B model to see where each approach wins.

Key Takeaways

Critical Insight

On-device RAG works brilliantly for mobile search when you use deterministic code for filtering and save the LLM exclusively for multimodal tasks like image-to-text conversion.

Continue reading

What This Article Covers

Problem

Amorn found that Google's on-device ML Kit entity extractor misread the shop name "7-11" as July 2011, and it missed fractional amounts like "3,000.50 baht" entirely.

Solution

He wrote deterministic Dart rules that claim sentence spans in strict order: shops, people, memos, amounts, then dates. ML Kit gets demoted to a fallback for whatever text is left over.

Impact

Disabling ML Kit completely (NoEntitySource) still scored 31 out of 31 on query plans. The pure Dart rules ran in under 1 millisecond.

The article includes detailed performance breakdowns and explains exactly why running RAG before SQL loses valid results, plus the GitHub repo to try it yourself.

This page summarizes “Responsive Natural-Language Transaction Search in Flutter with Local RAG” by Kasikornbank, published Nov 2, 2026. All credit for the original work goes to the authors.

Read the original on medium.com (opens in new tab)

AI tools for Flutter

Browse all AI tools →