Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ContaAI

AI-powered Romanian accounting document OCR and audit system. Processes invoices (Facturi), receipts (Bon Fiscal), and other fiscal documents, extracting structured data and running a multi-dimensional confidence audit.

Features

  • 📄 Supports PDF and image inputs
  • 🤖 Multi-provider AI: Gemini, OpenAI, OpenRouter
  • 🧮 6-dimension confidence scoring system
  • 🇷🇴 Romanian CUI validation via ANAF API
  • 📊 Export to XML (e-Factura, SAGA formats)
  • ⚠️ Automatic human-review flagging for low-confidence documents

Setup

1. Python Backend (Engine)

Install dependencies and configure environment:

pip install -r requirements.txt
cp .env.example .env

Edit .env and add your API Keys (Gemini, OpenAI, or OpenRouter). If you use Vertex AI, provide the path to your google-credentials.json.

Run the server:

uvicorn main:app --reload

2. Desktop Application (Avalonia UI)

Located in the ContaDesktop/ folder.

Prerequisites

Run / Debug

cd ContaDesktop
dotnet run

Build for Production (macOS)

Use the included build script to package the .app bundle:

cd ContaDesktop
chmod +x build_app.sh
./build_app.sh

The output will be in ContaDesktop/publish/.

Development

  • Backend: main.py (FastAPI), export_engine.py (logic), xml_generator.py (XML formatting).
  • Desktop UI: ContaDesktop/MainWindow.axaml (UI layout) and ContaDesktop/MainWindow.axaml.cs (C# logic).

⚠️ Important

Credentials: Never commit .env or google-credentials.json. These are listed in .gitignore. Ensure you have these files locally before running the app.

API

POST /process — Upload a document for OCR and audit.

Returns structured JSON with extracted fields, confidence scores per dimension, and export-ready XML.

Confidence Scoring

Dimension Weight What it checks
Field Completeness 20% All required fields present
Line Item Math 25% qty × price ≈ line total
Global Math 20% Sum of lines ≈ invoice totals
CUI Validation 15% ANAF registration check
Value Plausibility 10% Valid VAT rates (date-aware), no negatives
Cross-Reference 10% net + VAT = gross, date logic

Documents scoring < 0.85 are flagged for human review.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages