About the Project

Inspiration

Nigeria's Tax Act of 2025, which came into effect on January 1st, 2026, introduced sweeping changes to how individuals and businesses are taxed. While the law aims to modernize tax administration, it also made compliance significantly more complex for everyday taxpayers and small businesses who lack access to professional tax advisory services.

I was inspired by a simple question:

"How can ordinary Nigerians understand and comply with the new tax law without needing a tax consultant?"

Most existing tools either provide static calculators or dense legal text. I wanted to build something different --- an AI system that can reason about tax laws, interpret financial documents, and explain obligations in plain language.

This led to Tax AI: an AI-powered tax assistant designed specifically for Nigerian taxpayers under the 2025 Tax Act. (link)


What I Built

Tax AI is composed of three core modules:

1. AI Tax Assistant

A conversational interface where users can ask natural-language questions about Nigerian tax law.

  • Powered by Gemini 3
  • Uses Retrieval-Augmented Generation (RAG)
  • Grounded in the Nigeria Tax Act 2025 and relevant rulings
  • Provides citations and context-aware answers

2. Tax Estimator

An interactive estimator for: - Personal Income Tax (PIT) - Company Income Tax (CIT)

It produces transparent breakdowns using formulas such as:

( \text{Taxable Income}{=tex} = \text{Gross Income}{=tex} - \text{Allowable Deductions}{=tex} )

Progressive tax bands are applied as:

$$ \text{Tax} = \sum_{i=1}^{n} r_i \times b_i $$

where ( r_i ) is the tax rate and ( b_i ) is the portion of income in each band.

3. Bank Statement Analyzer

A document-processing tool that:

  • Parses uploaded bank statement PDFs
  • Extracts transaction data
  • Identifies and summarizes credit inflows

This helps users:

  • Understand taxable inflows
  • Prepare data for tax estimation
  • Detect irregular income

How I Built It

The system was built using:

  • Next.js and TypeScript
  • Gemini 3 for reasoning and document understanding
  • RAG pipelines for legal grounding
  • PDF parsing tools
  • Vercel Blob for file storage
  • Tailwind CSS and Shadcn UI

The Gemini API made it possible to use the filestore and filsearch functionalities which eliminated the need to create a RAG system all by myself.

Architecture flow:

User Input → Context Retrieval → Gemini 3 Reasoning → Structured Output

Challenges I Faced

  1. Translating Legal Text into Computation\ Tax law is written for lawyers, not machines.

  2. Hallucination Control\ Responses are grounded using retrieved legal context and citations.

  3. Document Parsing Reliability\ Nigerian bank statements vary widely in format. The accuracy of the bank statement analyser is still an issue that needs improvement.

  4. Performance vs Accuracy\ Balancing speed with trustworthy output.


What I Learned

  • AI is strongest when grounded in domain knowledge.
  • Explainable AI matters in legal and financial systems.
  • RAG is essential when correctness matters more than creativity.
  • Multimodal AI enables powerful real-world workflows.
  • Building a system like Tax AI that involves user-input led calculations requires strong non-ai modules to produce consistent calculation results.

Impact

Tax AI shows how Gemini 3 can: - Interpret complex legal frameworks - Analyze financial documents - Provide human-friendly guidance

It is a step toward making tax compliance accessible, transparent, and understandable for Nigerians affected by the new tax law.


Links

Built With

Share this project:

Updates