22
33 Comments

I built an AI analyst. It confidently gave wrong answers for 3 versions straight. Here's the ugly truth and how I fixed it.

The product

KashifData - upload any CSV/Excel/JSON, get a full analyst report in 15 seconds. KPIs, root causes, forecast, ranked action plan, shareable PDF. Built for marketing agencies who spend 4 hours every Monday building client reports manually.

Running on free tiers of DeepSeek, Groq, Llama. $0 revenue. Shipping anyway.


The mistake that almost made it dangerous

I was sending raw CSV rows to the LLM and asking it to compute the analysis.

It looked like it was working. The reports looked professional. The numbers looked real.

They weren't.

Real data said Email ROAS = 42.26x. The AI reported 2.63x.

Real worst channel = Google Display at 0.63x. The AI blamed Meta Ads.

Real recommendation = pull from Display. AI said pull from Meta.

An agency following that advice would have hurt their client. That's not a product. That's a liability.


The fix (one line that changed everything)

LLMs cannot do math on hundreds of rows. They hallucinate plausible numbers with full confidence.

Stop asking them to calculate. Pre-compute everything in pandas first.

df.groupby('Channel')['ROAS'].mean()

df.groupby('Channel').apply(lambda g: g['Revenue_USD'].sum() / g['Spend_USD'].sum())

Averaging per-row ratios vs computing from summed totals. Completely different results. The LLM now gets a clean JSON of facts. It writes narrative. Zero math.


After the fix — same dataset, same question

→ Email 42.26x ROAS → $866K revenue → flagged as underinvested hero ✅

→ Google Display 0.63x → $147,797 annual loss → flagged immediately ✅

→ "Shift $50K from Display to Email → projected $100K revenue gain" ✅

Live report (no signup): https://kashifdata.online/report/bl6piKRm2_NfiCGI


What I got wrong before this

I built for "marketing analysts" for too long. They have Power BI, Python, ChatGPT. They don't need me.

The real customer is the agency account manager who is NOT technical, manages 8 clients, and dreads Monday morning. They need the output, not the tool.

Wrong persona = 0 paying users. Right persona = clear GTM.


Happy to go deep on: pandas aggregation architecture, prompt engineering for accuracy, or running a SaaS on free API tiers without it blowing up.

kashifdata.online

