Inspiration

Mexican small businesses generate and receive large volumes of CFDI electronic invoices, but fiscal and operational reviews are still highly manual. Small inconsistencies in payment method, payment form, missing payment complements, or accounting treatment can become costly exceptions later.

FV® Fiscal Copilot was created to turn those technical exceptions into clear, actionable information for finance and administration teams.

What it does

FV® Fiscal Copilot combines deterministic CFDI validation rules with Gemini on Google Cloud.

The workflow:

  1. Receives anonymized CFDI data.
  2. Validates key fiscal and operational fields.
  3. Detects exceptions such as PUE with payment form 99 or PPD without a related payment complement.
  4. Classifies findings using a traffic-light risk model.
  5. Sends only a minimal non-identifying summary to Gemini.
  6. Gemini explains what was detected, the operational risk, and the next recommended review action in clear Spanish.

The system is designed as an operational control assistant. It does not replace professional accounting, tax, or legal judgment.

How we built it

The solution is built in Python and Streamlit.

A deterministic FV® Tax Engine performs the first validation layer. A new competition-specific AI workflow connects those results to Gemini through Vertex AI using the Google Gen AI SDK.

The application is packaged with Docker and designed for deployment on Google Cloud Run.

For privacy, the public demonstration uses synthetic and anonymized information only.

Challenges

The main challenge was combining deterministic fiscal controls with generative AI without allowing the model to invent tax facts or legal conclusions.

To reduce this risk, Gemini receives only a restricted validation summary and is instructed to explain the detected condition without adding unsupported tax rules, amounts, dates, RFCs, or conclusions.

Another challenge was designing a workflow useful to finance users who may not have technical knowledge of CFDI validation or AI systems.

Accomplishments

  • Built an explainable CFDI risk workflow.
  • Combined rule-based controls with Gemini reasoning.
  • Created a Spanish-language financial operations copilot.
  • Protected taxpayer information by minimizing the data sent to the AI layer.
  • Prepared the application for containerized deployment on Google Cloud.

What we learned

AI is especially valuable when it complements deterministic business controls instead of replacing them.

For fiscal operations, the strongest architecture is a hybrid approach: auditable rules determine what happened, while Gemini helps explain why the finding matters and what a human should review next.

What's next

The next stages include XML ingestion, payment-complement matching, VAT/ISR workpapers, operational dashboards, Odoo integration, and automated review workflows for Mexican small businesses.

Pre-existing work disclosure

The deterministic CFDI validation engine existed before this competition and is reused as a technical component.

The Gemini/Vertex AI explanation layer, AI-native business workflow, Streamlit user experience, Cloud Run packaging, competition positioning, and evidence workflow were created specifically for the Build with Gemini XPRIZE edition.

What it does

How we built it

Challenges we ran into

Accomplishments that we're proud of

What we learned

What's next for FV® Fiscal Copilot / Gemini XPRIZE

Built With

Share this project:

Updates