Skip to content
Back to the surface

Banking assistant

A local banking assistant that calls a language model only when it has to.

76 %
answered without an LLM
17×
less energy
0.5 s
p95 latency
Role
Team of 3 · hackathon
Stack
PythonFastAPIOllamaRAG & embeddings
Banking assistant

The problem

A client writes to their bank: “I want to buy a flat.” “I lost my card last night, what do I do?” “Why did I pay €8 in fees this month?” The assistant has to understand, ask the right questions, take the client's situation into account and suggest a way forward. Having a large language model answer every message would be simple, but also costly, slow and impossible to guarantee: nothing would stop it from inventing a rate or a limit.

The idea: the bike for the bread, the car for the weekend

For every message, a router picks the smallest tool that is enough. It is plain code, with no language model. Most requests are settled by rules in a few milliseconds; the small model only steps in when it is really needed. The decision is made at every message: one conversation moves from level 1 to level 2, then back to level 0, with one shared memory.

The real interface, recorded on a laptop without a GPU (the model's wait is shortened). Each reply shows its level and its cost.
  • Level 0 · RulesNo language model: keywords or a classifier, 9 YAML journeys, public banking rules, written templates.
  • Level 1 · UnderstandA small model reads a fuzzy message with 8 close examples and returns JSON checked by code. It never talks to the client.
  • Level 2 · AnswerAn open question: search in 37 sourced sheets, a cited answer under a guard, or else the sheet's own excerpt.

Follow Inès's conversation

Six real messages from the demo. At each one, the router picks a level.

  1. J'ai perdu ma carte et je veux faire un virement.I lost my card and I want to make a transfer.

    Level 0 · Rules

    Two requests detected: the emergency first, then the transfer.

  2. ouiyes

    Level 1 · Understand

    Not an answer the rules can read: the small model understands it, and the question is asked again with examples.

  3. c'est pour mon papait's for my dad

    Level 0 · Rules

    The rules read “papa” and keep the beneficiary.

  4. Je peux retirer de mon PEL avant 4 ans ?Can I withdraw from my PEL (home savings plan) before 4 years?

    Level 2 · Answer

    An answer cited from the sheets, then “Back to your transfer”.

  5. 100000000

    Level 0 · Rules

    An implausible amount: an alert, with the client's balance.

  6. mais ma carte ?but what about my card?

    Level 1 · Understand

    A reference to the context: linked back to the lost card already handled.

How it works

Five signals for the router, computed without a language model

  • Several requests in one message: handled by urgency.
  • Confidence below the classifier's threshold (τ = 0.76): it never guesses.
  • A free answer the rules cannot read.
  • A reference to the context: “but what about my card?”, “and for my son?”.
  • An open question on a topic covered by the sheets: “why?”, “can I…?”.
The router: a shared entry without a language model, then levels 0, 1 and 2 (from the project's README, in French).
The router: a shared entry without a language model, then levels 0, 1 and 2 (from the project's README, in French).

Three guarantees against invention

  • JSON forced by a grammarAt level 1 the inference server can only produce JSON that fits the schema, with topics from a closed list. Measured: 100 % valid JSON.
  • Two RAGs, two rolesThe examples RAG helps the small model classify by analogy (it doubles its accuracy); the sheets RAG gives it the material of its answer, and nothing else.
  • A guard checked by codeEvery number must come from the sheets, and 80 % of the words too. Otherwise the draft is set aside and the client gets the sheet's excerpt.

Measured results

Energy for 1,000 messages

ConfigurationWh per 1,000 messagesp95 latencyMemoryWithout a model
A 14-billion-parameter model answers everything194.32.3 s9.1 GB0 %
Our router (qwen3 1.7B)11.50.53 s1.9 GB76 %
Level 0 alone0.419 ms0.5 GB100 %

Measured with CodeCarbon on an RTX 6000 Ada, on the scenario bench; raw values, the least favourable. That is 17 times less energy.

Understanding

ConfigurationEnglish (77 intents)French (250 unseen sentences)
Keywords alone—19.2 % accepted, 100 % right
e5-small + logistic regression92.3 %84.8 %
Keywords, then e5-small above τ—76.4 % understood, 96.9 % right
The small model (qwen3 1.7B) classifying alone6.8 % (family)29.2 %

Trained in English, understood in French: the multilingual encoder puts a sentence and its translation in the same place. A small model alone cannot classify, which is why it is only called with examples, a grammar and a check by code.

Limits, measured rather than hidden

  • Unexpected conversations are still fragile: if the client changes subject, the assistant can ask its pending question again.
  • The 76 % comes from the scenario bench; on deliberately hard conversations, about one reply in two stays at level 0.
  • The benches are small and written by the team: 36 and 22 messages for the levels, 250 sentences for French.
  • Everything is simulated: profiles, histories, the banking system. Rates are statistical markers, not offers.
  • The CO₂ per reply is an estimate, not a live measurement.

The team

Built in five days at the La Banque Postale × CGI × ENSEIRB-MATMECA AI hackathon, 26 to 30 October 2026, as a team of three.

  • Yahya Bel HajjamRouter, conversation, interface: the architecture, levels 1 and 2, the dialogue state machine, the level benches, the interface.
  • Sohayb El YaktiniThe advisor: profiles, the sourced catalogue, banking rules, reference scenarios.
  • Younes BamoussUnderstanding and measuring: keywords, entities, the classifier, the understanding and energy benches.