jandresgarcia.dev
Rev. 2026.09

How Clara works: an AI agent with typed tools, a deterministic finance engine that owns every number, a figure validator and three model tiers under a spend cap.

AN-02

Clara A personal finance agent where the model never does the math.

In daily use · private app

Video 1. Clara, product overview · 1:20

Zero guessed numbers

A deterministic validator blocks any number the model did not get from a tool.

0

Numbers guessed by the model. A deterministic validator blocks any figure that did not come from a tool.

How it works

  1. Question
  2. Answer

Engineering notes

  • The LLM explains and compares. A deterministic engine owns every balance, projection and score.
  • Three model tiers picked by a deterministic router, with per-role fallback and a daily spend cap.
  • A live eval with real models (60 cases) caught failures the hermetic suite missed; fixed with server-side guards.

AI agentTool callingMulti-model routingLive evals

Next.js PWA · Fastify · SQLite · Drizzle · Zod · 3 model tiers · Docker on ARM64

How a run works

  1. You ask: how much can I still spend until the end of the month?
  2. The API checks the session and passes the message on.
  3. A deterministic router classifies it: this is chat, so it goes to the strong model.
  4. The AI agent starts a tool loop. The call is logged against the daily spend cap.
  5. It calls a calculation tool instead of doing the math itself.
  6. The finance engine computes the exact number from real data.
  7. Before anything is shown, every figure in the answer is checked against the tool results. Unverified numbers are blocked.
  8. You get the answer, with a link to see how it was calculated.

System components

ComponentWhat it does
PWAInstallable · passkeysDeterministic codeA static Next.js export served by the API, installed on the phone and unlocked with Face ID.
iOS ShortcutsAutomatic purchase ingestDeterministic codeCard payments arrive through Shortcuts to an ingest-only endpoint with its own token.
APIFastify · one containerDeterministic codeOne Docker image on an ARM64 server, reachable only inside a private tailnet.
Scheduler06:30 agent tick · FX feedDeterministic codeA daily agent tick planned by the server, the exchange rate every 30 minutes, backups and a weekly digest.
Intent routerPicks a tier, no LLMDeterministic codeDeterministic rules decide which model tier handles each request. A purchase over 25% of monthly income escalates.
AI agentTool loop · cappedAI model callUnderstands the request and explains the result. Works through tools in a loop with an iteration cap; writes come with undo.
ToolsRead · calculate · actDeterministic codeTyped tools for reading data, running simulations and taking actions. The model never touches the database directly.
Finance engineOwns every numberDeterministic codeBalances, projections, budgets and the health score, computed in integer minor units. No model does arithmetic.
Figure validatorBlocks unverified numbersDeterministic codeAny figure in the answer that does not exist in a tool result is blocked before it reaches the screen.
Model tiersFast · Strong · FrontierAI model callRoutine work goes to a fast model, chat to a strong one, monthly reviews and big decisions to a frontier model. Each role has a fallback provider.
Spend guardEvery call logged · daily capDeterministic codeEvery call is logged with its cost. A per-run guard and a daily cap switch the AI off on their own, with an alert at 70%.
Evals60 live cases · CI gateDeterministic codeA hermetic suite plus a live eval against real models. The first live run scored 31/60 while the hermetic one passed; server-side guards closed the gap.
SQLiteWAL · nightly backupsDataThe single source of truth, with WAL checkpoints every 15 minutes and a backup every night.
Exchange ratedatos.gov.coDataThe official COP/USD rate feeds income projections in both currencies.
Semantic memoryLong-term recallPlannedNext: a semantic memory layer so the agent can recall past decisions. Planned, not built yet.

Availability

Open to senior AI Engineer and Fullstack roles, and to AI product builds for founders.