Skip to content
Mohamed TRIKI
Back to internships & projects
ChatBootGC

ChatBotGC — AI Assistant for Civil Engineering Standards

  • Date : 2026
  • Artificial Intelligence
  • Completed

RAG chatbot that answers questions on civil engineering standards (BAEL, Eurocode 2, DTU, NF EN) in English, French or Arabic, citing the exact document and page.

Overview

Summer internship at AFEC (Accuracy For Exceptional Construction), a civil engineering design office in Sfax, from July to August 2026.

ChatBotGC answers natural-language questions on civil engineering standards (BAEL, Eurocode 2, DTU, NF EN). Every answer cites the exact document and page it comes from. It works in English, French and Arabic, switches between 6 free LLM providers, and documents can be added or removed without re-indexing everything.

Key figures

standards indexed (5,119 chunks, ~619k tokens)
10
standards indexed (5,119 chunks, ~619k tokens)
free LLM providers in the fallback chain
6
free LLM providers in the fallback chain
answers judged incorrect on the 50-question benchmark
0
answers judged incorrect on the 50-question benchmark
interface tests passed (Playwright)
50/50
interface tests passed (Playwright)

Technologies

Problem

Engineers lose time looking for a value or an article in hundreds of pages of PDF standards, and a general-purpose LLM can make answers up. The goal was an assistant that relies only on the company’s documents and whose every answer can be checked.

Solution

An end-to-end RAG pipeline: PDF extraction (PyMuPDF), regex cleaning and article-based chunking (about 300 tokens with a 50-token overlap) that keeps the printed page and article numbers; a ChromaDB vector store with multilingual-e5-base embeddings; hybrid retrieval that reranks 30 semantic candidates (65 % semantic, 35 % lexical, bonus for exact numeric matches) and keeps the best 8; generation through a fallback chain of 6 free LLM providers; and a component-based Streamlit interface.

My contribution

Designed and built the whole system on my own: corpus preparation, vector store, hybrid retrieval, multi-provider generation with fallback, index synchronisation, interface, a 50-question evaluation benchmark with an LLM as judge, Playwright tests, and the technical documentation (developer, user and API guides, LaTeX report).

Results

On a 50-question benchmark graded by an LLM judge, the application never crashed, the average retrieval confidence was 0.792 and no answer was judged incorrect: when the system fails, it declines to answer instead of making something up. Direct article lookups score 4.62/5. Mistral Small answered all 50 questions (3.54/5); Groq Compound scored highest (3.90/5) but answered only 29 because of rate limits — a quality-versus-reliability trade-off that justifies the fallback chain. Next steps: OCR for scanned PDFs, multi-document questions, streaming answers and public deployment.

Features

  • Answers that cite the exact document, printed page and article
  • Hybrid retrieval: 30 semantic candidates reranked with a lexical score, with a bonus for exact numeric matches
  • Automatic fallback across 6 free LLM providers (Gemini, Groq, Cerebras, OpenRouter, Mistral, GitHub Models), about 15 models
  • Guardrails: deduplicated citations and a relevance threshold (0.35) that flags out-of-corpus questions instead of inventing an answer
  • Incremental index sync: a SHA-1 manifest re-processes only the PDF that was added, changed or removed, straight from the interface
  • Streamlit interface: several conversations, light and dark themes, FR/EN/AR with RTL display for Arabic, source cards showing relevance, mobile-friendly, AFEC branding