Built on real Caterpillar-dealer aftermarket sales data from Tractafric Equipment the same dealer network behind my financial process automation project this project asks whether a sales manager can question the data directly instead of building a pivot table. A FastAPI backend turns a plain-language question into a single read-only SQL query, run through a local Ollama model (no cloud APIs) and checked by a two-tier guardrail layer a sqlglot-based safety gate plus a semantic linter before it ever touches the 3.1-million-row DuckDB warehouse. The real engineering problem wasn't prompting the LLM; it was the data itself: five verified traps that make the "obvious" SQL confidently wrong with no error, including a per-row running-total column that overstates revenue by 6.4x if summed naively, an 83%-empty reporting table where COUNT(*) is not a transaction count, three years of data silently truncated to exactly 1,000,000 rows and unevenly by country, and geography encoded only inside a French-language dealer-code string. Every answer streams back live with its exact SQL, a narrated explanation, and caveats automatically attached whenever the query touches unreliable data, plus one-click export to CSV, Markdown, HTML, Excel, or PDF, auto-generated charts, and a self-serve data-exploration tab. A 14-configuration evaluation matrix 6 local models times reasoning on/off, plus 2 baselines, including adversarial cases that must be refused outright benchmarks accuracy, latency, and correctness to recommend the best model for the hardware it runs on.
Interactive Gradio chatbot combining LLaMA 3.1 and Neo4j knowledge graphs with RAG for accurate natural-language answers.
Production microservice web app (Django + ReactJS) automating support computing and claims generation, cutting a multi-day process to minutes.
Offline agent that turns plain French, English, or Arabic questions into verified SQL over a 117K-row Caterpillar support-claims database, validated at 87% execution accuracy on a 100-question, 3-language benchmark.