Tributia · AI assistant (RAG)
An assistant that answers tax questions with the regulation in hand
Tributia helps Peruvian accountants understand the rules of SUNAT, Peru’s tax authority. It looks up the answer in the official documents before replying and shows where it came from.
- Which expenses can I deduct from income tax?
- Plain-language answer, based on the rule in forceSources: Income Tax Law
- Several models race: the first to answer wins
The problem it solves
Tax regulation is spread across laws, decrees, resolutions and reports that change often. Finding the text currently in force takes time, and a generic AI assistant can confidently state something the regulation doesn’t say. Tributia answers only with what it finds in the official sources.
What it automates
It automates searching the regulation. Instead of going through laws, decrees and reports one by one, the accountant types the question and gets the answer with the rule in force and its sources. Under the hood, several AI models race to answer and every request is logged to measure quality.
What it does
Answers in plain language
It explains the rule directly, without the tone of a legal document.
Shows its sources
Every answer states which regulation or document it came from.
Tells current rules from repealed ones
It prioritizes the text in force and warns when validity is in doubt.
Follows the conversation
It remembers the last few turns, so you can ask a follow-up without repeating the context. Long questions are split into parts.
Says when it doesn’t know
If the question is out of scope or there isn’t enough basis, it says so instead of making something up.
Suggests what to ask next
It ends with three related questions.
How it’s built
- 01
Sources
About 40 official regulations on invoicing, VAT and excise tax, income tax and the Tax Code, split into chunks and stored as vectors in Supabase.
- 02
Two-step retrieval
First, 40 chunks similar to the question are fetched. Then a re-ranker reads them together with the question and keeps the best 10.
- 03
Model race
The request goes to two models from different providers at once and the first to answer is used. If 3 seconds pass with no answer or one fails, the next one joins.
- 04
Measurement
Langfuse logs every request and every model attempt. A dashboard shows which model wins, which fails and how long it takes, and a bank of 43 questions is used to evaluate with RAGAS before shipping a change.
AI models
- Gemini 3.6 Flash
- Writes the answers. It is first in the race.
- GPT-OSS 120B
- OpenAI’s open model, served by Groq and by Cerebras. It starts alongside Gemini and wins if it answers first.
- Gemini 3.5 Flash and Llama 3.3 70B
- They join the race if nobody answers within 3 seconds or a model fails.
- Gemini 3.1 Flash-Lite
- Last in the chain. It also splits compound questions.
- Llama 3.3 70B, GPT-OSS 120B and Gemini 3.1 Flash-Lite
- As fast models, they rewrite the question using the conversation history.
- Voyage 4 Lite
- Turns documents and questions into vectors for search.
- Voyage Rerank 2.5 Lite
- Reorders the retrieved chunks and keeps the most relevant.
- Jev (TypeSafe)
- Decides whether the question is in scope before searching.
- Gemini as judge
- Scores with RAGAS whether each answer is grounded in the regulation retrieved.
Technologies
- RAG
- FastAPI (Python)
- Supabase
- Langfuse
- RAGAS
- Groq
- Cerebras
- React
- Vite
- Tailwind CSS
From this project to your operation
What it means for your company
The same method works for an internal assistant that answers from your manuals, contracts, policies or catalog, stating where each answer comes from.
Book a free call
30 minutes, no commitment. We send your proposal within 48 hours.