CNAMji – Tunisia’s Smart Health Insurance Assistant

Inspiration

It all started with a shared frustration: trying to understand and use Tunisia’s CNAM health insurance system felt overwhelming complicated forms, legal terms in French, and endless procedures. Many citizens, healthcare workers, and HR professionals waste hours just to find out what they're entitled to.

We imagined a smarter way what if people could just ask questions in Arabic or French and get instant, legal answers backed by real law? That dream became CNAMji.

What it does

CNAMji is Tunisia’s first bilingual legal assistant focused entirely on health insurance. It understands and responds to queries about the Law establishing a health insurance system in Arabic and French, helping users instantly understand their rights and obligations.

Key features:

  • Legal Chatbot: Ask anything about reimbursements, coverage, CNAM procedures, and contributions with answers based on the actual law articles.
  • Reimbursement Calculator: Calculates refunds for consultations, medications, hospitalization, and lab tests.
  • Contribution Estimator: Simulates employer-employee CNAM contribution splits.
  • Bilingual Support: Full support for both Arabic and French, with natural language understanding in both.

Document Scanning Module (Separate from Chatbot)

Using a custom OCR system (based on LLama 4 + VLLM), users can:

  • Upload or take a picture of CNAM forms (reimbursement slips, invoices, etc.)
  • Automatically extract key data: patient ID, dates, procedure codes, prices
  • Populate a structured digital form that mirrors the official CNAM format
  • Get instant reimbursement estimates based on extracted data from scanned forms.

How we built it

  • LangChain + FAISS: For retrieving relevant sections from Law establishing a health insurance system using vector similarity.
  • Groq API + RAG: For fast, citation-backed answer generation in both Arabic and French.
  • VLLM + LLaMA 4 OCR: For scanning CNAM documents with handwritten or printed text.

Challenges we ran into

  • Parsing and interpreting legal text with precision, especially in a multilingual context.
  • Handling mixed-language inputs (Fr + ar) and aligning them with law-based answers.
  • Designing a reliable, fast OCR pipeline for various CNAM document formats.
  • Building a modular system with chatbot, OCR, and calculation features without clutter.

Accomplishments that we're proud of

  • Built Tunisia's first AI health insurance law assistant, fully bilingual.
  • Delivered article-referenced answers with clarity and legal backing.
  • Developed a CNAM form scanner aligned with real CNAM formats.
  • Created a user-centric tool that simplifies legal complexity without legal training.

What we learned

  • Arabic NLP for legal use cases is an underexplored but high-impact field.
  • User trust grows when answers are cited from the law transparency matters.
  • Separating components (chatbot vs scanner) improves flexibility and modular scaling.
  • UX/UI design is critical legal tech must be friendly, not intimidating.

What's next for CNAMji

  • Expand legal coverage to include maternity leave, retirement, and disability law.
  • Deploy as mobile-first PWA to improve accessibility across Tunisia.
  • Partner with healthcare providers to digitalize CNAM workflows end-to-end.
  • Add auto-suggestion of article references even during partially written queries.

CNAMji is just the beginning a smarter, digital-first way to bring the law to the people.

Built With

Share this project:

Updates