Inspiration

Tax season in Mexico is stressful for millions of people. With multiple tax regimes, confusing SAT rules, and expensive accountants, most contributors just guess, and pay the consequences. I wanted to build something that makes fiscal knowledge accessible to everyone, not just those who can afford professional advice.

What it does

FiscalAI is a two-feature web app for Mexican taxpayers. The AI chat assistant answers questions about tax regimes (RESICO, business activity, salaried workers), deductions, and SAT obligations in plain Spanish. The expense classifier uses a custom-trained ML model to automatically categorize any expense description into 7 categories: transportation, equipment, services, office, food, health, and personal.

How we built it

Frontend: React + Vite + CSS Modules, deployed on Vercel Backend: FastAPI (Python), deployed on Render AI: Google Gemini 2.5 Flash Lite via API with a custom system prompt trained on Mexican tax rules ML: scikit-learn pipeline (TF-IDF vectorizer + Logistic Regression) trained on a custom Spanish-language expense dataset Environment: Dynamic CORS and environment variables for clean local and production setups

Challenges we ran into

Getting Gemini to consistently respect regime-specific rules was tricky — early versions would hallucinate deductions for RESICO users, who actually have no deductions at all. Crafting a precise system prompt that handles edge cases without losing conversational tone took several iterations. On the ML side, building a meaningful training dataset from scratch in Spanish with no existing labeled data was time-consuming but rewarding.

Accomplishments that we're proud of

Training and deploying a real ML model from scratch with zero prior experience in machine learning. The classifier runs entirely on custom data I labeled and engineered myself, no pre-trained models or external datasets. Also proud of the full-stack deployment pipeline working end-to-end on the first hackathon submission.

What we learned

How to integrate a generative AI API into a production backend, how to engineer system prompts for domain-specific accuracy, and the fundamentals of text classification with scikit-learn, TF-IDF, pipelines, and logistic regression. Also learned the importance of environment variable management across local and cloud environments.

What's next for Fiscal-AI

Upload a photo of a receipt and classify it automatically using Gemini Vision Support CFDI validation Personalized tax calendar with SAT deadlines by regime

Built With

Share this project:

Updates

Submission history