posted toAvatar for product KashifData
KashifData
  1. 2

    The one-line fix is the real lesson here. Most makers ship first and hope the math doesn't matter. You caught it before it hurt someone. That's the difference between a feature and a liability

  2. 2

    Solid lesson here. And what's really dangerous with AI is how confidently they give their answers. If someone isn't careful, it's easy to believe the AI response without putting in a second thought.

    I had run into a similar issue with LLMs early on -- I gave GPT the scenario of a some shares in a company and asked it how much dilution would be necessary if a new investor joined. It gave me a confident answer but it felt off to me. So I ran the calculations and saw it was off by about 1.2 million shares.

    I know there are people to run these calculations but imagine if people were to rely on AI for these calculations. It could have devastating consequences and they wouldn't even know.

  3. 2

    Same problem here. I'm building an AI coaching feature for an indoor rowing app and the early version would confidently tell users their pace was improving when it wasn't. Pre-computing the actual stats and only letting the LLM write the interpretation fixed it completely.

    Being your own target user helps a lot too - when the AI tells you something wrong about your own training data, you notice immediately.

  4. 2

    the pandas pre-compute fix is solid engineering, but honestly the bigger lesson in your post is the persona pivot at the end and you barely unpacked it. building for technical users who already have ChatGPT/Power BI is the most common mistake I see in AI tool startups right now. agency account managers who can't write SQL but own client retention, that's a real wedge. curious how you found that persona, did agencies actually tell you, or is it still a hypothesis ?

  5. 2

    The "LLMs hallucinate plausible numbers with full confidence" line is exactly what we hit when we shipped AI claim review for collision shops. Early version was reading repair photos and "computing" supplement totals. The numbers looked right, the format looked right, they were completely made up.

    Same fix philosophy as yours: stop asking the model to compute. We pre-extract every photo annotation, line item, and supplement history into structured JSON, then the LLM only writes narrative explanations and flags discrepancies. It's allowed to say "these two numbers don't match," it's not allowed to do the subtraction.

    The persona pivot is the harder lesson though. Curious how you found the agency account manager persona?

    1. 1

      Thanks Artur,

      Well, after searching the most post that alines with the value we provide we found that the Marketing agencies are #1 from others that we solve their pain points .. and generally kashifdata is for every decision maker that is not able to afford the data analysts budget and don't have tech background

  6. 2

    Your journey is a perfect case study of stochastic entropy manifesting as confident failure. Standard AI analysts focus on syntax, but the bottleneck is always the underlying schematic of the logic. Fixing the outputs is the easy part; re-aligning the geometric progression of the model's reasoning is the true challenge. I'd be curious to know if you neutralized the latent bias in the initial logistics map of the system, or if you just optimized for local minima. Decipher the logic, avoid the local minimum.

  7. 2

    The core problem you hit is exactly why I'm taking a different approach with AI in my project. LLMs hallucinate with full confidence and there's no way to know from the output alone whether the answer is real or made up.

    Your fix is right for analytics. Pre-compute the facts, let the AI write the narrative. Separate the math from the language.

    I'm building a blockchain where AI agents operate as protocol primitives and we enforce the same principle at the chain level. The AI can publish signals and store observations but every operation has fixed semantics that the protocol understands. The chain doesn't ask the AI to compute state. The chain computes state and the AI reacts to it.

    It's the same insight you landed on. Don't let the AI do the thing it's bad at. Give it pre-computed facts and let it do what it's actually good at.

    The persona shift from analysts to account managers is a good catch too. The person who needs the output is rarely the person who can build the tool.

  8. 2

    The persona pivot at the end is the part that actually matters and it's easy to miss.

    Marketing analysts already have Power BI, Python, and ChatGPT. They're fine. The agency account manager juggling 8 clients who's still building reports manually at 11pm Sunday that person has nothing. That's where the real problem is.

    The hallucination thing is also something most people just quietly ship around. Separating the computation from the language model is the right call and honestly not obvious when you're deep in it. The fact you caught it before someone tanked a client's budget with it is the bit that matters.

    Quick question, how are you thinking about trust with the account manager persona? These people are presenting directly to clients. One wrong number and they never open it again. Are you showing any kind of data source or confidence indicator so they can sanity check before the Monday call?

    Rooting for this. The problem is real.

  9. 2

    That’s a frustrating but very real experience AI can sound confident even when it’s off. The key takeaway is building strong validation steps and not relying on a single output. Iterating and refining like you did is what actually makes these systems smartplayofficial reliable. Curious to hear what checks or methods worked best for you.

  10. 2

    ran into exactly this - confidently wrong metrics for weeks on my sprint planner. same root: I trusted the model to compute what I should've pre-computed first. the confidence is the tell.

  11. 2

    ran into exactly this - confidently wrong metrics for weeks on my sprint planner. same root: I trusted the model to compute what I should've pre-computed first. the confidence is the tell.

  12. 2

    The "pre-compute everything, let the AI write narrative only" pattern saved
    my product too.

    I was building analysis reports where the AI generated citations with sample sizes, percentage breakdowns — all looked professional, all fabricated.

    Same thing you described: confident, wrong, and dangerous.

    The fix was identical to yours. Every number comes from a verified source or a real calculation. The AI's job is storytelling, not math.

    The moment I stopped treating the LLM as a calculator, accuracy went from maybe
    60% to essentially 100%.

    The persona pivot is the other gem here. "The person who needs the output, not the tool"

    -that reframe alone is worth more than any technical fix.

    I went through the same shift: stopped targeting people who already have solutions
    and started targeting people who don't even know the problem exists.

    How are you handling cases where the pandas pre-computation itself has edge cases? Like division by zero on spend columns or channels

    with single-day data skewing the aggregation?

  13. 2

    This is the real issue. The danger isn’t just bad output, it’s output that sounds convincing enough to act on.

    A lot of the opportunity in this space is not making AI louder, it’s making the analysis more grounded and more honest about what it knows, what it doesn’t, and what needs checking next.

  14. 2

    This is painfully relatable. I've built TrendyRevenue (AI idea validation – live) and ran into the exact same hallucination problem. LLMs are confident liars when you ask them to do math on raw data.

    Your fix – pre-compute in pandas, feed clean JSON – is exactly what I landed on too. But one thing I'm still struggling with: how do you handle edge cases where the data structure varies wildly (different column names, missing values, weird formats)? I'm doing some basic sanitization but it's brittle.

    Also, the 'wrong persona vs right persona' point – I think I'm making the same mistake. I built for 'founders' but maybe I need to narrow to 'solo devs with a failed product'. How did you validate the persona shift before rebuilding messaging?
    Live link without signup is bold. Respect.

  15. 2

    Hit the same wall in a different domain (city ranking grounded on Census/BLS/climate data). The pandas-as-truth, LLM-as-narrator split is the right end state. Two things I'd add from the layer past your fix:

    1. The model will sometimes ignore your structured facts and re-derive them from training data, especially when your numbers are unusual. Fix: name the values explicitly in the prompt (cost_burden=39%) and tell the model to quote them in its narrative. If the quote drifts from input, a deterministic check flags it before it hits the user.

    2. Pin a small golden set on the narrative side too. We saw verdicts drift across model versions even with locked numbers. 8 datasets, 8 known-correct narratives, cheap LLM-as-judge on every prompt change. Catches the "numbers right, conclusion reversed" failure mode.

    The persona shift is the bigger insight here. Account managers wanting confidence over flexibility maps to half the AI categories I can think of right now.

    1. 1

      Thanks bladon

  16. 2

    This hits hard — I made the same mistake early on, trusting LLM math and got “perfect-looking” wrong reports 😅
    Pre-computing in code and letting AI just explain it is the only thing that actually made my outputs reliable too.

  17. 2

    This is the part most “AI analyst” products get wrong: the dangerous failure mode isn’t an obviously bad answer, it’s a polished answer with the wrong numbers.

    The pandas → clean facts → LLM narrative pattern makes a lot of sense. Let deterministic code do the accounting, let the model do the explanation. That separation is probably the difference between a cool demo and something an agency can actually trust with client decisions.

    The persona shift is also underrated. Analysts may want flexibility, but account managers want confidence, speed, and a report they can send without embarrassment.

    The next moat might not be “better AI,” but better trust UX: showing the source calculation, highlighting assumptions, and making it easy to verify why a recommendation was made.

    1. 1

      Thanks Palmou for your time and for your valuable recommendations

  18. 2

    This is a solid lesson, but the real issue wasn’t just “LLMs are bad at math”—it was a separation of responsibilities problem; you were asking a probabilistic system to do deterministic work, and it gave you something that looked right instead of something that was right. The fix you implemented (pandas for computation, LLM for narrative) is the correct architecture, and honestly should be the default pattern for anyone building “AI analysts,” especially in high-stakes domains like marketing spend. The more interesting part is your persona shift—that’s where the product actually becomes viable, because non-technical account managers don’t care how it’s computed, they care that it’s fast, clear, and trustworthy. The next challenge isn’t generating reports, it’s proving accuracy and building trust at a glance (e.g., showing how numbers are derived, confidence levels, or quick validation hooks), otherwise you risk the same “looks right but…” skepticism coming back. How are you planning to make users trust the output without having to double-check it themselves?

    1. 1

      I appreciate your valuable review CALLEL !

      Concerning the trust, we've a part in the landing page that explain exactly how the data is being treated and analysed and i think could be enough with the usecases in the landing also with real datasets

  19. 2

    Sounds like the updates changed everything and i really liked the live shareable report and the pdf free download

    1. 1

      Thanks sarah

  20. 2

    The biggest advantage in your kashifdata is that it supports Arabic easly which make it stand in the race alone and far away from those complex BI tools like power bi, looker and tableau .. We the arabic world are very thinkful for this product

    1. 1

      Thanks Faress for your motivation

  21. 2

    I subscribed in Kashifdata starter and honestly i can say its really valuable and worth its price. The speed and the accuracy of the report results, the powerpoint file , and the most important feature .. the sheareable link that i can share it publicly or privaltly with a password with my stakeholders .. those features are very impressive and unprecedented honestly ... keep improving

    1. 1

      Glad to here that you liked the pro version and i appreciate it

  22. 2

    The live report is so powerful and very insightful .. This is genuily helpful . Thanks !

    1. 1

      Thank you too valdez

  23. 2

    I think this solve a lot of reports generating headache .. Its really great

    1. 1

      Thanks a lot sidos