❌

Reading view

Why we don't let LLMs do math: Architecture breakdown of Ting AI (risk engine for retail investors)

Hey guys,

One of the biggest issues with the current wave of "AI financial assistants" is hallucination. An LLM might sound authoritative while completely mangling basic portfolio math, drawdown calculations, or Sharpe ratios.

While building Ting AI (an AI thinking partner for retail equity investors), we took a strict architectural stance:

  1. Deterministic Layer in TypeScript & PostgreSQL:
    All position weights, cash buffer ratios, and concentration risks are calculated deterministically first. The numbers are treated as immutable ground truth.
  2. Qualitative Synthesis in Gemini Pro:
    We only pass the verified metrics into Gemini Pro with strict JSON Schema enforcement to evaluate macro context, thesis weaknesses, and qualitative risks before the market opens.
  3. Edge Streaming:
    Multi-ticker risk decomposition streams under ~1.4s p95 via edge pipelines.

I documented the full system topology, engineering decisions, and live metrics in my interactive portfolio here:
https://faturachman.my.id (check the Ting AI case study drawer).

Curious to hear how other teams here are handling the boundary between deterministic code and generative outputs in production apps!

submitted by /u/faturachman_alkahfi to r/reactjs
[link] [comments]
  •  
❌