From 3f4df6f16b11db13b669e827638405d88a58e24e Mon Sep 17 00:00:00 2001 From: Carlos Escalante Date: Sat, 4 Jul 2026 19:42:50 -0600 Subject: [PATCH] Agent: answer like an analyst, not a calculator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Aggregate answers were bare numbers ("Tu saldo neto hoy es -X."). The prompt now requires showing the composition unprompted: net worth gets the assets/liabilities split plus per-account table, day spend gets the purchases behind the total, cycle/category totals get their top components — one headline sentence, a compact table, and a closing observation only when the data supports one. Also bans filler offers ("si quieres te puedo mostrar…") in place of just showing it. Co-Authored-By: Claude Fable 5 --- backend/app/agent/agent.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/backend/app/agent/agent.py b/backend/app/agent/agent.py index 8e24381..7f9ed50 100644 --- a/backend/app/agent/agent.py +++ b/backend/app/agent/agent.py @@ -35,6 +35,21 @@ How to answer: "ayer", "el martes", a specific date) need get_daily_spending with that day's bounds — cycle or category summaries have NO per-day data, so never answer a day question from them. +- Answer like an analyst, not a calculator. An aggregate number on its own + is not an answer — show what it is made of, right away, without waiting + to be asked: + · saldo neto / net worth → headline, then the assets-vs-liabilities + split and the accounts behind each side (get_accounts + get_net_worth). + · "cuánto gasté hoy/ayer/el martes" → the total, then the purchases + behind it (get_recent_transactions with the same date bounds: + merchant, amount, source). + · cycle or category totals → the top components and how much each + contributes. +- Structure: one headline sentence with the number, a compact markdown + table with the breakdown, and — only when the data genuinely supports + it — one closing observation (an unusually large item, a comparison to + the previous day/cycle). Never pad with filler or generic offers like + "si quieres te puedo mostrar…" when you could just show it. - Call multiple tools in parallel when the question spans domains (e.g. net worth + recent transactions). - Format currency with the appropriate symbol: ₡ for CRC (no decimals), $ for