Capstone · UDABOL · 2026 · Private code
AdvAI
AI legal contract auditing with verifiable citations.
My role
Design, architecture and fullstack development (solo).
Stack
- Next.js 16
- React 19
- TypeScript
- Python
- FastAPI
- SQLite FTS5
- Ollama
- RAG
- SSE
- pytest
The problem
Reviewing a contract against Bolivian civil and commercial codes and case law takes hours, and LLMs tend to hallucinate articles. AdvAI splits a contract into clauses and returns, for each one, a risk level, an analysis and verbatim, verifiable citations.
Highlights
- 01Hybrid search: BM25 (SQLite FTS5) + bge-m3 embeddings fused with RRF over 3,267 articles and 971 supreme court rulings — retrieval hit@8 went from 42.9% to 80%.
- 02The model only picks keys from the sources shown and the quoted text is inserted by the system: 82.9% correct citations and 94.6% of clauses with no severe error in internal evaluation.
- 03Personal data is anonymized before any text reaches the cloud; local LLM (Ollama, qwen3.5 9B) plus free providers with automatic failover.
- 04Resumable background worker, live progress via SSE, version diffing and DOCX/PDF reports.
- 05Backend with 69 tests and ≥90% coverage enforced in CI; Next.js 16 + React 19 frontend with a PDF viewer and risk-highlighted clauses.
Next project
CarX →